]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: use rcu protection while reading sk->sk_user_data
authorEric Dumazet <edumazet@google.com>
Mon, 14 Oct 2019 13:04:38 +0000 (06:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Oct 2019 19:20:17 +0000 (12:20 -0700)
commit1eaf3a3514916127f03e9c7540258cc23ca2f8ee
tree9196047d3ab696992874cb25df1958ba90ea5d6c
parent06c80a1fd7bd6bdaa6ff0b508ef9b871d9419dd7
rxrpc: use rcu protection while reading sk->sk_user_data

We need to extend the rcu_read_lock() section in rxrpc_error_report()
and use rcu_dereference_sk_user_data() instead of plain access
to sk->sk_user_data to make sure all rules are respected.

The compiler wont reload sk->sk_user_data at will, and RCU rules
prevent memory beeing freed too soon.

Fixes: 5e2c253dfd8b ("rxrpc: Fix possible NULL pointer access in ICMP handling")
Fixes: 81566af9fe72 ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/peer_event.c