]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
net: fix bpf_xdp_adjust_head regression for generic-XDP
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 1 Aug 2019 18:00:31 +0000 (20:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Aug 2019 18:17:40 +0000 (11:17 -0700)
commit065af355470519bd184019a93ac579f22b036045
tree8646d4782ad35e0fce6e8ebcecc3896fd694154d
parent13978d1e73d2fcfb6addcf3392707ad68fa88ccb
net: fix bpf_xdp_adjust_head regression for generic-XDP

When generic-XDP was moved to a later processing step by commit
458bf2f224f0 ("net: core: support XDP generic on stacked devices.")
a regression was introduced when using bpf_xdp_adjust_head.

The issue is that after this commit the skb->network_header is now
changed prior to calling generic XDP and not after. Thus, if the header
is changed by XDP (via bpf_xdp_adjust_head), then skb->network_header
also need to be updated again.  Fix by calling skb_reset_network_header().

Fixes: 458bf2f224f0 ("net: core: support XDP generic on stacked devices.")
Reported-by: Brandon Cazander <brandon.cazander@multapplied.net>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c