Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp377085pxu; Tue, 1 Dec 2020 13:34:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHhYOrvHkups7lZT50hpq8yTaa1TEeGysc9E7RRnvrbzRKMwoKL4y/1mXNiz6RSIh3UweA X-Received: by 2002:a50:8714:: with SMTP id i20mr5138244edb.200.1606858498653; Tue, 01 Dec 2020 13:34:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606858498; cv=none; d=google.com; s=arc-20160816; b=RL+/QU3MSa6VZJYXyVAflNvaQtTuEFRbfEe1mxrl+Nv2pGx+EVyhOz7bc+ASNLUWMf 2cLGlGsiXU0mV1QtdeqYXc6Id+RfRPdOfmqSsFxrXVqGJD2iTGGTHlNKczd8FjKaPuyP r7vkBiRerE25gQnMChMLIa2ThcXj48raWeZASJJQi3uCSmSQ5DNL9dRIsatl5BfXW6N0 hcHqmiW6vWB8H/aRqLMWUSnku/U0HgYpfRbPoXiBFsHIb0kQapwKjgkXsxtzb5r9O760 VAjFckXSIsTAqHO7+UPWD3AI62/DuCZdrzbyYv09j0iGm5C7lzvcUkx5Flq3e5GTomlB 6n1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=zX/PPBjwEAoCJwrV7B/XlX8RkoJf6/AbTsObIcJJCKU=; b=LYApAMFu5sSzN1OYLMlz1zMGsllCJo+waKG+j9WyXipUJxGMiqZB7HR5xCY3125lb+ NJDzrCUCkmiCOgexhRdWH0/7JZmIzaAXPkiWEczi7XqRBlXaOaxV1UN3s9O1cGSvMgMK ERzhVLHT7K5l1aSEsyNSOqoxxx3IaEv9DquLObzDTdnFnoobXuL9M18clyIHGeL5bdz4 I+7i1UzNBLrmi2q21VLCi7rbKo4JDp0ghKzo9vO4f6u9cwNFw/doBXpvTZR6UQqzPuA5 SBDveOoHxtyT/+VTN76c9fkWrgDqRa6zaje4fsJRK9MKRLTWcmDlRRXPuOxXFgAutIcL vO4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si713191ejd.391.2020.12.01.13.34.36; Tue, 01 Dec 2020 13:34:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728525AbgLAVbt (ORCPT + 99 others); Tue, 1 Dec 2020 16:31:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:49422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgLAVbt (ORCPT ); Tue, 1 Dec 2020 16:31:49 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63B58208C3; Tue, 1 Dec 2020 21:31:06 +0000 (UTC) Date: Tue, 1 Dec 2020 16:31:04 -0500 From: Steven Rostedt To: Axel Rasmussen Cc: Andrew Morton , Chinwen Chang , Daniel Jordan , David Rientjes , Davidlohr Bueso , Ingo Molnar , Jann Horn , Laurent Dufour , Michel Lespinasse , Stephen Rothwell , Vlastimil Babka , Yafang Shao , davem@davemloft.net, dsahern@kernel.org, gregkh@linuxfoundation.org, kuba@kernel.org, liuhangbin@gmail.com, tj@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints Message-ID: <20201201163104.5d178986@gandalf.local.home> In-Reply-To: <20201201162847.654f3013@gandalf.local.home> References: <20201201203249.4172751-1-axelrasmussen@google.com> <20201201162847.654f3013@gandalf.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 1 Dec 2020 16:28:47 -0500 Steven Rostedt wrote: > On Tue, 1 Dec 2020 12:32:49 -0800 > Axel Rasmussen wrote: > > > +/* Called with reg_lock held. */ > > The above comment is reduntant, as the lockdep_is_held() below also suggest > that it is ;-) > > > > static inline char *get_memcg_path_buf(void) > > { > > + char *buf; > > int idx; > > > > + rcu_read_lock(); > > The caller of get_mm_memcg_path() has preemption disabled, which is also > now an RCU lock. So the rcu_read_lock() is somewhat redundant. BTW, both of these comments are FYI. You can keep the comment and keep the rcu_read_lock(). I was just stating that they are redundant, but keeping them may make the code a bit more robust. -- Steve