Files
linux/fs/proc
Jialin Wang c0e1b774f6 proc: proc_maps_open allow proc_mem_open to return NULL
The commit 65c6604725 ("proc: fix the issue of proc_mem_open returning
NULL") caused proc_maps_open() to return -ESRCH when proc_mem_open()
returns NULL.  This breaks legitimate /proc/<pid>/maps access for kernel
threads since kernel threads have NULL mm_struct.

The regression causes perf to fail and exit when profiling a kernel
thread:

  # perf record -v -g -p $(pgrep kswapd0)
  ...
  couldn't open /proc/65/task/65/maps

This patch partially reverts the commit to fix it.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 65c6604725 ("proc: fix the issue of proc_mem_open returning NULL")
Signed-off-by: Jialin Wang <[email protected]>
Cc: Penglei Jiang <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2025-08-11 23:01:00 -07:00
..
…
…
2023-01-19 09:24:28 +01:00
2025-02-10 16:56:58 -08:00
…
…
2025-07-10 09:39:18 +02:00
2024-10-16 21:56:59 +02:00
…
…
…