]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
virtio-net: keep vnet header zeroed after processing XDP
authorJason Wang <jasowang@redhat.com>
Thu, 29 Nov 2018 05:53:16 +0000 (13:53 +0800)
committerSultan Alsawaf <sultan.alsawaf@canonical.com>
Wed, 24 Jul 2019 15:45:07 +0000 (09:45 -0600)
commit5e2295980342be0637abe90005b988352b0486ff
tree195eb9c24587ea47571026579ca8a0352bd2fd82
parent6bcf49b9368625804457069e8adad78ad1503f86
virtio-net: keep vnet header zeroed after processing XDP

BugLink: https://bugs.launchpad.net/bugs/1837161
[ Upstream commit 436c9453a1ac0944b82870ef2e0d9be956b396d9 ]

We copy vnet header unconditionally in page_to_skb() this is wrong
since XDP may modify the packet data. So let's keep a zeroed vnet
header for not confusing the conversion between vnet header and skb
metadata.

In the future, we should able to detect whether or not the packet was
modified and keep using the vnet header when packet was not touched.

Fixes: f600b6905015 ("virtio_net: Add XDP support")
Reported-by: Pavel Popa <pashinho1990@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/virtio_net.c