On 04/23/2019 03:06 PM, David Howells wrote:
> Eric Dumazet <[email protected]> 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 
>> being
>> - * shut down and the local endpoint from going away, thus sk_user_data will 
>> not
>> - * be cleared until this function returns.
>> - *
> 
> I'd prefer not to remove the comment entirely.  Could it be changed to:
> 
>  * [!] Note that as this is called from the encap_rcv hook, the socket is not
>  * held locked by the caller and nothing prevents sk_user_data on the UDP from
>  * being cleared in the middle of processing this function.

Okay, but really rcu_dereference_sk_user_data() should be 
self-documenting/explaining.

> 
>> @@ -1181,6 +1177,10 @@ int rxrpc_input_packet(struct sock *udp_sk, struct 
>> sk_buff *skb)
>>  
>>      _enter("%p", udp_sk);
>>  
>> +    if (unlikely(!local)) {
>> +            kfree_skb(skb);
>> +            return 0;
>> +    }
> 
> This looks better, thanks.
> 
> David
> 

Reply via email to