Article View: linux.kernel.netdev
Article #26089[PATCH RFC net v10 3/6] virtio_net: parse tunnel csum_start little-endian
From: Showta Ishizaki
Date: Thu, 03 Dec 2026 01:53
Date: Thu, 03 Dec 2026 01:53
44 lines
9109 bytes
9109 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:
<20261203.rfcv10.52108.3.zakinko@snowrabbit.org>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!peer05.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376201-linux-kernel-netdev=dewy.ruReferences:
<20261203.rfcv10.52108.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!peer02.iad!feed-me.highwinds-media.com!peer05.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376201-linux-kernel-netdev=dewy.ru From: zakinko@snowrabbit.org (Showta Ishizaki) Newsgroups: linux.kernel.netdev Subject: [PATCH RFC net v10 3/6] virtio_net: parse tunnel csum_start little-endian Date: Thu, 03 Dec 2026 10:53:19 +0900 Organization: Usenet Network Message-ID: <20261203.rfcv10.52108.3.zakinko@snowrabbit.org> References: <20261203.rfcv10.52108.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="2108799"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:eaW9mbbcL7fsdXc844tv3d14QiA= sha256:JT6rXN7ys6Je0Ljb4hbbPtTh5DdG8u1cwi9y38LaAwQ= sha1:ofL98lQRwP3wk2xerO9B7D2Emx8= sha256:GVyJDARErgo9prKGxwp1NE9AJcwRl994Z2u+HgWsxa0= 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 9655F1177E5; Thu, 3 Dec 2026 04:54:53 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[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 lwKWE7rJIVe9; Thu, 3 Dec 2026 04:54:44 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376201-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id B76B31177E0; Thu, 3 Dec 2026 04:54:38 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id E85DB28397; Thu, 3 Dec 2026 01:54:35 +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=1796262875; b=JciMpf0/HVeKhMpEBZnDcm7ZSwlJroAbiHxFlpEdpQWG7YsLHWAF1BnL34YRhdxGLfBk uDlfiTm/Cf83aCAz2xudWgxchfvQNr2wZNktvVaBov2RXBePZwolelZrnj0SQyQ8eSh/0 0C/DNfpJuzY7Y0isDZvCq43VusXtSrgZ9D1cp++VgaT+wb1OpfcWjCIcu3n1VZ/Lm7/4x g91zpUM2wKrtS9H3cI8S/jfpmi9FRKyQj1Ker/Rlyp5Ow7OYqYik2WOYjHpS4WEguLfv9 KsJnocR2ZbbsojoGNJLlpEPUbCH4rmYtPGCplfrlBp+gPCy19+o4gC9tn/XVTNMef1A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796262875; 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=zyE9qCD0fnGyPxvB2Syte9UwcUpHC2GnXmm0hr5gka7j1AOpXEkjdYHHs7ymAtZuGKOv ii27BjQ80XdfzCdbmBDKMvXX2goA3/PiXYoPOI2bhgiKkR+4pYeehqNO/gOXtaOdb1bJN WcL12iFArDjRKVHQMu7O4b9CHX3HLXEnLA7pfImSR8Hz4d2h3a1IEBG4rI0ibIbgF3xyV /I5b9mg677LTW/ElLx28WIDVdPdYkuZiyIxExtN4KVaRhl1MCPG3jGmGNEawB8plnlKS5 5gJPlv8AVV+qnjIzIOd4hbhq8yyy6iiDrWsL5ej+zPvhSFa4Iy7cpwtaywCVSiHGQxw== 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 B3AE3606A336; Thu, 3 Dec 2026 01:54:35 +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=1796262875; b=s1FGn0Gf3vWIQaNJOTKXeYO9YpD48Rlsk11DlX8EVsbQpArftyvDM5TCbI+m29SvPILB bI2xLvimS09OcHWpjpiddymYxqt0fF2uNrVdK+ISLagLZulW9j7KnzbMP8G8uINPiAOE1 8S+eXhkZz5jKHpjdcHIJT2wQS4itbmyCjXBnhUZIPH2HrEBZJcR/Gazy2toKz59aTSwMm E/A1/rzSSFSHB0wMsA6sPx/8vWlsDVNG6NjQ0QlpZHO5yAsQc7MxdTBZIBATJrf3hmHyB nlAoDmZ16z00H4SSNXb3eeS9f9TyFrsuL9yeiB9a/XbKoaqHzKUT91X8sn41wnyxweA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796262875; 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=q5Au3knYaKBOYCsMnY6btglTUyV0N/6EZ+Ef7NLc2WpO5HdbgrYaMRCPfNnS+gdnywL2 9Hr2TTsKN7vTYmf1dqwVzZA6uqBhcrUUWdm8c19IcT7GqvndcOGRPOejaD2RztWPMrgo2 GdfAutVYkOgvdP9puuRkKrx6PgrORFophTPMF55j34aKMftM3H2Dcej+jI6Laj4+qhKys 2NaIgvgSKeKx7AJnKTO4Xy/njuIM5eS1Ymif38ih2SSQgoVe7VW03uKNseYlV+Flp6rn4 +20+hQl41AHqKR5ZgKqITZQJzCe1tsm+co7eKscjYxsDrMLyIt3jyNhzSUo3tOLrqnw== 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 2638C606A330; Thu, 3 Dec 2026 01:54:33 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2638C606A330 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 706FAC9331; Thu, 3 Dec 2026 10:54:33 +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: <20261203.rfcv10.52108.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 X-Received-Bytes: 8912