Skip to content

Commit 3dc0da2

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
SUNRPC: Fix an RCU dereference in xs_local_rpcbind
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent 1b09209 commit 3dc0da2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎net/sunrpc/xprtsock.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,9 @@ static int xs_bind(struct sock_xprt *transport, struct socket *sock)
17311731
*/
17321732
static void xs_local_rpcbind(struct rpc_task *task)
17331733
{
1734-
xprt_set_bound(task->tk_xprt);
1734+
rcu_read_lock();
1735+
xprt_set_bound(rcu_dereference(task->tk_client->cl_xprt));
1736+
rcu_read_unlock();
17351737
}
17361738

17371739
static void xs_local_set_port(struct rpc_xprt *xprt, unsigned short port)

0 commit comments

Comments
 (0)