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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52B38C4332F for ; Thu, 17 Nov 2022 23:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240213AbiKQXUc (ORCPT ); Thu, 17 Nov 2022 18:20:32 -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-Google-Smtp-Source: AA0mqf7OSmJg5DXALtvfgPq+0hk/shk2SoH+UxPLX4rMhAp0kHTk8vEJIU/E5ferYxsFYc07URsZsw== 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" 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