Article View: linux.kernel.netdev
Article #10615[PATCH net 0/3] net: virtio: validate outer protocol of UDP tunnel GSO packets
From: Eric Dumazet
Date: Tue, 03 Nov 2026 20:31
Date: Tue, 03 Nov 2026 20:31
33 lines
8837 bytes
8837 bytes
virtio_net_hdr_tnl_to_skb() does not check that a UDP tunnel GSO
packet really has an outer IPv4/IPv6 header matching the declared
tunnel type. A guest, or any tap writer, can send a frame with another
outer ethertype (NSH in the report), and the GSO stack then builds
segments with skb->data before skb->head. The host crashes in
skb_under_panic() as soon as a header is pushed.
Patch 1 adds the missing check. Ethernet frames can carry VLAN tags
before the outer IP header; for IFF_TUN, skb->protocol is provided
by the caller.
Patch 2 fixes a selftest helper computing UDP checksums over a length
in network byte order.
Patch 3 adds tun selftests: valid outer IPv4 frames (plain and VLAN
tagged) are accepted, mismatched or non-IP outer headers are rejected.
Eric Dumazet (3):
net: virtio: validate outer protocol of UDP tunnel GSO packets
selftests: net: tuntap: fix UDP checksum length in
build_udp_packet_csum()
selftests: net: tun: test outer protocol of UDP tunnel GSO packets
include/linux/virtio_net.h | 28 ++++
tools/testing/selftests/net/tun.c | 130 +++++++++++++++++++
tools/testing/selftests/net/tuntap_helpers.h | 2 +-
3 files changed, 159 insertions(+), 1 deletion(-)
base-commit: 647b81ddefc6364290e67bf33c89d54971f8995e
--
2.53.0
Technical Details
Message-ID:
<20261103203113.550604-1-edumazet@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355946-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355946-linux-kernel-netdev=dewy.ru From: edumazet@kernel.org (Eric Dumazet) Newsgroups: linux.kernel.netdev Subject: [PATCH net 0/3] net: virtio: validate outer protocol of UDP tunnel GSO packets Date: Tue, 3 Nov 2026 21:31:10 +0100 Organization: Usenet Network Message-ID: <20261103203113.550604-1-edumazet@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3254751"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:p9tlqOp6+vWC98jgBErxncBKQRk= sha256:GJDLVAfIN2K5YwxDjfgr/fp3K3QdOV1D4g524dX3WDQ= sha1:ZA+SOoh4A845G2UUnLoOYfDLJT4= sha256:d+1bzyS4p0gxAg8NyOgAu5ymhvcEGhGPMHQ9rDkCn+U= 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 5C952112031; Tue, 3 Nov 2026 23:31:58 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org 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 oafiyjOmV8nW; Tue, 3 Nov 2026 23:31:55 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-355946-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 1398D1129E5; Tue, 3 Nov 2026 23:31:46 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id E800C60175F; Tue, 3 Nov 2026 20:31: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=1793737894; b=enTEnLkayICuKiVN6tjM3yEL1Kw1rYtmFJOFVpsMEJbNcFZqUIgJdznp55DSdutojZzZ rGOX41964+fOBDMEFlQ+cy8fH0lc3faFN+JHnUZ7W/HcR9M9ZV52KLWLIS62bSVruNZqm UzerOpLcWEDNhlGfcoHeHAG3LCsyAnTJknmn60GTiDi68YQaSrwEaNHZreOHvUDvC+r9r TGnjsFiq74A0kq5mOSPU+xmIfu0CbZJGvU9TjbtDsuk6XmB5HTzBGQEftyoh+cWZE0u5R WAm1i9zVxXOtTUy/IOHhb1SOQve5/UN3+q7IjO4do4Z95JkyXK2EFIvMN9faJVo3/gA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793737894; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=vmzrb4/T0oqAjCmcKtvvEia+LGLPBUTmBoP8KRjFMHI=; b=ZoOtYHkSL8sOgN+1VEYEn8PL5l3bjJh78lAsnoXgiFqaoS4MG0oNy9KIx87WP7fuubbu 45jhekpUdxB7Lvk/DoCFZZP4G3c6rUL5P6B1egVdPY2GwWMyYNA1OcVAQcg+bH3u4kZ+o 80Ab8eF6icSpSDh7mT45i9HQyueSH8eS7PYE3tCDLVfHRG1plM+w2EsMcws90AznYRvgq Hz03M0a5opZterk05HDlXMM0neEfM/TC8hdaEiVrz3wVRG/z5KnhP09qqSKs2XkgRE9Rt SWOIs+1lV3NxDfYOx1X7lHdocM7WZSES/ORXSGtK6hxrAA42xY7pL0HWgI7DNs+xZxQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dclSn7dQ; 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 1AF0D606A332; Tue, 3 Nov 2026 20:31:34 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dclSn7dQ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793737883; b=EfGIrxVLIqjcRtZRWbgTHo/EYbFuKjh/jW5Gg/2BOT57UnQgLkkTysjqUMt5rEkRcfmE E+5xlCN+FVGeIM1560DdosE8NSSHUVqVXYOI44zi8pJc6m5u1g9XEmjKVxS5mjDUBrUiT LNb3ogPtB6XzCyQbLWskrc+fRRMjUb+5vr5Kw2vLKz6X67qsCT/PZ4NAYqkls7u4tBNeB RYr3QguadvMo5vpB00aMFF8ha+JnPB1JHQFskXwrl5Bv1m5UQilBd+hDlBOSn+FmcMSGk sfwX2jCcN0z5C8eyJHswVwC0arRHHb3QljO2e042nI3uw3ohYTZ6xWeVNVT7xF3OM+A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793737883; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=vmzrb4/T0oqAjCmcKtvvEia+LGLPBUTmBoP8KRjFMHI=; b=PZ648idvTP8ubeL+n4uGaOr2utXbvTyoBoWpdJaeWL0mGQrrMhLPQLDromBXoqt4RsQf OPKjeuU3ylpBS6h6WJvSFWBMNCHHDJ/IVEQgoZd17IY78tMNhZoS+3wAX/64taJhsmDbo nceN8TpYPnNXspe4VR/O0iJnAcXnJtdv4R+krjY0P8Y6UqooO5kufz0GIATrzHoHC9soO XSxfWz30kszYcBQc0VwMIBQnRYzBkw9FscFLPXXV+hoywVhqtzytBqr5fu+3HgiQF4cQp YR4FouMARSSusHD6vaG23PdpbPAGmA5+F79lruHO8mjYsmcAy26OuyZcKtQD5/VZkyg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dclSn7dQ; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECF4A606A31B; Tue, 3 Nov 2026 20:31:22 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 665B61F000C1; Tue, 3 Nov 2026 20:31:20 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793737882; bh=vmzrb4/T0oqAjCmcKtvvEia+LGLPBUTmBoP8KRjFMHI=; h=From:To:Cc:Subject:Date; b=dclSn7dQPmlZeGTbOGUL6YLBP2Tg84gymyizEL204OCtU1GN2x9gVGV0o9sdQTCQb snFdeN4ofyiGywmLP5LLn9FLp97RQOeOPqYM8IKhoLABvdmUMH6VCH+J/3wFWom5em mSgqlbnkHkT/4SRHVI4gv/SU0KQs5Z5WcsepQnrqCssnt2IQ2EiQDYQxipT2uhc2ZV iMnqvHwDPdUCWgwlR52zUTI//5emPNSZp+0XkKQYO+XEXeTgKh3RMlNP/0RmfkB8qJ avSm1zbk5iB36oRFN3jeC/aIgMGcgAZBXAsW69RIw8pG7tVHjXzggKOgQ7qsvzh88m zIikTeYaekpyQ== X-Cc: Eric Dumazet <edumazet@kernel.org>, Simon Horman <horms@kernel.org>, Willem de Bruijn <willemb@google.com>, "Michael S. Tsirkin" <mst@redhat.com>, Eugenio PΓ©rez <eperezma@redhat.com>, Hassan Sultan <hassansultan@google.com>, virtualization@lists.linux.dev X-Mailer: git-send-email 2.53.0 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