mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Chris Down <chris@chrisdown.name>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Chris Mason <mason@kernel.org>, Paul Moore <paul@paul-moore.com>,
	Kees Cook <kees@kernel.org>, Willy Tarreau <w@1wt.eu>,
	audit@vger.kernel.org
Subject: Re: [PATCH 2/2] mm/util: drop FOLL_FORCE from get_cmdline()
Date: Sun, 29 Nov 2026 10:44:00 +0100	[thread overview]
Message-ID: <cd105eca-aec9-4310-8479-4e33cee1f6de@kernel.org> (raw)
In-Reply-To: <ee6684aab8419d0d4c7484673194b61c05bfd388.1795891579.git.chris@chrisdown.name>

On 11/29/26 06:51, Chris Down wrote:
> get_cmdline() passes FOLL_FORCE, so it reads a task's arguments even
> after the task has made them unreadable with mprotect(PROT_NONE).
> 
> It has done that from the start, because access_process_vm() used to
> imply force, and commit f307ab6dcea0 ("mm: replace access_process_vm()
> write parameter with gup_flags") only made that explicit. Right after
> that, commit 272ddc8b3735 ("proc: don't use FOLL_FORCE for reading
> cmdline and environment") dropped it again for /proc/pid/cmdline and
> /proc/pid/environ, but get_cmdline() was missed.
> 
> None of the callers of get_cmdline() are debuggers, and there is no
> reason for audit or Yama to see arguments that the task itself can't
> read. Let's drop FOLL_FORCE, which leaves get_cmdline() with the same
> flags as /proc/pid/cmdline.

That will now match what we do in get_mm_cmdline(), and I think not using
FOLL_FORCE would be great. Thanks!

Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>


I do wonder if there would be a way to have both functions share a common core
helper. Not completely trivial I guess.


-- 
Cheers,

David

      reply	other threads:[~2026-11-29  9:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  5:51 [PATCH 0/2] mm/util: use FOLL_ANON in get_cmdline() like /proc/pid/cmdline Chris Down
2026-11-29  5:51 ` [PATCH 1/2] mm/util: don't let get_cmdline() stall on file-backed arguments Chris Down
2026-11-29  8:45   ` David Hildenbrand (Arm)
2026-11-29  5:51 ` [PATCH 2/2] mm/util: drop FOLL_FORCE from get_cmdline() Chris Down
2026-11-29  9:44   ` David Hildenbrand (Arm) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd105eca-aec9-4310-8479-4e33cee1f6de@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=audit@vger.kernel.org \
    --cc=chris@chrisdown.name \
    --cc=kees@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mason@kernel.org \
    --cc=mhocko@suse.com \
    --cc=paul@paul-moore.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®