]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix virtio-net's length calc for XDP_PASS
authorNikita V. Shirokov <tehnerd@tehnerd.com>
Mon, 23 Apr 2018 04:16:48 +0000 (21:16 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 23 Apr 2018 09:28:34 +0000 (11:28 +0200)
commit06f4de60bd34feb40b83a437bd69e63ffb4d7356
treec4e08677572a19959fc98cf0bdf433aa2ae8940c
parentcbb7277603a663642f91efa01076fed9a9906c8a
bpf: fix virtio-net's length calc for XDP_PASS

In commit d04ff19d1c8a ("bpf: make virtio compatible w/
bpf_xdp_adjust_tail") i didn't account for vi->hdr_len during new
packet's length calculation after bpf_prog_run in receive_mergeable.
because of this all packets, if they were passed to the kernel,
were truncated by 12 bytes.

Fixes:d04ff19d1c8a ("bpf: make virtio compatible w/ bpf_xdp_adjust_tail")
Reported-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Nikita V. Shirokov <tehnerd@tehnerd.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/virtio_net.c