]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFS: r365703
authorRick Macklem <rmacklem@FreeBSD.org>
Thu, 24 Sep 2020 14:59:10 +0000 (14:59 +0000)
committerRick Macklem <rmacklem@FreeBSD.org>
Thu, 24 Sep 2020 14:59:10 +0000 (14:59 +0000)
commit7006fb18e65da308132e8ddabbee59cb10fe920c
treec9f3875bd4f445b592b20bcbfc6ee74b471fd347
parent97f844cd60ddb0b56fa4ed0977620fd0cd7e15b0
MFS: r365703
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
Approved by: re (gjb)
sys/fs/nfsserver/nfs_nfsdstate.c