SUNRPC: Fix race corrupting rpc upcall
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 12 Sep 2010 23:55:25 +0000 (19:55 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:18:14 +0000 (13:18 -0700)
commitf7f040a6b088a9380a640b181687f7c79fface7b
tree10480ae99d802abf8357ef29f95f567d2b161a3b
parent60804a1f4821f917c302fb1970674ab058473427
SUNRPC: Fix race corrupting rpc upcall

commit 5a67657a2e90c9e4a48518f95d4ba7777aa20fbb upstream.

If rpc_queue_upcall() adds a new upcall to the rpci->pipe list just
after rpc_pipe_release calls rpc_purge_list(), but before it calls
gss_pipe_release (as rpci->ops->release_pipe(inode)), then the latter
will free a message without deleting it from the rpci->pipe list.

We will be left with a freed object on the rpc->pipe list.  Most
frequent symptoms are kernel crashes in rpc.gssd system calls on the
pipe in question.

Reported-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/rpc_pipe.c