From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F96EC433FE for ; Wed, 16 Nov 2022 18:54:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C221F6B0075; Wed, 16 Nov 2022 13:54:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BD2236B0078; Wed, 16 Nov 2022 13:54:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A72148E0001; Wed, 16 Nov 2022 13:54:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 96A266B0075 for ; Wed, 16 Nov 2022 13:54:06 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 794F0A0641 for ; Wed, 16 Nov 2022 18:54:06 +0000 (UTC) X-FDA: 80140205292.16.AB0F72C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf15.hostedemail.com (Postfix) with ESMTP id C14DAA000F for ; Wed, 16 Nov 2022 18:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668624844; 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=e0HLJWQOrV59rnSGTS6YIVqETW+MetNgrpEQbikp3pa0MOp9YQkUcSBKEy34EwX53rBRFD 0/8z3cE73sZ2kOYmBtxg+J08kdSPfrx1ndau6dZ1tPvBzgkqWSa2ycA4qZIE6IIlwIjnzj IYmDlr5WO9CbNLhnJleRx34142BoDRo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-511-JA0AEu5bNpScb9jgXUBhyg-1; Wed, 16 Nov 2022 13:54:02 -0500 X-MC-Unique: JA0AEu5bNpScb9jgXUBhyg-1 Received: by mail-wr1-f71.google.com with SMTP id v12-20020adfa1cc000000b00236eaee7197so3985479wrv.0 for ; Wed, 16 Nov 2022 10:54:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XrMOrTfFoolcBWY273BC4KVOqyrI8gbytsgZlItRSSY=; b=XVAxr2NBe7/JmumcMhosZVmo49s9Ic+sIunSJkm+yX0WePXB4O7whun5HyX7MzrWa6 BX1zyUoTJAGuGWzHMjcM5N7SlNmyxmGQTA2SBgzCmjSZCsLIpTY/Bc0B0mJKetIffjjM YJ3ruwmhutObhYez6V3ADnxkqJUltJlYbhGChEojz5C5hFh7OcAZ1IrxGpTa14hylToG ctzL1XV5I8n+xLm4W/CTPcD+tei67Q22I9uSbBf7FyXLR/jf33OF+XZ4y3jW6uP456UQ X+GGLQe5otmdYlJST5uNp/puxKNuBLIgor7eT6BhPSAR21CzdFRF/bFpEJd9U9rD8sOH Ou1w== X-Gm-Message-State: ANoB5pny3gAm6Hs9oc06Ln05+qqZw01ThYEGkcIzUmtz1LQrDasSA0ui tP6kWTtkQeXr43KlYJpuaIL2eoG7Dwa6mJBTBP2K5j8Gz2hBBZnIKIlwgF1Fylr+GxKCgmBnzdt CmppuZHXPT6U= X-Received: by 2002:a05:600c:188a:b0:3cf:8e62:f769 with SMTP id x10-20020a05600c188a00b003cf8e62f769mr3135343wmp.52.1668624841278; Wed, 16 Nov 2022 10:54:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf5DCp6F6fiXltcSvKkMYb+ZcNvwNu+I48re+Q7o+sjDMiBTT1rVi2cU7FL82kIKKDnPvsKEPw== X-Received: by 2002:a05:600c:188a:b0:3cf:8e62:f769 with SMTP id x10-20020a05600c188a00b003cf8e62f769mr3135302wmp.52.1668624841029; Wed, 16 Nov 2022 10:54:01 -0800 (PST) Received: from ?IPV6:2003:cb:c704:9f00:a98d:4026:7c44:40fd? (p200300cbc7049f00a98d40267c4440fd.dip0.t-ipconnect.de. [2003:cb:c704:9f00:a98d:4026:7c44:40fd]) by smtp.gmail.com with ESMTPSA id h16-20020a05600c315000b003cff309807esm3012333wmo.23.2022.11.16.10.53.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Nov 2022 10:54:00 -0800 (PST) Message-ID: Date: Wed, 16 Nov 2022 19:53:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 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 , Matthew Wilcox , Mike Kravetz , Muchun Song , Shuah Khan , Lucas Stach , David Airlie , Oded Gabbay , Arnd Bergmann , Christoph Hellwig , Alex Williamson , Oleg Nesterov , Richard Henderson , Ivan Kokshaysky , Matt Turner , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Richard Weinberger , Anton Ivanov , Johannes Berg , Eric Biederman , Kees Cook , Alexander Viro , Peter Zijlstra , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kentaro Takeda , Tetsuo Handa , Paul Moore , James Morris , "Serge E. Hallyn" References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-21-david@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH mm-unstable v1 20/20] mm: rename FOLL_FORCE to FOLL_PTRACE In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668624845; a=rsa-sha256; cv=none; b=pgab9yxacgwfWDXaaqcHXiP1sUP4HZWlIJgNJIYUSOrDRlAa7BUZA8j2kuwVHzXMyCs7HW 7L1W/C11rRlxcrIChdqWAtAFy+zDKWnYj1Gz6B4e0I7BNMPivuqSk4Ba6kE8fXklXi46+4 VyedVxyTc+eF5xKs5m5rv695+FHvc4U= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e0HLJWQO; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf15.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668624845; h=from:from:sender: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:dkim-signature; bh=XrMOrTfFoolcBWY273BC4KVOqyrI8gbytsgZlItRSSY=; b=5Qh38eYUT20D+YfIzVyJBN6yecnJrCOI0uSq/6FV9hF1wzxSTxnyoqRkqrNl9b6w/wuslt X9kEgOzql6wSQt9CxrwsmUAZGTIZ06ODuxNN5Z84UBeDVRfc8VVeCIzftu/VDYBvJ+Vf9g 5DHI74zM+wNSNFVawzIHnAQhEmFaS9I= X-Stat-Signature: r8p3iyr3598caz9ewwjsc8bz36mhzobx X-Rspamd-Queue-Id: C14DAA000F Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e0HLJWQO; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf15.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1668624844-618642 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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