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
History
File Mode Size
.kunitconfig -rw-r--r-- 58 bytes
Kconfig -rw-r--r-- 4.0 KB
Makefile -rw-r--r-- 754 bytes
acl.c -rw-r--r-- 6.7 KB
acl.h -rw-r--r-- 1.6 KB
balloc.c -rw-r--r-- 28.6 KB
bitmap.c -rw-r--r-- 2.6 KB
block_validity.c -rw-r--r-- 9.5 KB
crypto.c -rw-r--r-- 6.1 KB
dir.c -rw-r--r-- 17.5 KB
ext4.h -rw-r--r-- 132.8 KB
ext4_extents.h -rw-r--r-- 8.4 KB
ext4_jbd2.c -rw-r--r-- 10.6 KB
ext4_jbd2.h -rw-r--r-- 17.2 KB
extents.c -rw-r--r-- 165.3 KB
extents_status.c -rw-r--r-- 61.4 KB
extents_status.h -rw-r--r-- 8.0 KB
fast_commit.c -rw-r--r-- 64.2 KB
fast_commit.h -rw-r--r-- 4.2 KB
file.c -rw-r--r-- 26.0 KB
fsmap.c -rw-r--r-- 19.9 KB
fsmap.h -rw-r--r-- 2.0 KB
fsync.c -rw-r--r-- 4.9 KB
hash.c -rw-r--r-- 7.4 KB
ialloc.c -rw-r--r-- 44.8 KB
indirect.c -rw-r--r-- 43.2 KB
inline.c -rw-r--r-- 50.4 KB
inode-test.c -rw-r--r-- 7.5 KB
inode.c -rw-r--r-- 177.4 KB
ioctl.c -rw-r--r-- 42.6 KB
mballoc.c -rw-r--r-- 202.8 KB
mballoc.h -rw-r--r-- 6.4 KB
migrate.c -rw-r--r-- 17.0 KB
mmp.c -rw-r--r-- 10.4 KB
move_extent.c -rw-r--r-- 21.2 KB
namei.c -rw-r--r-- 111.2 KB
orphan.c -rw-r--r-- 18.4 KB
page-io.c -rw-r--r-- 15.5 KB
readpage.c -rw-r--r-- 10.9 KB
resize.c -rw-r--r-- 63.2 KB
super.c -rw-r--r-- 204.0 KB
symlink.c -rw-r--r-- 3.1 KB
sysfs.c -rw-r--r-- 16.6 KB
truncate.h -rw-r--r-- 1.5 KB
verity.c -rw-r--r-- 10.8 KB
xattr.c -rw-r--r-- 84.4 KB
xattr.h -rw-r--r-- 7.8 KB
xattr_hurd.c -rw-r--r-- 1.3 KB
xattr_security.c -rw-r--r-- 1.6 KB
xattr_trusted.c -rw-r--r-- 1.2 KB
xattr_user.c -rw-r--r-- 1.3 KB

back to top