SUNRPC: Fix an RCU dereference in xs_local_rpcbind
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 8 Jan 2013 14:31:13 +0000 (09:31 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 1 Feb 2013 15:13:47 +0000 (10:13 -0500)
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/xprtsock.c

index 1897181d743827328308e99094f2fe097bfd1856..f7d6e4f8c1626fbfdebd93a51ff63b3f18ca1967 100644 (file)
@@ -1731,7 +1731,9 @@ static int xs_bind(struct sock_xprt *transport, struct socket *sock)
  */
 static void xs_local_rpcbind(struct rpc_task *task)
 {
-       xprt_set_bound(task->tk_xprt);
+       rcu_read_lock();
+       xprt_set_bound(rcu_dereference(task->tk_client->cl_xprt));
+       rcu_read_unlock();
 }
 
 static void xs_local_set_port(struct rpc_xprt *xprt, unsigned short port)