[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21268.1556038528@warthog.procyon.org.uk>
Date: Tue, 23 Apr 2019 17:55:28 +0100
From: David Howells <dhowells@...hat.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: dhowells@...hat.com, "David S . Miller" <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Eric Dumazet <eric.dumazet@...il.com>,
syzbot <syzkaller@...glegroups.com>
Subject: Re: [PATCH net] rxrpc: fix race condition in rxrpc_input_packet()
Eric Dumazet <edumazet@...gle.com> wrote:
> @@ -1181,6 +1177,9 @@ int rxrpc_input_packet(struct sock *udp_sk, struct sk_buff *skb)
>
> _enter("%p", udp_sk);
>
> + if (!local)
> + return -ENOENT;
> +
>
This looks wrong. Did you mean "return -AF_INET"?
The comment in net/ipv6/udp.c says:
/*
* This is an encapsulation socket so pass the skb to
* the socket's udp_encap_rcv() hook. Otherwise, just
* fall through and pass this up the UDP socket.
* up->encap_rcv() returns the following value:
* =0 if skb was successfully passed to the encap
* handler or was discarded by it.
* >0 if skb should be passed on to UDP.
* <0 if skb should be resubmitted as proto -N
*/
This suggests that -ENOENT is not a valid return. Should you "goto discard"
instead - or just discard the packet and return 0?
David
Powered by blists - more mailing lists