Re: [PATCH v2 net] rxrpc: fix race condition in rxrpc_input_packet()

2019-04-23 Thread Eric Dumazet
On 04/23/2019 03:06 PM, David Howells wrote: > Eric Dumazet wrote: > >> @@ -1161,19 +1161,15 @@ int rxrpc_extract_header(struct rxrpc_skb_priv *sp, >> struct sk_buff *skb) >> * handle data received on the local endpoint >> * - may be called in interrupt context >> * >> - * The socket is

Re: [PATCH v2 net] rxrpc: fix race condition in rxrpc_input_packet()

2019-04-23 Thread David Howells
Eric Dumazet wrote: > @@ -1161,19 +1161,15 @@ int rxrpc_extract_header(struct rxrpc_skb_priv *sp, > struct sk_buff *skb) > * handle data received on the local endpoint > * - may be called in interrupt context > * > - * The socket is locked by the caller and this prevents the socket from be

[PATCH v2 net] rxrpc: fix race condition in rxrpc_input_packet()

2019-04-23 Thread Eric Dumazet
After commit 5271953cad31 ("rxrpc: Use the UDP encap_rcv hook"), rxrpc_input_packet() is directly called from lockless UDP receive path, under rcu_read_lock() protection. It must therefore use RCU rules : - udp_sk->sk_user_data can be cleared at any point in this function. rcu_dereference_sk_us