Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2767063rwb; Thu, 17 Nov 2022 16:04:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf6q04XdwVS1ADS6DMJR6EAst0a7UrLgon93nx6pu0WP3pjfvDD9NpL4CUt2eHGXkOymuBfL X-Received: by 2002:a05:6402:b6d:b0:468:eee7:324c with SMTP id cb13-20020a0564020b6d00b00468eee7324cmr3361511edb.119.1668729857144; Thu, 17 Nov 2022 16:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668729857; cv=none; d=google.com; s=arc-20160816; b=zMrnOGaumuUricSYuh3/Ix3R9OH+LulH+LXMgvujXiwNjaZdK9GJVGuyPTK8JyBZw6 YWVVtRS03Vk0Bwgojr4OT+e93g909NJE46qDctVLjk5yIJPr+Imvtvrtg5LPKPjxxEEU 3UqdVmFUcrse/vAueaVPkXw55Hk8cnw8DPMMTj+R549H1C5/hFwYST5n8Z8djvjazl3m vdySYeF9FEp5cgRBldBn4JGREsGqpwHIxBlxabT94mbuwgkwshdAWt+j/YvpyAto2R2Z I3VJqaINnJJ8iq1vePDxxdfViYt0TgSalk/Zra95drkczjYdLcX21eb3ZnNQRDsDM1qN pDkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Y0Zl62KafxDJ8AwrDahi1bqb4Xk/32bDlmDdXpQC/2I=; b=zGL2XMqcyvo7UZIqP5pcaxo7aJenv4h+lJaKkxk9aG8ml7erEuzIHVFbRICNI28uCC QqHgCU+56b0QZdgmX7LDk/WcXndQSBdiWWz19vGTPGA9bpbQHSDAoLvK1uwsHa60LBbz 0F/p2m4F6tLRObbO6Fj8fXKpouQPgZx18sNtExAYg7mgq9vqHe/5fFBf1TWNpJLx402h fYUjOgrIbW7FlC/fJRxKIwNa+QcG7OEWK8esIZCPqokJBieezbCjPuxhEpMEUwoIiglh 5DNDLMu3ep90elFAPY+GB0drJzRweKTyj0chVI3hCqgdwfGKhHmUcHVZGVb6oVjiJCTU BXIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="McHst7l/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv20-20020a17090760d400b007ae94428c13si1779257ejc.525.2022.11.17.16.03.36; Thu, 17 Nov 2022 16:04:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="McHst7l/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234905AbiKQXUb (ORCPT + 91 others); Thu, 17 Nov 2022 18:20:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234902AbiKQXU2 (ORCPT ); Thu, 17 Nov 2022 18:20:28 -0500 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6691E68 for ; Thu, 17 Nov 2022 15:20:20 -0800 (PST) Received: by mail-qk1-x736.google.com with SMTP id z17so2353856qki.11 for ; Thu, 17 Nov 2022 15:20:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Y0Zl62KafxDJ8AwrDahi1bqb4Xk/32bDlmDdXpQC/2I=; b=McHst7l/f7KmgETncU4ax8Cz1+X0pDSSDz+NpOo85KKRbSTGF3eq2IAlrIRy/FELSJ Y7C0SIlyu5mGQyhzPLIjsCXMOXUrzD5TZH+dJcbaF2LHrVuVcof8hyWOL3D9pZZx4wAD 8LINQRolzJh6QXumNwKV51jsDIdF9sMEo4+5s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Y0Zl62KafxDJ8AwrDahi1bqb4Xk/32bDlmDdXpQC/2I=; b=7AGl2mxjdaHcGAvCY6AIW6w6YOqquAgSh5tTQk16TjYVGOEzPulcaGRo/JiuZ2GfMi zDEdHfCKDySZRfM79FpUmi2k3Ul6kRgU3SoJMFDbYeGIGtWnTD5VStNOjeNYbDFDLuP9 3HVMV3RLfjIXUT9PbqXfz3Ir07fHscSC1fNgJZ75JM/wCCUjGbvIXnU5RIgy33Ur87Ks FlUGOp9luzhcz/INBMjHlUr7F3MzkbzsywsHyqdv15e5I6iVMHtwIFApmYmJ95+9jz5u wWUUxra5BfGQFQiBiq36y9OPdgVv4dtp+EW9cVEf1M4r/ZDnoQdfcweK6uDqE6ElgI9h BI5w== X-Gm-Message-State: ANoB5pmm72F8qY8yn7icno8mwRsmsSxuQrlwA87Ucbi2gsKLkaXIdW5H AFXMcBNWu2Di7mB1g/USlQ7X5ZMMJJG2eQ== X-Received: by 2002:a05:620a:4590:b0:6fa:91f9:e54e with SMTP id bp16-20020a05620a459000b006fa91f9e54emr3849247qkb.53.1668727219474; Thu, 17 Nov 2022 15:20:19 -0800 (PST) Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com. [209.85.219.53]) by smtp.gmail.com with ESMTPSA id c23-20020ac85197000000b003a623e5b9ecsm470929qtn.78.2022.11.17.15.20.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Nov 2022 15:20:17 -0800 (PST) Received: by mail-qv1-f53.google.com with SMTP id mi9so2273816qvb.8 for ; Thu, 17 Nov 2022 15:20:17 -0800 (PST) X-Received: by 2002:ad4:4101:0:b0:4b1:856b:4277 with SMTP id i1-20020ad44101000000b004b1856b4277mr4665856qvp.129.1668727216978; Thu, 17 Nov 2022 15:20:16 -0800 (PST) MIME-Version: 1.0 References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-21-david@redhat.com> <202211171439.CDE720EAD@keescook> In-Reply-To: <202211171439.CDE720EAD@keescook> From: Linus Torvalds Date: Thu, 17 Nov 2022 15:20:01 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH mm-unstable v1 20/20] mm: rename FOLL_FORCE to FOLL_PTRACE To: Kees Cook Cc: David Hildenbrand , 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 , 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" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2022 at 2:58 PM Kees Cook wrote: > > Oh, er, why does get_arg_page() even need FOLL_FORCE? This is writing the > new stack contents to the nascent brpm->vma, which was newly allocated > with VM_STACK_FLAGS, which an arch can override, but they all appear to include > VM_WRITE | VM_MAYWRITE. Yeah, it does seem entirely superfluous. It's been there since the very beginning (although in that original commit b6a2fea39318 it was there as a '1' to the 'force' argument to get_user_pages()). I *think* it can be just removed. But as long as it exists, it should most definitely not be renamed to FOLL_PTRACE. There's a slight worry that it currently hides some other setup issue that makes it matter, since it's been that way so long, but I can't see what it is. Linus