Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2810488rwb; Thu, 17 Nov 2022 16:50:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf5TDXXk8qe+7ap8gdgNDsqp9dwD9Jdpe0LebcoIVC26Mhr92h2LcH6TAFsJYEslOQSZCWvy X-Received: by 2002:a17:906:a2d8:b0:7ad:fa6c:5e69 with SMTP id by24-20020a170906a2d800b007adfa6c5e69mr4068458ejb.199.1668732623426; Thu, 17 Nov 2022 16:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668732623; cv=none; d=google.com; s=arc-20160816; b=XlqKlLc0cn3tGGZh5oA1feO9jjvoQ1cI4xu7nWovWZ5GOfBSbVg6bEwgXoXin/h5AO OrHlmdfC2e74UEztv7ffoHsKQ7186YWpxAYRKU2/Sm5ZMkohj9LXLZZMjLPmNzXZH5Wj uzA+Fif3b4F9p7lV1zjeAjE9FcTy1qKxKowT1fwcQD3DTPBaKxa0+ByUlP8Ce0S17383 2GUKYxknJ6nX1of7eHNSK+KJJRvQwRNj5ZlL8C6L6dgJNyvuW0xj9zmWmQe/xiOWVb7a dhFT9QKhFApQ4R0T6xbb2PcCBffecis9mmEJntLOSQS7+c9KN/ZFYaPvY2vkZhug07Qz eqlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SdXW0qNT9EJ55g7ZecMibSPRKy2hZHqw3Yh8nMlwERE=; b=xtj138dQBY29fBa1N0XkozAtp35F97HkT2f2omUhglr5oBcFNa7cebIRSq5OO3lVju bgMITn4tqkvbd1SsBUBQOFRkjJx6pRp1BK7mwIdCn0Oachhk68VfPXMrQSMK7CW2FJ0/ RhzBqNABOTnyasWubkRgO3Srls2bvhKY47SVps57jj/TD55KLYcy2kTgqt9X0PdpSZtB PO7cRbEuy2YlWK+zFpSHcjsKnHiawbSbABgd3M1HLbGLUez874a98oHcddXTdZfSQJYP 6xLIgVc1WIESWhlcDvnOTA4ktSYhoJJxMK0uutCUXIGQieDfYDaVk2BINAw+OjhDJ6vL YbBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aU25zccR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rl24-20020a170907217800b0073d74bcac8dsi1515202ejb.513.2022.11.17.16.49.59; Thu, 17 Nov 2022 16:50:23 -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=@chromium.org header.s=google header.b=aU25zccR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240580AbiKRAbb (ORCPT + 91 others); Thu, 17 Nov 2022 19:31:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240496AbiKRAb2 (ORCPT ); Thu, 17 Nov 2022 19:31:28 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D77B6D497 for ; Thu, 17 Nov 2022 16:31:26 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id o13so3601893pgu.7 for ; Thu, 17 Nov 2022 16:31:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=SdXW0qNT9EJ55g7ZecMibSPRKy2hZHqw3Yh8nMlwERE=; b=aU25zccRjTs3wP43k0MIJn4DgVbsnZCNuzNnI2CpXWYIZxXulCGxIQevzOUHHZBnNX P9dqjL6CLaVk8Gd/8VV9yHkQnYw6wZLIF25d9n4/Hz+qw11dfo4C3uVe8ugX4akyWpVq 2j/LOKCC5xRDK3aE2eqqxuB+wZP/Rdy2IY2yY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=SdXW0qNT9EJ55g7ZecMibSPRKy2hZHqw3Yh8nMlwERE=; b=U3XjQKqCfLxSaWysCg22M8DqbUGZCPGQ/JswVW6Rulzk53AxQ47U+nitB/xFFHfsiw COh/aO4Wdx7MxuQINT7vHg1bGQMFw1nF2l/s0PM37o0iDE7e2QuF2feqRS3MkvVs1miE HWxTcnni8AFRF+sSS9xc7Ypux02XbMNkq9Go2X7SUPc5XmuTw9DUKNj+ZSrlSWvEFFNO UJJX1CZWZJQQPhq6bWuXVLnO+Kuz0QJDiGTXlpk8XrJ/5Oruj6ub8WArofQ2fX6yDcyX BvUtHH1jTHT8jVEdC3ThmctEW1k25mpGrASWXvkF4ndRyemc/pfLcGe4lyAqrpvkfNFX ZEwg== X-Gm-Message-State: ANoB5plgZJBwzHZt4g1qNkIW3ZVjnqbCxVsUfGFfG02h2hl8qw9tI7fB oGFlKWs4MIOvYVZF6dbelWkTtQ== X-Received: by 2002:a65:53ca:0:b0:476:dd80:fb29 with SMTP id z10-20020a6553ca000000b00476dd80fb29mr4360083pgr.619.1668731485545; Thu, 17 Nov 2022 16:31:25 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id b14-20020a170902650e00b00186b6bb2f48sm2022328plk.129.2022.11.17.16.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 16:31:25 -0800 (PST) Date: Thu, 17 Nov 2022 16:31:24 -0800 From: Kees Cook To: Linus Torvalds 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" Subject: Re: [PATCH mm-unstable v1 20/20] mm: rename FOLL_FORCE to FOLL_PTRACE Message-ID: <202211171630.8EABF5EDD@keescook> References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-21-david@redhat.com> <202211171439.CDE720EAD@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 03:20:01PM -0800, Linus Torvalds wrote: > 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. My test system boots happily with it removed. I'll throw it into -next and see if anything melts... -- Kees Cook