bpf, testing: Introduce 'gso_linear_no_head_frag' skb_segment test
authorShmulik Ladkani <shmulik@metanetworks.com>
Fri, 25 Oct 2019 13:42:23 +0000 (16:42 +0300)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 30 Oct 2019 15:37:08 +0000 (16:37 +0100)
commitcf204a718357c3c28557cc6bdc77a3adc33d0741
treedacf4b79c6b7fbbd36ddf498dd8505d01e98c903
parentaf21c717f4757985771e2cee0b6e0cf21b831477
bpf, testing: Introduce 'gso_linear_no_head_frag' skb_segment test

Following reports of skb_segment() hitting a BUG_ON when working on
GROed skbs which have their gso_size mangled (e.g. after a
bpf_skb_change_proto call), add a reproducer test that mimics the
input skbs that lead to the mentioned BUG_ON as in [1] and validates the
fix submitted in [2].

[1] https://lists.openwall.net/netdev/2019/08/26/110
[2] commit 3dcbdb134f32 ("net: gso: Fix skb_segment splat when splitting gso_size mangled skb having linear-headed frag_list")

Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191025134223.2761-3-shmulik.ladkani@gmail.com
lib/test_bpf.c