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=1796183420; b=juwS3jgOOnL/fVFocFkAoOMjEizAOkY2RdaeKL7ndLyvpELA/OZ6hSqLNrU7bawJWwJi zST81HwZwiQYogDJgGEcQoT3VmJsi/NnROcroAzIwsiEFeiZ+NPUnROqTPeI3YmxwVxYK lIf2OIHMVLvc4M//uII7P4Y203/fLY8S1y+f7MS2Zr4xZIDS+X1NkEPHzly5jbX7VtfN7 aZ3w033vaOylaRXlFLGypxcOyNIaDErOFUELfrVLQGQBeVyXbF31gK1WCGmKJLD6GG4qa BiUcM/HPnx5/gxgzSdQRvN/YfX25E8pFxy+pAgFWzU2/rclI05NjNy5triHnHS61DxA== 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== 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 AA11D606A681; Wed, 2 Dec 2026 03:50:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AA11D606A681 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 89C41C9308; Wed, 2 Dec 2026 12:50:18 +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 v9 3/6] virtio_net: parse tunnel csum_start little-endian Date: Wed, 02 Dec 2026 13:00:00 +0900 Message-ID: <20261202.rfcv9.41657.3.zakinko@snowrabbit.org> In-Reply-To: <20261202.rfcv9.41657.0.zakinko@snowrabbit.org> References: <20261202.rfcv9.41657.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)