netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Florian Westphal <fw@strlen.de>, netdev <netdev@vger.kernel.org>,
	johannes@sipsolutions.net
Subject: Re: IPv6 routing/fragmentation panic
Date: Wed, 16 Sep 2015 17:30:56 +0200	[thread overview]
Message-ID: <20150916153056.GR24810@breakpoint.cc> (raw)
In-Reply-To: <1442412054.131189.97.camel@infradead.org>

David Woodhouse <dwmw2@infradead.org> wrote:
> >                         if (frag->len > mtu ||
> >                             ((frag->len & 7) && frag->next) ||
> > -                           skb_headroom(frag) < hlen)
> > +                           skb_headroom(frag) < (hlen + hroom))
> >                                 goto slow_path_clean;
> >  
> >                         /* Partially cloned skb? */
> 
> My test is 'ping -s 2000', and I end up with a fragment of 1280 bytes
> followed by a fragment of 776 bytes.
> 
> The test cited above is only actually running on the latter fragment
> (which for some reason is fine and has headroom of 58 bytes).
> 
> The first, larger, fragment isn't being checked. And that's the one
> with only 10 bytes of headroom.

Thanks for this detailed analysis.
I've sent a patch that should address all of these issues.

Turns out that all tests are wrong in your case.

ip6_fragment doesn't expand headroom, since this skb had the ipv6
fragment header pulled, so that part thinks there are 18 bytes
available (we later push the frag header back when sending fragments).

The 'skb_headroom(frag) < hlen))' is wrong since it neither accounts for
device header length nor the fragment header that we need to push.

      reply	other threads:[~2015-09-16 15:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 15:53 IPv6 routing/fragmentation panic David Woodhouse
2015-09-15 16:07 ` Michal Kubecek
2015-09-15 23:48 ` Florian Westphal
2015-09-16 10:09   ` David Woodhouse
2015-09-16 13:27     ` Florian Westphal
2015-09-16 13:34       ` David Woodhouse
2015-09-16 14:00       ` David Woodhouse
2015-09-16 15:30         ` Florian Westphal [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=20150916153056.GR24810@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=dwmw2@infradead.org \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).