Audit system development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mm/util: use FOLL_ANON in get_cmdline() like /proc/pid/cmdline
@ 2026-12-04  2:18 Chris Down
  2026-12-04  2:18 ` [PATCH v2 1/3] mm/util: don't let get_cmdline() stall on file-backed arguments Chris Down
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chris Down @ 2026-12-04  2:18 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand
  Cc: Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, linux-mm, linux-kernel,
	Chris Mason, Paul Moore, Kees Cook, Willy Tarreau, audit,
	sashiko-bot, kernel-team

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.

v2:

- Use a90902531a06 as the Fixes: target of patch 1
- Add patch 3, which makes get_cmdline() share one reader with
  /proc/pid/cmdline (David)

v1: https://lore.kernel.org/r/cover.1795891579.git.chris@chrisdown.name

Chris Down (3):
  mm/util: don't let get_cmdline() stall on file-backed arguments
  mm/util: drop FOLL_FORCE from get_cmdline()
  mm/util: make get_cmdline() and /proc/pid/cmdline share one reader

 fs/proc/base.c     | 134 ++--------------------------------
 include/linux/mm.h |   3 +
 mm/util.c          | 175 +++++++++++++++++++++++++++++++++++----------
 3 files changed, 147 insertions(+), 165 deletions(-)


base-commit: c6f53520f32302ea64cbcfd7cc25a31081e34548
-- 
2.56.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-04  2:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  2:18 [PATCH v2 0/3] mm/util: use FOLL_ANON in get_cmdline() like /proc/pid/cmdline Chris Down
2026-12-04  2:18 ` [PATCH v2 1/3] mm/util: don't let get_cmdline() stall on file-backed arguments Chris Down
2026-12-04  2:18 ` [PATCH v2 2/3] mm/util: drop FOLL_FORCE from get_cmdline() Chris Down
2026-12-04  2:18 ` [PATCH v2 3/3] mm/util: make get_cmdline() and /proc/pid/cmdline share one reader Chris Down
2026-12-04  2:35 ` [PATCH v2 0/3] mm/util: use FOLL_ANON in get_cmdline() like /proc/pid/cmdline sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox