freebsd-dev/sys/rpc
Rick Macklem 5328a32e58 A crash reported on freebsd-fs@ on Sep. 23, 2011 under the subject
heading "kernel panics with RPCSEC_GSS" appears to be caused by a
corrupted tailq list for the client structure. Looking at the code, calls
to the function svc_rpc_gss_forget_client() were done in an SMP unsafe
manner, with the svc_rpc_gss_lock only being acquired in the function
and not before it. As such, when multiple threads called
svc_rpc_gss_forget_client() concurrently, it could try and remove the
same client structure from the tailq lists multiple times.
The patch fixes this by moving the critical code into a separate
function called svc_rpc_gss_forget_client_locked(), which must be
called with the lock held. For the one case where the caller would
have no interest in the lock, svc_rpc_gss_forget_client() was retained,
but a loop was added to check that the client structure is still in
the tailq lists before removing it, to make it safe for multiple
concurrent calls.

Tested by:	clinton.adams at gmail.com (earlier version)
Reviewed by:	zkirsch
MFC after:	3 days
2011-10-07 01:15:04 +00:00
..
rpcsec_gss A crash reported on freebsd-fs@ on Sep. 23, 2011 under the subject 2011-10-07 01:15:04 +00:00
auth_none.c
auth_unix.c
auth.h
authunix_prot.c Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic 2010-01-12 07:49:34 +00:00
clnt_dg.c Make sure RPC calls over UDP return RPC_INTR status is the process has 2011-08-28 18:09:17 +00:00
clnt_rc.c This patch is believed to fix a problem in the kernel rpc for 2011-04-27 18:19:26 +00:00
clnt_stat.h
clnt_vc.c This patch is believed to fix a problem in the kernel rpc for 2011-04-27 18:19:26 +00:00
clnt.h This patch is believed to fix a problem in the kernel rpc for 2011-04-27 18:19:26 +00:00
getnetconfig.c
netconfig.h
nettype.h
pmap_prot.h
replay.c - Check the result of malloc(M_NOWAIT) in replay_alloc(). The caller 2010-08-26 23:33:04 +00:00
replay.h
rpc_callmsg.c
rpc_com.h Make the RPC specific __rpc_inet_ntop() and __rpc_inet_pton() general 2010-09-24 15:01:45 +00:00
rpc_generic.c Fix the kgssapi so that it can be loaded as a module. Currently 2011-06-19 22:08:55 +00:00
rpc_msg.h
rpc_prot.c
rpc.h
rpcb_clnt.c This patch is believed to fix a problem in the kernel rpc for 2011-04-27 18:19:26 +00:00
rpcb_clnt.h
rpcb_prot.c
rpcb_prot.h
rpcm_subs.h
rpcsec_gss.h Fix the kgssapi so that it can be loaded as a module. Currently 2011-06-19 22:08:55 +00:00
svc_auth_unix.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
svc_auth.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
svc_auth.h
svc_dg.c Mfp4 CH=177274,177280,177284-177285,177297,177324-177325 2011-02-16 21:29:13 +00:00
svc_generic.c Mfp4 CH=177274,177280,177284-177285,177297,177324-177325 2011-02-16 21:29:13 +00:00
svc_vc.c Mfp4 CH=177274,177280,177284-177285,177297,177324-177325 2011-02-16 21:29:13 +00:00
svc.c sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly. 2011-01-12 19:54:19 +00:00
svc.h Fix two races in the server side krpc w.r.t upcalls: 2009-06-04 14:13:06 +00:00
types.h
xdr.h