]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC: r334396
authorrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 6 Jun 2018 01:30:48 +0000 (01:30 +0000)
committerrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 6 Jun 2018 01:30:48 +0000 (01:30 +0000)
commiteec3f4a8a63480c20061ab42a7e23052d40fbae7
treea48e2109ccf0674480b1c2246772803150136ead
parent0bcd8637093a2ff558170a06314b32f6bb568e30
MFC: r334396
Strengthen locking for the NFSv4.1 server DestroySession operation.

If a client did a DestroySession on a session while it was still in use,
the server might try to use the session structure after it is free'd.
I think the client has violated RFC5661 if it does this, but this patch
makes DestroySession block all other nfsd threads so no thread could
be using the session when it is free'd. After the DestroySession, nfsd
threads will not be able to find the session. The patch also adds a check
for nd_sessionid being set, although if that was not the case it would have
been all 0s and unlikely to have a false match.
This might fix the crashes described in PR#228497 for the FreeNAS server.

PR: 228497

git-svn-id: svn://svn.freebsd.org/base/stable/10@334699 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/fs/nfsserver/nfs_nfsdstate.c