lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 23 Apr 2019 15:12:14 -0700
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     David Howells <dhowells@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        syzbot <syzkaller@...glegroups.com>
Subject: Re: [PATCH v2 net] rxrpc: fix race condition in rxrpc_input_packet()



On 04/23/2019 03:06 PM, David Howells wrote:
> Eric Dumazet <edumazet@...gle.com> 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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ