🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25600

[PATCH RFC net v9 3/6] virtio_net: parse tunnel csum_start little-endian

#25600
From: Showta Ishizaki
Date: Wed, 02 Dec 2026 04:00
44 lines
9135 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: <20261202.rfcv9.41657.3.zakinko@snowrabbit.org>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375534-linux-kernel-netdev=dewy.ru
References: <20261202.rfcv9.41657.0.zakinko@snowrabbit.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375534-linux-kernel-netdev=dewy.ru
From: zakinko@snowrabbit.org (Showta Ishizaki)
Newsgroups: linux.kernel.netdev
Subject: [PATCH RFC net v9 3/6] virtio_net: parse tunnel csum_start
 little-endian
Date: Wed, 02 Dec 2026 13:00:00 +0900
Organization: Usenet Network
Message-ID: <20261202.rfcv9.41657.3.zakinko@snowrabbit.org>
References: <20261202.rfcv9.41657.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="1880932"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:DsAGpXa64Ttk3KxSVuTtGRlSc9w= sha256:NGmKmBCivWeo3F/aL9ywPebeG/2gjmHpLE1lBv8TKiw=
	sha1:x1cN4xoi9YfYi4AAdaPMh8GYcG8= sha256:LsH/tcjPu6LPiIyGSZEdAOjhKdwCte92JDRMr4/kJJg=
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 5B5CE11754F; Wed,  2 Dec 2026 06:50:43 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	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 XKrG2sRLK15F;
	Wed,  2 Dec 2026 06:50:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-375534-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 0FE2F11754A; Wed,  2 Dec 2026 06:50:29 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 8BF99271AB; Wed,  2 Dec 2026 03:50:26 +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=1796183421;
	b=tqgWvOrgWoO10tDJR9mcOrA4ZlJ/vZKguTFbEq/0S6WA47tHT4wQamboVYXa3+n8QNf/
	 r9zmUA8AW1zOeQzx1ILLwQVTdtwr3Y/FBcyHgRqfkfJsmSHlf22JrkEo6+6K9LWfueFj8
	 Uo/GfSGqIb194QnxGMz/dRpFdFFJ2BOZxqh7ST4er5Tu6S+r3vc7RVGPGrU/JF0p+5msl
	 Ac80GbM+PqCmXUzvk6HCpkTO/6Jqeci5FIQWrnDaTqzLnMsXn4PyZOHYoaZO9fWU56ixj
	 uyyaX8w3SC+6DFUtWSr5t04HIwXaeOp6rsr94Dq5srz/qzKUxt9c2GUUUiWyvew3hBw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796183421;
	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=N7QpULzlKo1vu8ya1iAeQN+xjp0mZ8HYYI5dkVLxCNA=;
	b=eC/WgRQ3yFzq2oD/ovdqywPepXn2ZSwKMh7oIcHXor+oir8VA6WPa0I5IZ69pN59FT/4
	 nR9PxeaGQ/afE7jpHMCUDsCUvw3RdnTSDPrtLcyY+0ElK0khiSBvcVC9k7Nljn/ZsbhfP
	 quIXoNzeVcLftHZ2btpw81iKcaHExiMk/ziHPTYVbBNLzlnM684ADqGH90Zu+fNEJ1BBS
	 0Abp9Jxo816GPE1y6s1c8aF77LVGxUxwf91xnNDdTX6RUiPwpnmCesvLsMvzYSykXpZDY
	 X089EsP75HYFg0EfN9R44L/upOcbgJiUIIhqDdKs2pgDno56J2DjxTDIVc3JFwKcifw==
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 865C5606A6B4;
	Wed,  2 Dec 2026 03:50:21 +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=1796183420;
	b=juwS3jgOOnL/fVFocFkAoOMjEizAOkY2RdaeKL7ndLyvpELA/OZ6hSqLNrU7bawJWwJi
	 zST81HwZwiQYogDJgGEcQoT3VmJsi/NnROcroAzIwsiEFeiZ+NPUnROqTPeI3YmxwVxYK
	 lIf2OIHMVLvc4M//uII7P4Y203/fLY8S1y+f7MS2Zr4xZIDS+X1NkEPHzly5jbX7VtfN7
	 aZ3w033vaOylaRXlFLGypxcOyNIaDErOFUELfrVLQGQBeVyXbF31gK1WCGmKJLD6GG4qa
	 BiUcM/HPnx5/gxgzSdQRvN/YfX25E8pFxy+pAgFWzU2/rclI05NjNy5triHnHS61DxA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796183420;
	h=DMARC-Filter:Received:From:To:Cc:Subject:Date:Message-ID:In-Reply-To:
	 References:MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=N7QpULzlKo1vu8ya1iAeQN+xjp0mZ8HYYI5dkVLxCNA=;
	b=d1XyhJYMHh1KOomvG2VWUK7uZrRW6fTDSjz8H6yjhTrty7t9m1dSpURKXJEnhw6A6bxC
	 oPQmp/ybwJ5cXLLN8H4wBgJ6E/MRfuaBSf5d9aXzaTQ8K/s/TmdenNAf9vXYbb/XI0D0H
	 8er7QuFhjwuvo0zu9+LGd/qoxVq71v88ZHUiQdkBRs8Sp8lx0hOBLGsX6ewSEetyFFv4m
	 fTvJQwN+ro5XFF05awmuZX7rRVvlfo+/bEehyfg4iaSFUAX+CufSZq4qTGJWi1XXWcVW/
	 JHn+T9qm1JmugpvNWSrittNhNPnikY+OcXpTF5RaIyqG7nxgnFzmnFFt96jhUgxbD6w==
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 AA11D606A681;
	Wed,  2 Dec 2026 03:50:19 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AA11D606A681
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 89C41C9308; Wed,  2 Dec 2026 12:50:18 +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: <20261202.rfcv9.41657.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