Revision 88956eabfdea7d01d550535af120d4ef265b1d02 authored by NeilBrown on 12 September 2023, 01:25:00 UTC, committed by Chuck Lever on 12 September 2023, 13:39:35 UTC
If /proc/fs/nfsd/pool_stats is open when the last nfsd thread exits, then when the file is closed a NULL pointer is dereferenced. This is because nfsd_pool_stats_release() assumes that the pointer to the svc_serv cannot become NULL while a reference is held. This used to be the case but a recent patch split nfsd_last_thread() out from nfsd_put(), and clearing the pointer is done in nfsd_last_thread(). This is easily reproduced by running rpc.nfsd 8 ; ( rpc.nfsd 0;true) < /proc/fs/nfsd/pool_stats Fortunately nfsd_pool_stats_release() has easy access to the svc_serv pointer, and so can call svc_put() on it directly. Fixes: 9f28a971ee9f ("nfsd: separate nfsd_last_thread() from nfsd_put()") Signed-off-by: NeilBrown <neilb@suse.de> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent fdd2630
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 4.1 KB |
Makefile | -rw-r--r-- | 913 bytes |
array.c | -rw-r--r-- | 22.4 KB |
base.c | -rw-r--r-- | 93.9 KB |
bootconfig.c | -rw-r--r-- | 2.0 KB |
cmdline.c | -rw-r--r-- | 540 bytes |
consoles.c | -rw-r--r-- | 2.3 KB |
cpuinfo.c | -rw-r--r-- | 670 bytes |
devices.c | -rw-r--r-- | 1.2 KB |
fd.c | -rw-r--r-- | 8.9 KB |
fd.h | -rw-r--r-- | 573 bytes |
generic.c | -rw-r--r-- | 18.9 KB |
inode.c | -rw-r--r-- | 17.1 KB |
internal.h | -rw-r--r-- | 9.1 KB |
interrupts.c | -rw-r--r-- | 841 bytes |
kcore.c | -rw-r--r-- | 16.7 KB |
kmsg.c | -rw-r--r-- | 1.5 KB |
loadavg.c | -rw-r--r-- | 963 bytes |
meminfo.c | -rw-r--r-- | 6.1 KB |
namespaces.c | -rw-r--r-- | 4.2 KB |
nommu.c | -rw-r--r-- | 2.6 KB |
page.c | -rw-r--r-- | 8.0 KB |
proc_net.c | -rw-r--r-- | 10.3 KB |
proc_sysctl.c | -rw-r--r-- | 43.3 KB |
proc_tty.c | -rw-r--r-- | 4.4 KB |
root.c | -rw-r--r-- | 8.8 KB |
self.c | -rw-r--r-- | 1.7 KB |
softirqs.c | -rw-r--r-- | 825 bytes |
stat.c | -rw-r--r-- | 5.8 KB |
task_mmu.c | -rw-r--r-- | 49.2 KB |
task_nommu.c | -rw-r--r-- | 6.4 KB |
thread_self.c | -rw-r--r-- | 1.9 KB |
uptime.c | -rw-r--r-- | 1.1 KB |
util.c | -rw-r--r-- | 383 bytes |
version.c | -rw-r--r-- | 599 bytes |
vmcore.c | -rw-r--r-- | 41.0 KB |
Computing file changes ...