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/20250807165455.73656-1-wjl.linux@gmail.com
Fixes: 65c6604725 ("proc: fix the issue of proc_mem_open returning NULL")
Signed-off-by: Jialin Wang <wjl.linux@gmail.com>
Cc: Penglei Jiang <superman.xpt@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-08-11 23:01:00 -07:00
..
Kconfig
Makefile
array.c
base.c hardening updates for v6.17-rc1 2025-07-28 17:16:12 -07:00
bootconfig.c
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c proc_fd_getattr(): don't bother with S_ISDIR() check 2025-06-16 16:21:07 +02:00
fd.h
generic.c Summary of significant series in this pull request: 2025-07-31 14:57:54 -07:00
inode.c proc: use the same treatment to check proc_lseek as ones for proc_read_iter et.al 2025-07-09 22:42:01 -07:00
internal.h Summary of significant series in this pull request: 2025-07-31 14:57:54 -07:00
interrupts.c
kcore.c
kmsg.c
loadavg.c
meminfo.c mm, vmstat: remove the NR_WRITEBACK_TEMP node_stat_item counter 2025-07-19 18:59:47 -07:00
namespaces.c switch procfs from d_set_d_op() to d_splice_alias_ops() 2025-06-10 22:13:52 -04:00
nommu.c
page.c fs: stable_page_flags(): use snapshot_page() 2025-07-24 19:12:35 -07:00
proc_net.c
proc_sysctl.c Current exclusion rules for ->d_flags stores are rather unpleasant. 2025-07-28 09:17:57 -07:00
proc_tty.c
root.c uapi: export PROCFS_ROOT_INO 2025-07-10 09:39:18 +02:00
self.c
softirqs.c
stat.c
task_mmu.c proc: proc_maps_open allow proc_mem_open to return NULL 2025-08-11 23:01:00 -07:00
task_nommu.c
thread_self.c
uptime.c
util.c
version.c
vmcore.c fs/proc/vmcore: a few cleanups for vmcore_add_device_dump() 2025-07-09 22:57:56 -07:00