Commit b63452c1 authored by David Howells's avatar David Howells

rxrpc: Accesses of rxrpc_local::service need to be RCU managed

struct rxrpc_local->service is marked __rcu - this means that accesses of
it need to be managed using RCU wrappers.  There are two such places in
rxrpc_release_sock() where the value is checked and cleared.  Fix this by
using the appropriate wrappers.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent af70c1f9
...@@ -678,9 +678,9 @@ static int rxrpc_release_sock(struct sock *sk) ...@@ -678,9 +678,9 @@ static int rxrpc_release_sock(struct sock *sk)
sk->sk_state = RXRPC_CLOSE; sk->sk_state = RXRPC_CLOSE;
spin_unlock_bh(&sk->sk_receive_queue.lock); spin_unlock_bh(&sk->sk_receive_queue.lock);
if (rx->local && rx->local->service == rx) { if (rx->local && rcu_access_pointer(rx->local->service) == rx) {
write_lock(&rx->local->services_lock); write_lock(&rx->local->services_lock);
rx->local->service = NULL; rcu_assign_pointer(rx->local->service, NULL);
write_unlock(&rx->local->services_lock); write_unlock(&rx->local->services_lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment