]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
net: accept UFOv6 packages in virtio_net_hdr_to_skb
authorWillem de Bruijn <willemb@google.com>
Mon, 20 Dec 2021 14:49:01 +0000 (09:49 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 7 Mar 2022 15:34:24 +0000 (16:34 +0100)
commitc473bbc67a5beb19ba28213614420796895e268e
tree76d3201bde58d808198a139bbc9de2411c5bdac7
parent7d56cfe47eaf8c502417a57c0b69aa01244444ae
net: accept UFOv6 packages in virtio_net_hdr_to_skb

BugLink: https://bugs.launchpad.net/bugs/1958557
[ Upstream commit 7e5cced9ca84df52d874aca6b632f930b3dc5bc6 ]

Skb with skb->protocol 0 at the time of virtio_net_hdr_to_skb may have
a protocol inferred from virtio_net_hdr with virtio_net_hdr_set_proto.

Unlike TCP, UDP does not have separate types for IPv4 and IPv6. Type
VIRTIO_NET_HDR_GSO_UDP is guessed to be IPv4/UDP. As of the below
commit, UFOv6 packets are dropped due to not matching the protocol as
obtained from dev_parse_header_protocol.

Invert the test to take that L2 protocol field as starting point and
pass both UFOv4 and UFOv6 for VIRTIO_NET_HDR_GSO_UDP.

Fixes: 924a9bc362a5 ("net: check if protocol extracted by virtio_net_hdr_set_proto is correct")
Link: https://lore.kernel.org/netdev/CABcq3pG9GRCYqFDBAJ48H1vpnnX=41u+MhQnayF1ztLH4WX0Fw@mail.gmail.com/
Reported-by: Andrew Melnichenko <andrew@daynix.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20211220144901.2784030-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/linux/virtio_net.h