freebsd-dev/sys/rpc/rpcsec_gss
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_conf.c
rpcsec_gss_int.h
rpcsec_gss_misc.c
rpcsec_gss_prot.c Make options KGSSAPI build and add it to NOTES. 2010-01-08 23:26:10 +00:00
rpcsec_gss.c When unmounting an NFS mount using sec=krb5[ip], the umount system 2009-07-01 16:42:03 +00:00
svc_rpcsec_gss.c A crash reported on freebsd-fs@ on Sep. 23, 2011 under the subject 2011-10-07 01:15:04 +00:00