diff options
author | David Howells <dhowells@redhat.com> | 2016-10-06 03:11:48 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2016-10-06 03:11:48 -0400 |
commit | b63452c11e22382e592d3f7f9ac4966197d3eab6 (patch) | |
tree | 327105b7e1b14446cef73b4fff2d2985d6f9a9c4 | |
parent | af70c1f92d3567035d2f73f39079459d58c706dc (diff) |
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: David Howells <dhowells@redhat.com>
-rw-r--r-- | net/rxrpc/af_rxrpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c index 44c9c2b0b190..2d59c9be40e1 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c | |||
@@ -678,9 +678,9 @@ static int rxrpc_release_sock(struct sock *sk) | |||
678 | sk->sk_state = RXRPC_CLOSE; | 678 | sk->sk_state = RXRPC_CLOSE; |
679 | spin_unlock_bh(&sk->sk_receive_queue.lock); | 679 | spin_unlock_bh(&sk->sk_receive_queue.lock); |
680 | 680 | ||
681 | if (rx->local && rx->local->service == rx) { | 681 | if (rx->local && rcu_access_pointer(rx->local->service) == rx) { |
682 | write_lock(&rx->local->services_lock); | 682 | write_lock(&rx->local->services_lock); |
683 | rx->local->service = NULL; | 683 | rcu_assign_pointer(rx->local->service, NULL); |
684 | write_unlock(&rx->local->services_lock); | 684 | write_unlock(&rx->local->services_lock); |
685 | } | 685 | } |
686 | 686 | ||