]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
svcrpc: fix list-corrupting race on nfsd shutdown
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 29 Jun 2011 20:49:04 +0000 (16:49 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 8 Aug 2011 17:23:13 +0000 (10:23 -0700)
commit8a8b5c1b6f911444c0623b991cde497df64cb84c
treed761d03ce4d28deecd37ec37ee1592f8b72c86f2
parent98aea907860bce247af40351a297d56ef44d7f26
svcrpc: fix list-corrupting race on nfsd shutdown

commit ebc63e531cc6a457595dd110b07ac530eae788c3 upstream.

After commit 3262c816a3d7fb1eaabce633caa317887ed549ae "[PATCH] knfsd:
split svc_serv into pools", svc_delete_xprt (then svc_delete_socket) no
longer removed its xpt_ready (then sk_ready) field from whatever list it
was on, noting that there was no point since the whole list was about to
be destroyed anyway.

That was mostly true, but forgot that a few svc_xprt_enqueue()'s might
still be hanging around playing with the about-to-be-destroyed list, and
could get themselves into trouble writing to freed memory if we left
this xprt on the list after freeing it.

(This is actually functionally identical to a patch made first by Ben
Greear, but with more comments.)

Cc: gnb@fmeh.org
Reported-by: Ben Greear <greearb@candelatech.com>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sunrpc/svc_xprt.c