freebsd-src/sys/rpc
Rick Macklem e1a907a25c 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.

Comments by:	mav
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30153
2021-06-11 16:57:14 -07:00
..
rpcsec_gss rpcsec_gss: Use a designated initializer for rpc_gss_ops 2021-05-26 10:45:40 -04:00
rpcsec_tls nfs-over-tls: handle res.gid.gid_val correctly for memory allocation 2021-01-12 13:59:52 -08:00
auth.h nfsd: Fix the failure return for non-fh NFSv4 operations 2021-06-02 15:28:07 -07:00
auth_none.c
auth_unix.c
authunix_prot.c
clnt.h nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
clnt_bck.c krpc: Acquire ref count of CLIENT for backchannel use 2021-06-11 16:57:14 -07:00
clnt_dg.c Change the xid for client side krpc over UDP to a global value. 2020-04-05 21:08:17 +00:00
clnt_rc.c nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
clnt_stat.h
clnt_vc.c Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
getnetconfig.c
krpc.h nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
netconfig.h
nettype.h
pmap_prot.h
replay.c
replay.h
rpc.h
rpc_callmsg.c
rpc_com.h
rpc_generic.c Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
rpc_msg.h
rpc_prot.c Move M_RPC malloc type into XDR. Both RPC and XDR libraries use 2020-04-17 06:02:13 +00:00
rpcb_clnt.c
rpcb_clnt.h
rpcb_prot.c
rpcb_prot.h
rpcm_subs.h
rpcsec_gss.h
rpcsec_tls.h Add a new "tlscertname" NFS mount option. 2020-12-23 13:42:55 -08:00
svc.c nfsd: fix a NFSv4.1 Linux client mount stuck in CLOSE_WAIT 2021-04-27 15:32:35 -07:00
svc.h krpc: Acquire ref count of CLIENT for backchannel use 2021-06-11 16:57:14 -07:00
svc_auth.c Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
svc_auth.h
svc_auth_unix.c
svc_dg.c
svc_generic.c
svc_vc.c krpc: Acquire ref count of CLIENT for backchannel use 2021-06-11 16:57:14 -07:00
types.h
xdr.h