opnsense-src/sys/fs/nfsserver
Rick Macklem 8410066787 krpc: Acquire ref count of CLIENT for backchannel use
Michael Dexter <editor@callfortesting.org> reported
a crash in FreeNAS, where the first argument to
clnt_bck_svccall() was no longer valid.
This argument is a pointer to the callback CLIENT
structure, which is free'd when the associated
NFSv4 ClientID is free'd.

This appears to have occurred because a callback
reply was still in the socket receive queue when
the CLIENT structure was free'd.

This patch acquires a reference count on the CLIENT
that is not CLNT_RELEASE()'d until the socket structure
is destroyed. This should guarantee that the CLIENT
structure is still valid when clnt_bck_svccall() is called.
It also adds a check for closed or closing to
clnt_bck_svccall() so that it will not process the callback
RPC reply message after the ClientID is free'd.

(cherry picked from commit e1a907a25c)
2021-06-26 16:03:41 -07:00
..
nfs_fha_new.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_fha_new.h Re-organize the NFS file handle affinity code for the NFS server. 2020-04-14 00:01:26 +00:00
nfs_nfsdcache.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_nfsdkrpc.c nfsd: fix replies from session cache for retried RPCs 2021-04-22 06:54:31 -07:00
nfs_nfsdport.c nfsd: Fix when NFSERR_WRONGSEC may be replied to NFSv4 clients 2021-06-26 15:52:30 -07:00
nfs_nfsdserv.c nfsd: Fix NFSv4.1/4.2 Secinfo_no_name when security flavors empty 2021-06-26 15:56:10 -07:00
nfs_nfsdsocket.c nfsd: Fix when NFSERR_WRONGSEC may be replied to NFSv4 clients 2021-06-26 15:52:30 -07:00
nfs_nfsdstate.c krpc: Acquire ref count of CLIENT for backchannel use 2021-06-26 16:03:41 -07:00
nfs_nfsdsubs.c nfsd: Fix the failure return for non-fh NFSv4 operations 2021-06-26 15:46:18 -07:00