Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=182.48.54.220 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795622829; b=TMT+Sd9b77BLq/nPhgl22gw27FYt80JhfdpPC79/r9/uTIVNNZX+gMr12es5J0FIANHl oJFxv0vzpvL26PmctzOiaXlcRuKzg8FdhMvknnaJsBomZKQw1NC3L4m2m8D5q5IoapvVb 9u0naYclZgg+rJmbohSotPP7uJVYJlKt/gV0GD4EBZyuGa2385ZWHqxb+6zNYC2HL902c 3QeFGz7fjSJcEABj+ruXoxIZ7ChO40vsH4QEgbFIiZKYufRFnMa2bjwsEEyN3ih2o5Lzy WYVOKBM8zVzsHl1oqPHFP1uIEHfhkDmX1JjLMAGMn15WUP2pFyitVGXp4kiD5WTtSxg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795622829; h=DMARC-Filter:Received:From:To:Cc:Subject:Date:Message-ID:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=G6T7jpstO8PkN3s/pf9ze2EnC64looMz52Ecp4aw0pc=; b=kSxHVjV0mwqWyrKloBUjY4hiB4WbCHvbzZ4e11hZftF85tul52f/pjqwZ1raR4ZPUQ8a khFWy1BRdQz3CkASo+aVmXMY7Mx2LSCMbjRdc+6/bbB1IrBw9PR++x0Ml7Kj3LAxNf2GP JQqCnEPU6J2uYkHru29LRcRxcLn3i2GHGGyubM204H6jVEe4UdeCRQmhDQtwfnuyQ121P /v31Tsd2cw7K0blWh3mcEHCud3irVXFeAGbi113p+Jq2ltM8vbPy/sZY+vWOfRw6tuOgK x5dTO0t4uQpHbXUrRJkAOJ82oMZNK14HF2o1VOFXV6TpDQRiImN+Yi0N1Alz73cIOug== 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 Received: from bambi.snowrabbit.org (bambi.snowrabbit.org [182.48.54.220]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 274CB606A32C; Wed, 25 Nov 2026 16:07:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 274CB606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=snowrabbit.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=snowrabbit.org Received: by bambi.snowrabbit.org (Postfix, from userid 3001) id 6E425C935F; Thu, 26 Nov 2026 01:07:01 +0900 (JST) From: Showta Ishizaki To: "Michael S. Tsirkin" , Willem de Bruijn , Jason Wang , netdev@vger.kernel.org Cc: Eric Dumazet , Jakub Kicinski , Paolo Abeni , "David S. Miller" , Andrew Lunn , Simon Horman , =?utf-8?q?Eugenio_P=C3=A9rez?= , Xuan Zhuo , Richard Weinberger , Anton Ivanov , Johannes Berg , Jonathan Corbet , Shuah Khan , Randy Dunlap , Chris Arges , Paulos Yibelo , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , virtualization@lists.linux.dev, linux-um@lists.infradead.org, linux-doc@vger.kernel.org, Showta Ishizaki Subject: [PATCH RFC net v8 3/6] virtio_net: parse tunnel csum_start little-endian Date: Thu, 26 Nov 2026 01:06:44 +0900 Message-ID: <20261126.rfcv8.99797.3.zakinko@snowrabbit.org> In-Reply-To: <20261126.rfcv8.99797.0.zakinko@snowrabbit.org> References: <20261126.rfcv8.99797.0.zakinko@snowrabbit.org> X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit From: "Michael S. Tsirkin" 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 Signed-off-by: Michael S. Tsirkin Signed-off-by: Showta Ishizaki --- 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)