Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Showta Ishizaki
Wed, 25 Nov 2026 16:06
[PATCH RFC net v8 3/6] virtio_net: parse tunnel csum_start little-endian
Author: Showta Ishizaki
Date: Wed, 25 Nov 2026 16:06
Date: Wed, 25 Nov 2026 16:06
44 lines
9110 bytes
9110 bytes
From: "Michael S. Tsirkin" <mst@redhat.com>
All tunnel related virtio features are > 32, so none of this
functionality can be enabled on legacy mixed-endian device.
Accordingly, all tunnel header fields, csum_start included, are
little-endian.
The nested virtio net header import parses csum_start that way, but the
inner transport offset is parsed with the endianness specified by the
interface.
If tun is misconfigured to legacy big-endian mode while the tunnel
features are enabled, the two parses of this field disagree, and the
value stored in skb->inner_transport_header - which is only
bounds-checked from below - can point past the end of the packet, where
GSO segmentation later dereferences it.
To fix, parse the field little-endian in both places.
Fixes: a2fb4bc4e2a6 ("net: implement virtio helpers to handle UDP GSO tunneling.")
Cc: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Showta Ishizaki <zakinko@snowrabbit.org>
---
include/linux/virtio_net.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index fc9667176..3135dae03 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -490,7 +490,7 @@ virtio_net_hdr_tnl_to_skb(struct sk_buff *skb,
inner_l3min = virtio_l3min(inner_isv6);
outer_l3min = ETH_HLEN + virtio_l3min(outer_isv6);
- inner_th = __virtio16_to_cpu(little_endian, hdr->csum_start);
+ inner_th = __virtio16_to_cpu(true, hdr->csum_start);
inner_nh = le16_to_cpu(vhdr->inner_nh_offset);
outer_th = le16_to_cpu(vhdr->outer_th_offset);
if (outer_th < outer_l3min ||
--
2.54.0 (Apple Git-157)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads