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 4B165C4332F for ; Fri, 18 Nov 2022 00:31:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 694476B0071; Thu, 17 Nov 2022 19:31:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 61DC28E0001; Thu, 17 Nov 2022 19:31:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46FBF6B0073; Thu, 17 Nov 2022 19:31:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 344486B0071 for ; Thu, 17 Nov 2022 19:31:27 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EB0E814054A for ; Fri, 18 Nov 2022 00:31:26 +0000 (UTC) X-FDA: 80144684172.13.776AA51 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf24.hostedemail.com (Postfix) with ESMTP id 907D2180012 for ; Fri, 18 Nov 2022 00:31:26 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id r61-20020a17090a43c300b00212f4e9cccdso6854246pjg.5 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=MWlzw69KnCob8LsBB060te2Y+YtGLG/69EjiMAuBn0yy4O1iDlQzyFiLan7+IaH1lw aLWg6FfNDKEvjS71pRzIOPk1SvKmTvlWijyIRX18kEJfO4nLFI9CyVDUwTs1k+J+Y76k 91ZQ58lZ56oE1Yyq0QU2Ic24Me3pqyb9M1ejZ28+ty+XP/Fhj4XfZ+AxuIZDo5pCO9nS Hcod95vp3LLEH/ykmYnN47YfdmKcRjGUeTh2HKhCNNuF1Re5HotO8k39+8mLjGWixjOE bZ9WqNcGFT8NvUvo1OVMqhGbuUkZpaJ0Z51JGFmL4UJXoyP9VF3VmHCI8qT8lXISUhbC yRpw== X-Gm-Message-State: ANoB5pleQAtM0qZTGjvVXub7YzTTF3/UPq/U9n9fbSFwWgympMXXn6l/ eOsEVa7n/mLML/Q8htSUVW/Mcg== X-Google-Smtp-Source: AA0mqf5v9a25yS9udq+0hjAH7K4QJBzDVw1q+3i4WQlXa259MMuJPBokO+S42xwRehI9PQV15PiKuw== X-Received: by 2002:a17:902:a508:b0:17c:7aaa:c67d with SMTP id s8-20020a170902a50800b0017c7aaac67dmr4961099plq.171.1668731485478; 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 u11-20020a17090a1d4b00b0020aacde1964sm4046602pju.32.2022.11.17.16.31.24 (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: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668731486; a=rsa-sha256; cv=none; b=xVsrGqaSx7WcjKMPzSvodvvcamtMotQQ7fs86MDUmLgtR1zrKZD4a4Y74PzNwvGRIQnAsA +VhGK6DFPE53DrcS62BpH7pCaL1hBbHwhAwtrcMTvo4T5s3VJsrHs93F20kfBje7wAohLQ GC8CDuywCsEBKBbeudTYjU/O7a6VKQQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=aU25zccR; spf=pass (imf24.hostedemail.com: domain of keescook@chromium.org designates 209.85.216.54 as permitted sender) smtp.mailfrom=keescook@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668731486; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SdXW0qNT9EJ55g7ZecMibSPRKy2hZHqw3Yh8nMlwERE=; b=f5Zfm3F+2y7cOMCQrZsLu8lkaKYKWlLvQ3Mr3uSNbggMqvuQmcQODkeM+dRE6FN+Vk/SZH F5cNRR2YHYOHXujdf3LnnvqcwyowIMtvVuAV+qUHEqvpeS7zpaORwnhWe2V4wJarDoHeRT 8/04FzR6Ob3VOZhu6Gsu4q5wd1e2hRk= Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=aU25zccR; spf=pass (imf24.hostedemail.com: domain of keescook@chromium.org designates 209.85.216.54 as permitted sender) smtp.mailfrom=keescook@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 907D2180012 X-Rspam-User: X-Stat-Signature: t5iz7qn5waxf6fkko9ngzdomwm36ukwc X-HE-Tag: 1668731486-749383 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 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