linux/fs/proc
Ben Wolsieffer 7e4f49cd2b proc: nommu: fix empty /proc/<pid>/maps
[ Upstream commit fe44198016 ]

On no-MMU, /proc/<pid>/maps reads as an empty file.  This happens because
find_vma(mm, 0) always returns NULL (assuming no vma actually contains the
zero address, which is normally the case).

To fix this bug and improve the maintainability in the future, this patch
makes the no-MMU implementation as similar as possible to the MMU
implementation.

The only remaining differences are the lack of hold/release_task_mempolicy
and the extra code to shoehorn the gate vma into the iterator.

This has been tested on top of 6.5.3 on an STM32F746.

Link: https://lkml.kernel.org/r/20230915160055.971059-2-ben.wolsieffer@hefring.com
Fixes: 0c563f1480 ("proc: remove VMA rbtree use from nommu")
Signed-off-by: Ben Wolsieffer <ben.wolsieffer@hefring.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-06 14:56:42 +02:00
..
array.c
base.c procfs: block chmod on /proc/thread-self/comm 2023-09-13 09:43:02 +02:00
bootconfig.c
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c
fd.h
generic.c
inode.c
internal.h proc: nommu: fix empty /proc/<pid>/maps 2023-10-06 14:56:42 +02:00
interrupts.c
Kconfig
kcore.c
kmsg.c
loadavg.c
Makefile
meminfo.c
namespaces.c
nommu.c
page.c
proc_net.c
proc_sysctl.c sysctl: clarify register_sysctl_init() base directory order 2023-05-17 11:53:46 +02:00
proc_tty.c
root.c
self.c
softirqs.c
stat.c
task_mmu.c
task_nommu.c proc: nommu: fix empty /proc/<pid>/maps 2023-10-06 14:56:42 +02:00
thread_self.c
uptime.c
util.c
version.c
vmcore.c proc/vmcore: fix signedness bug in read_from_oldmem() 2023-08-03 10:24:14 +02:00