Audit system development
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.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: [PATCH 0/2] mm/util: use FOLL_ANON in get_cmdline() like /proc/pid/cmdline
Date: Sat, 28 Nov 2026 21:51:29 -0800	[thread overview]
Message-ID: <cover.1795891579.git.chris@chrisdown.name> (raw)

get_cmdline() reads a task's arguments for audit's proctitle record,
Yama's ptrace reports, loadpin and the msm and etnaviv GPU hang
messages. Unlike /proc/pid/cmdline, which has only read anonymous
memory since 7f7ccc2ccc2e ("proc: do not access cmdline nor environ
from file-backed areas"), it still reads whatever the task has mapped
at arg_start. That includes a file on a FUSE filesystem whose server
can take as long as it likes to answer, and some of those readers are
other tasks, or msm's hang recovery with gpu->lock held.

Patch 1 passes FOLL_ANON, so get_cmdline() reads the same memory as
/proc. This is the one for stable.

Patch 2 drops FOLL_FORCE, which get_cmdline() only has because it was
missed when 272ddc8b3735 ("proc: don't use FOLL_FORCE for reading
cmdline and environment") dropped it from /proc.

For device mappings, patch 1 relies on "mm: do not call vm_ops->access
with FOLL_ANON" from David's vm_ops->access series [1], but it doesn't
need it to apply or build.

[1] https://lore.kernel.org/r/20261122-access_shite-v2-1-808d8d2aa700@kernel.org

Chris Down (2):
  mm/util: don't let get_cmdline() stall on file-backed arguments
  mm/util: drop FOLL_FORCE from get_cmdline()

 mm/util.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)


base-commit: c6f53520f32302ea64cbcfd7cc25a31081e34548
-- 
2.56.1


             reply	other threads:[~2026-11-29  5:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  5:51 Chris Down [this message]
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  5:51 ` [PATCH 2/2] mm/util: drop FOLL_FORCE from get_cmdline() Chris Down
2026-11-29  6:06 ` [PATCH 0/2] mm/util: use FOLL_ANON in get_cmdline() like /proc/pid/cmdline sashiko-bot

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=cover.1795891579.git.chris@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=akpm@linux-foundation.org \
    --cc=audit@vger.kernel.org \
    --cc=david@kernel.org \
    --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