From: Shmulik Ladkani <shmulik@metanetworks.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
netdev <netdev@vger.kernel.org>,
Alexander Duyck <alexander.duyck@gmail.com>,
Alexei Starovoitov <ast@kernel.org>, Yonghong Song <yhs@fb.com>,
Steffen Klassert <steffen.klassert@secunet.com>,
eyal@metanetworks.com
Subject: Re: BUG_ON in skb_segment, after bpf_skb_change_proto was applied
Date: Tue, 3 Sep 2019 20:03:12 +0300 [thread overview]
Message-ID: <20190903200312.7e0ec75e@pixies> (raw)
In-Reply-To: <CA+FuTScE=pyopY=3f5E4JGx1zyGqT+XS+8ss13UN4if4TZ2NbA@mail.gmail.com>
On Tue, 3 Sep 2019 12:23:54 -0400
Willem de Bruijn <willemdebruijn.kernel@gmail.com> wrote:
> This is a lot more code change. Especially for stable fixes that need
> to be backported, a smaller patch is preferable.
Indeed. Thanks for the feedback.
> My suggestion only tested the first frag_skb length. If a list can be
> created where the first frag_skb is head_frag but a later one is not,
> it will fail short. I kind of doubt that.
>
> By default skb_gro_receive builds GSO skbs that can be segmented
> along the original gso_size boundaries. We have so far only observed
> this issue when messing with gso_size.
The rationale was based on inputs specified in 43170c4e0ba7, where a GRO
skb has a fraglist with different amounts of payloads.
> We can easily refine the test to fall back on to copying only if
> skb_headlen(list_skb) != mss.
I'm concerned this is too generic; innocent skbs may fall victim to our
skb copy fallback. Probably those mentioned in 43170c4e0ba7.
> Alternatively, only on SKB_GSO_DODGY is fine, too.
>
> I suggest we stick with the two-liner.
OK.
So lets refine your original codition, testing only the first
frag_skb, but also ensuring SKB_GSO_DODGY *and* 'skb_headlen(list_skb) != mss'
(we know existing code DOES work OK for unchanged gso_size, even if frags
have linear, non head_frag, data).
This hits the known, reproducable case of the mentioned BUG_ON, and is
tightly scoped to that case.
If that's agreed, I'll submit a proper patch.
Best,
Shmulik
next prev parent reply other threads:[~2019-09-03 17:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 14:07 BUG_ON in skb_segment, after bpf_skb_change_proto was applied Shmulik Ladkani
2019-08-26 17:47 ` Eric Dumazet
2019-08-27 11:42 ` Shmulik Ladkani
2019-08-27 12:10 ` Daniel Borkmann
2019-08-28 5:56 ` Shmulik Ladkani
2019-08-29 12:22 ` Shmulik Ladkani
2019-09-01 20:05 ` Willem de Bruijn
2019-09-02 13:44 ` Shmulik Ladkani
2019-09-03 15:51 ` Shmulik Ladkani
2019-09-03 16:23 ` Willem de Bruijn
2019-09-03 17:03 ` Shmulik Ladkani [this message]
2019-09-03 17:24 ` Willem de Bruijn
2019-08-27 15:09 ` 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=20190903200312.7e0ec75e@pixies \
--to=shmulik@metanetworks.com \
--cc=alexander.duyck@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=eric.dumazet@gmail.com \
--cc=eyal@metanetworks.com \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=willemdebruijn.kernel@gmail.com \
--cc=yhs@fb.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;
as well as URLs for NNTP newsgroup(s).