]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFS: r366050, r366117
authorRick Macklem <rmacklem@FreeBSD.org>
Thu, 24 Sep 2020 16:21:30 +0000 (16:21 +0000)
committerRick Macklem <rmacklem@FreeBSD.org>
Thu, 24 Sep 2020 16:21:30 +0000 (16:21 +0000)
commit23ad3c58fe8545b89190342e34bb9dfa6085e3db
tree90e6f6b9991bc4e7ac271856e9cced0cd82f176f
parent7006fb18e65da308132e8ddabbee59cb10fe920c
MFS: r366050, r366117
Fix a LOR between the NFS server and server side krpc.

Recent testing of the NFS-over-TLS code found a LOR between the mutex lock
used for sessions and the sleep lock used for server side krpc socket
structures.
The code in nfsrv_checksequence() and nfsrv_bindconnsess() would call
SVC_RELEASE() with mutex(es) held.  Normally this is ok, since
all that happens is SVC_RELEASE() decrements the reference count.
However, if the socket has just been shut
down, SVC_RELEASE() drops the reference count to 0 and acquires a sleep
lock during destruction of the server side krpc structure.

This patch fixes the problem by moving the SVC_RELEASE() call in
nfsrv_checksequence() and nfsrv_bindconnsess() down a few lines to
below where the mutex(es) are released.

Approved by: re (gjb)
sys/fs/nfsserver/nfs_nfsdstate.c