From: Eric Dumazet <eric.dumazet@gmail.com>
To: Tom Parkin <tparkin@katalix.com>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC PATCH] udp: don't rereference dst_entry dev pointer on rcv
Date: Thu, 07 Mar 2013 14:47:24 -0800 [thread overview]
Message-ID: <1362696444.15793.220.camel@edumazet-glaptop> (raw)
In-Reply-To: <1362695800-8633-2-git-send-email-tparkin@katalix.com>
On Thu, 2013-03-07 at 22:36 +0000, Tom Parkin wrote:
> When a fragmented IP packet is queued during device teardown, it is possible
> for the reassembled packet to hit the UDP rcv path with a NULL dst_entry dev
> pointer. Drop such packets to prevent an oops.
> ---
> net/ipv4/udp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index 0a073a2..c38a4b1 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -1700,6 +1700,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
> return __udp4_lib_mcast_deliver(net, skb, uh,
> saddr, daddr, udptable);
>
> + if (skb_dst(skb)->dev == NULL)
> + goto drop;
> +
> sk = __udp4_lib_lookup_skb(skb, uh->source, uh->dest, udptable);
>
> if (sk != NULL) {
Hmm... couldnt it be tested in reassembly layer instead ?
Why is it specific to UDP ?
next prev parent reply other threads:[~2013-03-07 22:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-07 22:36 [RFC PATCH] prevent oops in udp rcv path Tom Parkin
2013-03-07 22:36 ` [RFC PATCH] udp: don't rereference dst_entry dev pointer on rcv Tom Parkin
2013-03-07 22:47 ` Eric Dumazet [this message]
2013-03-07 23:15 ` David Miller
2013-03-13 23:27 ` Tom Parkin
2013-03-14 1:18 ` Eric Dumazet
2013-03-14 14:45 ` Tom Parkin
2013-03-14 15:05 ` Eric Dumazet
2013-03-14 15:29 ` Eric Dumazet
2013-03-14 16:14 ` Tom Parkin
2013-03-23 10:31 ` Damien Wyart
2013-03-23 15:09 ` Eric Dumazet
2013-04-11 16:32 ` Eric Dumazet
2013-04-11 17:53 ` Eric Dumazet
2013-04-11 22:26 ` Eric Dumazet
2013-04-12 22:32 ` David Miller
2013-04-12 7:04 ` Tom Parkin
2013-04-16 20:20 ` Tom Parkin
2013-04-16 22:55 ` [PATCH] net: drop dst before queueing fragments Eric Dumazet
2013-04-17 5:15 ` David Miller
2013-04-16 22:56 ` [RFC PATCH] udp: don't rereference dst_entry dev pointer on rcv Eric Dumazet
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=1362696444.15793.220.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=tparkin@katalix.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