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
Kconfig -rw-r--r-- 1.4 KB
Makefile -rw-r--r-- 343 bytes
acl.c -rw-r--r-- 3.3 KB
acl.h -rw-r--r-- 631 bytes
aops.c -rw-r--r-- 19.5 KB
aops.h -rw-r--r-- 366 bytes
bmap.c -rw-r--r-- 64.4 KB
bmap.h -rw-r--r-- 2.3 KB
dentry.c -rw-r--r-- 2.3 KB
dir.c -rw-r--r-- 52.4 KB
dir.h -rw-r--r-- 2.5 KB
export.c -rw-r--r-- 4.6 KB
file.c -rw-r--r-- 40.4 KB
gfs2.h -rw-r--r-- 372 bytes
glock.c -rw-r--r-- 73.2 KB
glock.h -rw-r--r-- 9.1 KB
glops.c -rw-r--r-- 20.6 KB
glops.h -rw-r--r-- 1.0 KB
incore.h -rw-r--r-- 23.5 KB
inode.c -rw-r--r-- 51.8 KB
inode.h -rw-r--r-- 4.0 KB
lock_dlm.c -rw-r--r-- 40.6 KB
log.c -rw-r--r-- 37.0 KB
log.h -rw-r--r-- 3.0 KB
lops.c -rw-r--r-- 28.3 KB
lops.h -rw-r--r-- 2.4 KB
main.c -rw-r--r-- 6.1 KB
meta_io.c -rw-r--r-- 12.8 KB
meta_io.h -rw-r--r-- 2.5 KB
ops_fstype.c -rw-r--r-- 46.1 KB
quota.c -rw-r--r-- 42.0 KB
quota.h -rw-r--r-- 2.0 KB
recovery.c -rw-r--r-- 14.9 KB
recovery.h -rw-r--r-- 1.1 KB
rgrp.c -rw-r--r-- 73.2 KB
rgrp.h -rw-r--r-- 3.4 KB
super.c -rw-r--r-- 40.4 KB
super.h -rw-r--r-- 2.3 KB
sys.c -rw-r--r-- 20.3 KB
sys.h -rw-r--r-- 507 bytes
trace_gfs2.h -rw-r--r-- 17.7 KB
trans.c -rw-r--r-- 9.3 KB
trans.h -rw-r--r-- 1.6 KB
util.c -rw-r--r-- 15.3 KB
util.h -rw-r--r-- 6.4 KB
xattr.c -rw-r--r-- 32.9 KB
xattr.h -rw-r--r-- 1.9 KB

back to top