From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Howells <dhowells@redhat.com>, Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
syzbot <syzkaller@googlegroups.com>
Subject: Re: [PATCH v2 net] rxrpc: fix race condition in rxrpc_input_packet()
Date: Tue, 23 Apr 2019 15:12:14 -0700 [thread overview]
Message-ID: <186c6a78-dfab-6dc0-8a7b-0d9303811a4d@gmail.com> (raw)
In-Reply-To: <11809.1556057199@warthog.procyon.org.uk>
On 04/23/2019 03:06 PM, David Howells wrote:
> Eric Dumazet <edumazet@google.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
>
prev parent reply other threads:[~2019-04-23 22:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 17:06 [PATCH v2 net] rxrpc: fix race condition in rxrpc_input_packet() Eric Dumazet
2019-04-23 22:06 ` David Howells
2019-04-23 22:12 ` Eric Dumazet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=186c6a78-dfab-6dc0-8a7b-0d9303811a4d@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=syzkaller@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox