From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796356903; b=WRIweQDYPVl604cg+qpd2uLjO5UHdO1zbNo3aIz+hQN/zo4sbhrDj820IPogcPFZxesm nhMpSiSZSBQ5SItzMnc6YcxHN9OkpjChqDfwPV5L4842z/FHrWe5p+EE0BZg9KKddGUHD vr0YbFWLiHAeA2ZIhs2MqdpgjjVJk5BMuLOKZWtLLLis0GVAep5495wMsp9DgZ1wbJfxV /Et4bgEPYrMht92meLKLyAb2+kIM8nqK2i5q+dNhYO186jH7hKZ5XIchpnQfKQ0/0A3Es iqbVLgViFH/D4JkHKCK8nyuXggEKVsCUwCLj2IzO7EHfsqXzrNvewiK3zajl8dg0M1g== 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== 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 CA2F0606A338; Fri, 4 Dec 2026 04:01:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CA2F0606A338 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 2D9E1C935F; Fri, 4 Dec 2026 13:01:42 +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 , Eugenio Pérez , Xuan Zhuo , Richard Weinberger , Anton Ivanov , Johannes Berg , Jonathan Corbet , Shuah Khan , Randy Dunlap , Chris Arges , Paulos Yibelo , Björn Töpel , virtualization@lists.linux.dev, linux-um@lists.infradead.org, linux-doc@vger.kernel.org, Showta Ishizaki Subject: [PATCH RFC net v11 3/6] virtio_net: parse tunnel csum_start little-endian Date: Fri, 04 Dec 2026 13:01:23 +0900 Message-ID: <20261204.rfcv11.99731.3.zakinko@snowrabbit.org> In-Reply-To: <20261204.rfcv11.99731.0.zakinko@snowrabbit.org> References: <20261204.rfcv11.99731.0.zakinko@snowrabbit.org> X-Mailing-List: netdev@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: 8bit 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 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)