Skip to content

Commit 7b56e43

Browse files
tannerlovekernel-patches-bot
authored andcommitted
selftests/net: amend bpf flow dissector prog to do vnet hdr validation
Change the BPF flow dissector program to perform various checks on the virtio_net_hdr fields after doing flow dissection. Amend test_flow_dissector.(c|sh) to add test cases that inject packets with reasonable or unreasonable virtio-net headers and assert that bad packets are dropped and good packets are not. Do this via packet socket; the kernel executes tpacket_snd, which enters virtio_net_hdr_to_skb, where flow dissection / vnet header validation occurs. Changes v4: - Read virtio_net_hdr pointer from struct bpf_flow_keys - Add vnet header endianness logic to BPF program Signed-off-by: Tanner Love <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]>
1 parent 09cd41d commit 7b56e43

File tree

3 files changed

+342
-66
lines changed

3 files changed

+342
-66
lines changed

0 commit comments

Comments
 (0)