freebsd-nq/sys/rpc
Rick Macklem b0e14530a0 Fix a race in the RPCSEC_GSS server code that caused crashes.
When a new client structure was allocated, it was added to the list
so that it was visible to other threads before the expiry time was
initialized, with only a single reference count.
The caller would increment the reference count, but it was possible
for another thread to decrement the reference count to zero and free
the structure before the caller incremented the reference count.
This could occur because the expiry time was still set to zero when
the new client structure was inserted in the list and the list was
unlocked.

This patch fixes the race by initializing the reference count to two
and initializing all fields, including the expiry time, before inserting
it in the list.

Tested by:	peter@ifm.liu.se
PR:		235582
MFC after:	2 weeks
2019-04-02 23:51:08 +00:00
..
rpcsec_gss Fix a race in the RPCSEC_GSS server code that caused crashes. 2019-04-02 23:51:08 +00:00
auth_none.c
auth_unix.c
auth.h
authunix_prot.c
clnt_bck.c
clnt_dg.c Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
clnt_rc.c Set SO_SNDTIMEO in the client side krpc when CLSET_TIMEOUT is done. 2018-07-20 12:03:16 +00:00
clnt_stat.h
clnt_vc.c
clnt.h
getnetconfig.c
krpc.h
netconfig.h
nettype.h
pmap_prot.h
replay.c
replay.h
rpc_callmsg.c
rpc_com.h
rpc_generic.c
rpc_msg.h
rpc_prot.c
rpc.h
rpcb_clnt.c
rpcb_clnt.h
rpcb_prot.c
rpcb_prot.h
rpcm_subs.h
rpcsec_gss.h
svc_auth_unix.c
svc_auth.c
svc_auth.h
svc_dg.c
svc_generic.c
svc_vc.c
svc.c Fix the server side krpc so that the kernel nfsd threads terminate. 2018-07-02 17:50:46 +00:00
svc.h
types.h
xdr.h