[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190903200312.7e0ec75e@pixies>
Date: Tue, 3 Sep 2019 20:03:12 +0300
From: Shmulik Ladkani <shmulik@...anetworks.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: Daniel Borkmann <daniel@...earbox.net>,
Eric Dumazet <eric.dumazet@...il.com>,
netdev <netdev@...r.kernel.org>,
Alexander Duyck <alexander.duyck@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Yonghong Song <yhs@...com>,
Steffen Klassert <steffen.klassert@...unet.com>,
eyal@...anetworks.com
Subject: Re: BUG_ON in skb_segment, after bpf_skb_change_proto was applied
On Tue, 3 Sep 2019 12:23:54 -0400
Willem de Bruijn <willemdebruijn.kernel@...il.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
Powered by blists - more mailing lists