]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC: r226081, r226104
authorrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 10 Oct 2011 14:35:26 +0000 (14:35 +0000)
committerrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 10 Oct 2011 14:35:26 +0000 (14:35 +0000)
commit716f22b21d56049d8884aedc6ce4796a5a57066d
treeb053e4e5c4db8321b90d986d5dfb9601358cd88c
parent206289b4b200d2f7683a1c6c832fd7a4e5a8691e
MFC: r226081, r226104
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.
Also, remove an extraneous "already" from a comment introduced by r226081.

git-svn-id: svn://svn.freebsd.org/base/stable/8@226213 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/rpc/rpcsec_gss/svc_rpcsec_gss.c