freebsd-dev/sys/fs
Rick Macklem 2848d6d4de Fix a case where the NFSv4.0 server might crash if delegations are enabled.
asomers@ reported a crash on an NFSv4.0 server with a backtrace of:
kdb_backtrace
vpanic
panic
nfsrv_docallback
nfsrv_checkgetattr
nfsrvd_getattr
nfsrvd_dorpc
nfssvc_program
svc_run_internal
svc_thread_start
fork_exit
fork_trampoline
where the panic message was "docallb", which indicates that a callback
was attempted when the ClientID is unconfirmed.
This would not normally occur, but it is possible to have an unconfirmed
ClientID structure with delegation structure(s) chained off it if the
client were to issue a SetClientID with the same "id" but different
"verifier" after acquiring delegations on the previously confirmed ClientID.

The bug appears to be that nfsrv_checkgetattr() failed to check for
this uncommon case of an unconfirmed ClientID with a delegation structure
that no longer refers to a delegation the client knows about.

This patch adds a check for this case, handling it as if no delegation
exists, which is the case when the above occurs.
Although difficult to reproduce, this change should avoid the panic().

PR:		249127
Reported by:	asomers
Reviewed by:	asomers
MFC after:	1 week
Differential Revision:	https://reviews.freebbsd.org/D26342
2020-09-14 00:44:50 +00:00
..
autofs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
cd9660 fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
cuse fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
deadfs vfs: flatten vop vectors 2019-12-16 00:06:22 +00:00
devfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
ext2fs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
fdescfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
fifofs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
fuse fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
mntfs Add a new "mntfs" pseudo file system which provides private device vnodes for 2020-03-06 18:41:37 +00:00
msdosfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfsclient fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfsserver Fix a case where the NFSv4.0 server might crash if delegations are enabled. 2020-09-14 00:44:50 +00:00
nullfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
procfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
pseudofs vfs: remove the thread argument from vget 2020-08-16 17:18:54 +00:00
smbfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
tmpfs tmpfs: drop spurious cache_purge in tmpfs_reclaim 2020-09-04 19:30:15 +00:00
udf fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
unionfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00