From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: Re: [PATCH mm-unstable v1 20/20] mm: rename FOLL_FORCE to FOLL_PTRACE Date: Wed, 16 Nov 2022 19:53:57 +0100 Message-ID: References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-21-david@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:Subject:From:References:Cc:To: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hBNs0fCA1YSVZR+Dv+5/WhJSk6WUBPQwp43JCvn8T0E=; b=pba35BWKvTU7hm Scsw9unVeWIIL2Wy+/3A5JNatHmRKMVmepLiI4Vm5EwyCtMr6QRgiL5ebxZNSLjOuWVbWYloe1N9r HU975kiLpPvtJP29iZ5SoI9I5J9bM7hjibUHMn2+Rki3HWtTrCm5ZSzQr8Lxxct9AwyjiSaGYl9M2 lbcQxyj8WeCbNYvlcqr5SrPt0H/IKaIaC2o0lO+OJaRVuUggNRGkGONKtyLmMIR7cFaY25S8lJAN+ apA1ayfV8WUpv2kcfdU3043hdI3iRJyLfqYJMmMgbdZiPQvQg4qszCILM23m2/4vW38Ekbd08GfFD oyU19wBZ3mKxzmH5WIVQ==; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668624843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XrMOrTfFoolcBWY273BC4KVOqyrI8gbytsgZlItRSSY=; b=ggnk2mNlajTLNaTYtTEVAXXL1mzLcneUkdkTzCipHOe8bpGYR81K2i0Q1IZkJzxzD6loT0 VKwyQr+j6YAkRE5woCv3D8UX+LCBDyk//mZqtobHn5uAEz5dmYpkCGrHnFc1bjg5+yePtM ZHKhMPO4da92jOYTzViClXv0S4S0ri8= In-Reply-To: Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+glud-user-mode-linux-devel=m.gmane-mx.org@lists.infradead.org Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, Andrew Morton , Jason Gunthorpe , John Hubbard , Peter Xu , Greg Kroah-Hartman , Andrea Arcangeli , Hugh Dickins , Nadav Amit , Vlastimil Babka <> On 16.11.22 19:16, Linus Torvalds wrote: > On Wed, Nov 16, 2022 at 2:30 AM David Hildenbrand wrote: >> >> Let's make it clearer that functionality provided by FOLL_FORCE is >> really only for ptrace access. > > I'm not super-happy about this one. > > I do understand the "let's rename the bit so that no new user shows up". > > And it's true that the main traditional use is ptrace. > > But from the patch itself it becomes obvious that no, it's not *just* > ptrace. At least not yet. > > It's used for get_arg_page(), which uses it to basically look up (and > install) pages in the newly created VM. > > Now, I'm not entirely sure why it even uses FOLL_FORCE, - I think it > might be historical, because the target should always be the new stack > vma. > > Following the history of it is a big of a mess, because there's a > number of renamings and re-organizations, but it seems to go back to > 2007 and commit b6a2fea39318 ("mm: variable length argument support"). > Right. > Before that commit, we kept our own array of "this is the set of pages > that I will install in the new VM". That commit basically just inserts > the pages directly into the VM instead, getting rid of the array size > limitation. > > So at a minimum, I think that FOLL_FORCE would need to be removed > before any renaming to FOLL_PTRACE, because that's not some kind of > small random case. > > It *might* be as simple as just removing it, but maybe there's some > reason for having it that I don't immediately see. Right, I have the same feeling. It might just be a copy-and-paste legacy leftover. > > There _are_ also small random cases too, like get_cmdline(). Maybe > that counts as ptrace, but the execve() case most definitely does not. I agree. I'd suggest moving forward without this (last) patch for now and figuring out how to further cleanup FOLL_FORCE usage on top. @Andrew, if you intend to put this into mm-unstable, please drop the last patch for now. -- Thanks, David / dhildenb