Re: BUG_ON in skb_segment, after bpf_skb_change_proto was applied

From
Shmulik Ladkani <hidden>
Date
2019-09-02 13:44:52
Reply to
Willem de Bruijn, 2019-09-01
On Sun, 1 Sep 2019 16:05:48 -0400
Willem de Bruijn [off-list ref] wrote:
quoted hunk ↗ jump to hunk
One quick fix is to disable sg and thus revert to copying in this
case. Not ideal, but better than a kernel splat:
@@ -3714,6 +3714,9 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
        sg = !!(features & NETIF_F_SG);
        csum = !!can_checksum_protocol(features, proto);

+       if (list_skb && skb_headlen(list_skb) && !list_skb->head_frag)
+               sg = false;
+
Many thanks Willem for looking into this.

Indeed the above suggestion avoids the splat, at least with the
reproducer.

I'll look deeper into this, to make sure the generated skbs are indeed
legit and have correct content.

Shmulik
Thread (13 messages) 13 messages, 5 authors, last reply 2019-09-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help