Article View: linux.kernel.netdev
Article #26717[PATCH RFC net v11 3/6] virtio_net: parse tunnel csum_start little-endian
From: Showta Ishizaki
Date: Fri, 04 Dec 2026 04:01
Date: Fri, 04 Dec 2026 04:01
44 lines
9147 bytes
9147 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 fc9667176f23..3135dae031a4 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)
Technical Details
Message-ID:
<20261204.rfcv11.99731.3.zakinko@snowrabbit.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mi.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377036-linux-kernel-netdev=dewy.ruReferences:
<20261204.rfcv11.99731.0.zakinko@snowrabbit.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mi.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377036-linux-kernel-netdev=dewy.ru From: zakinko@snowrabbit.org (Showta Ishizaki) Newsgroups: linux.kernel.netdev Subject: [PATCH RFC net v11 3/6] virtio_net: parse tunnel csum_start little-endian Date: Fri, 04 Dec 2026 13:01:23 +0900 Organization: Usenet Network Message-ID: <20261204.rfcv11.99731.3.zakinko@snowrabbit.org> References: <20261204.rfcv11.99731.0.zakinko@snowrabbit.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2670379"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:T1bFv//ISQxMcWiz9Omqq62dw7s= sha256:ANVo2E/vRvCA3yQWrmwBvWj+MsKhoYrcKmd8MA2PRxs= sha1:cpq9asWPB3TUaBzoCCXQly9lSyg= sha256:LMwsXtKPxhCZ9CZaI8IvN4CRftN2jvlA1VwnjGhOF+c= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id CAC71117AE9; Fri, 4 Dec 2026 07:01:59 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.199 X-Spam-Status: No, score=-3.199 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xJVvC1BxPYyy; Fri, 4 Dec 2026 07:01:57 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377036-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=snowrabbit.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id DBA28117AE8; Fri, 4 Dec 2026 07:01:51 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 25FD0270F6; Fri, 4 Dec 2026 04:01:45 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796356904; b=e6YUI90T3RZHOub6VB+s2D22dn1ww2bF66s47wRhVPF+sC1xxm1zup8yGWBzOZTU2W6O eVOqZ2fdc6GfcZazFnGjHLx8YEeGUY971r7bbrRZ5ncRNUolHrFXfdHrPd+HQ3m+bzFtR aDeamIas1h2KS5YVGj/KCMlhFGsDnc2Oa6e1Z8SmGorHZzqlDYHI8bJdUG0fBPdya0Mj2 eTBTbTeTuDLdAc5gFqpipN79+QbhojTYh6q5eJ5aL2+IXTud5mlkjwX2y+c77yJ7+90DS YyBQ8XOCIF4wgma5XdrZnR/8JrW5mea6GTAbJsuaQvaT6M8uY7yfHBEv2fyqvfAGzTA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796356904; h=X-Original-To:Received:DMARC-Filter:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=8kg2K19l6CON+JqTH5N4W9EowssFB03NyKHRQwBT88E=; b=cLjAoDz8H6m4nRnOLFFFZfqbLeMYLeMFXNcKA5W8AqJncMbMQOOBPaTh7fRvFbNPl56r fByaHFiAgTVWWRiOaQIBaBZe9owYcprsKUHoedniw9qIJeMs9u70j2Plwbhws3pupcqTN n8KozMJtRFqzoN+L2idpcFL5cTpbsWFT/Bi4dsugJFDNz9kK316eVpmrlFCMhEiMdn1Q8 gSHxsZ8rKJvuwuXI1wQHGIaP5G2Do9hSI8JKx8EEtunz4lKUgt8m6COooVDjNtebiF0Mj SVRTG2TiKE7gKJpZ0dIZiEOoXKF/LVu4BORxIPmQBEFzptjUl7XbGTYYIie0rJ/icFA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=snowrabbit.org; spf=pass smtp.mailfrom=snowrabbit.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 723DF606A33F; Fri, 4 Dec 2026 04:01:44 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=182.48.54.220 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796356903; b=WRIweQDYPVl604cg+qpd2uLjO5UHdO1zbNo3aIz+hQN/zo4sbhrDj820IPogcPFZxesm nhMpSiSZSBQ5SItzMnc6YcxHN9OkpjChqDfwPV5L4842z/FHrWe5p+EE0BZg9KKddGUHD vr0YbFWLiHAeA2ZIhs2MqdpgjjVJk5BMuLOKZWtLLLis0GVAep5495wMsp9DgZ1wbJfxV /Et4bgEPYrMht92meLKLyAb2+kIM8nqK2i5q+dNhYO186jH7hKZ5XIchpnQfKQ0/0A3Es iqbVLgViFH/D4JkHKCK8nyuXggEKVsCUwCLj2IzO7EHfsqXzrNvewiK3zajl8dg0M1g== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796356903; h=DMARC-Filter:Received:From:To:Cc:Subject:Date:Message-ID:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=8kg2K19l6CON+JqTH5N4W9EowssFB03NyKHRQwBT88E=; b=O1XEILGKZKlGqjwBDVbomUFW2NSjK20Hce9ggCrtWDCNO79sUKbSCeqQIm6eYmUSyR/Y 7iSlwO4hvzogC1Hgcam9P2mS6NKGrrayo2NYoPw0GyeZtFgt+wVMWM8diFxX0HgF1aJcv SLrqnRyiDw779NBcYiJPtlPaBtiOW30szBHXvpLC849GyIIHpwslTgXulq6/Hkm5OfYZB n5dYRhHt8Zqt5Rc4Y1lR6kOZascUu9ILVIYPMjvhST5EhuXRD0sxYjMHFqd+anOmjs2ls jaBHibG75RL4xAFQPNBKzKCZRbZMOOxniNCtW1zKE8Lvi0LKlbDT2PpxgNIfE8pDNTw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=snowrabbit.org; spf=pass smtp.mailfrom=snowrabbit.org; arc=none smtp.remote-ip=182.48.54.220 X-Received: from bambi.snowrabbit.org (bambi.snowrabbit.org [182.48.54.220]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA2F0606A338; Fri, 4 Dec 2026 04:01:42 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CA2F0606A338 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=snowrabbit.org X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=snowrabbit.org X-Received: by bambi.snowrabbit.org (Postfix, from userid 3001) id 2D9E1C935F; Fri, 4 Dec 2026 13:01:42 +0900 (JST) X-Cc: Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, David S. Miller <davem@davemloft.net>, Andrew Lunn <andrew+netdev@lunn.ch>, Simon Horman <horms@kernel.org>, Eugenio Pérez <eperezma@redhat.com>, Xuan Zhuo <xuanzhuo@linux.alibaba.com>, Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, Jonathan Corbet <corbet@lwn.net>, Shuah Khan <skhan@linuxfoundation.org>, Randy Dunlap <rdunlap@infradead.org>, Chris Arges <carges@cloudflare.com>, Paulos Yibelo <habte.yibelo@gmail.com>, Björn Töpel <bjorn@kernel.org>, virtualization@lists.linux.dev, linux-um@lists.infradead.org, linux-doc@vger.kernel.org, Showta Ishizaki <zakinko@snowrabbit.org> X-In-Reply-To: <20261204.rfcv11.99731.0.zakinko@snowrabbit.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list