🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26716

[PATCH RFC net v11 0/6] more virtio-net csum hardening

#26716
From: Showta Ishizaki
Date: Fri, 04 Dec 2026 04:01
57 lines
9918 bytes
Michael's series again, now v11. Patches 1-4 and 6 are his; patch 5 is
mine. The only change since v10 is in patch 4.

Changes since v10:
- Patch 4: AF_PACKET took has_eth from dev->type, which TUNSETLINK can
  also change on an IFF_TAP device that still builds Ethernet headers.
  Its frames were then validated from the network header, so a non-IP
  EtherType with an IPv4 header behind it kept CHECKSUM_PARTIAL and a
  VLAN-tagged frame lost it. A device with eth_header_ops now counts as
  Ethernet too. Sashiko found this.

The two issues Michael listed as open in v7 are still open, hence the
RFC: the inner packet of a tunnel can have a valid header at
inner_nh_offset that overlaps the real transport header, and completing
the checksum at input breaks nf/BPF programs that edit the payload and
rely on CHECKSUM_PARTIAL.

Patches 1-3, 5 and 6 are unchanged from v10 and were tested as described
there. For patch 4 I sent, through AF_PACKET with a vnet header on a tap
that TUNSETLINK made ARPHRD_NONE, a plain IPv4/UDP frame, one with
EtherType 0x88cc and an IPv4/UDP header after it, and an 802.1Q-tagged
one, and looked at the skb at __dev_queue_xmit(): v11 keeps the partial
checksum on the first and the third and completes the second. The
TUNSETLINK'd IFF_TUN case from v9 behaves as before. Based on net
e6474ead54b8, the same base as v10; it also applies to current net
(90ae4042bd9f).

Michael S. Tsirkin (5):
  net: account for ingress-resolved virtio net hdr state
  um: vector: trim skbs before verifying the header
  virtio_net: parse tunnel csum_start little-endian
  net: resolve uncommon partial checksums at ingress
  net: add a sysctl to opt out of virtio net hdr checksum validation

Showta Ishizaki (1):
  net: virtio: compute the outer checksum of non-GSO tunnel packets

 Documentation/admin-guide/sysctl/net.rst |  19 ++
 arch/um/drivers/vector_kern.c            |   6 +-
 arch/um/drivers/vector_transports.c      |   4 +-
 drivers/net/tap.c                        |   4 +-
 drivers/net/tun.c                        |  44 +++-
 drivers/net/tun_vnet.h                   |   4 +-
 drivers/net/virtio_net.c                 |   2 +-
 include/linux/virtio_net.h               | 263 ++++++++++++++++++++++-
 include/net/netns/core.h                 |   1 +
 net/core/dev.c                           |   7 +
 net/core/net_namespace.c                 |   1 +
 net/core/sysctl_net_core.c               |  50 +++++
 net/packet/af_packet.c                   |  24 ++-
 13 files changed, 405 insertions(+), 24 deletions(-)


base-commit: e6474ead54b8acecb8b0462dde2d77f46d2b7dc1
-- 
2.54.0 (Apple Git-157)
Technical Details
Message-ID: <20261204.rfcv11.99731.0.zakinko@snowrabbit.org>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377035-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377035-linux-kernel-netdev=dewy.ru
From: zakinko@snowrabbit.org (Showta Ishizaki)
Newsgroups: linux.kernel.netdev
Subject: [PATCH RFC net v11 0/6] more virtio-net csum hardening
Date: Fri, 04 Dec 2026 13:01:23 +0900
Organization: Usenet Network
Message-ID: <20261204.rfcv11.99731.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="2670332"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:eawqCg34WaDS3c9jNi4x9YZWup0= sha256:C3Dt38fHJ3iM03MnldAXaB2PopCWVY8TyM7uWnXueJs=
	sha1:9b/2fjUeBKJ4XD3hoFC1v11iyRU= sha256:XWLk2tsGz/YoOvb0Lq3sJFjzXdD+OHaWgU3tVUMpaE8=
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 DD8FA117AEC; Fri,  4 Dec 2026 07:01:57 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.199
X-Spam-Status: No, score=-3.199 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
	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 y8lV7VwNC9Rc;
	Fri,  4 Dec 2026 07:01:53 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377035-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 6AA44117AE9; Fri,  4 Dec 2026 07:01:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 8CF10265F6; Fri,  4 Dec 2026 04:01:44 +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=1796356904;
	b=CWN3ArriyeasZlMnu4rvuDZjkew+1drhvaEdedJwzj634Lje1Pdr3O0gMeTqgshj0wBL
	 Q2Sq4/T50LTn3dSzBzskV9b+xrnL8SrVhqVT9QS3lXoAdFo+mOqdtqfbRRg1Q76YC7rII
	 0xh8Q6z9Zafhw6WhIZOLsWzu0em66kdGESqvtUZx1GaqhP4iCu3KJL7d2mawwjuvGIbul
	 cRRLh566/Rk2WJZvjFZVIR2qLbS39J+rb2exAlfZhJp3HQ5r1uGX9r3oq4Eic4oaeZP1H
	 ZadCJBO5hez3p2TDuActxbOhYtG8c8wKGOwv4ETjd/dL1uWuSkDhbkG32HiRTsYAJ+w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796356904;
	h=X-Original-To:Received:DMARC-Filter:Received:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=g/nOn6dEcEYfz4tSGWr4ply5nFQeDEwFV3n7zbyfN/o=;
	b=CZo4tC9ItSykMjyWVb2pv4Z8O74Jzex6wj8JBLfjROJAjcF92olmcLzHUdXnqSewHS+c
	 XGYiWvvvDHe6udkjSz1jX/Wwkpb8SbpRAdVTYyT1rzUjuEvq+RAUj81SnXNfKV+QWqqdF
	 +bwaZzBdakw9sTOGA+YOudUalxQvqNGkP2zLtyn7JH4riyGhaXy0XmV/TU3LQYEtjxWnw
	 2uoq/scKQdK7JjMdafSLfA+wv+qEn5aDaZ+7feVs8Gv9dA5wxdu67UsU6p0k2o13MmAAy
	 YmiHNTa9UuzBvlZy048ANcv5MsO8SoOiLx/zzYsQgVjGqXnBJ03Pe49CupMhRkQYRCg==
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 ECBEC606A33C;
	Fri,  4 Dec 2026 04:01:43 +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=1796356903;
	b=pVhmeKzYsysyPW2ndIks9vhYXynKKn28WWD5P/3L92LMRIWYJPa8VxA+OjUrR/Bk65sP
	 PUhvobMpai4h4iw8vWHNoNQOWZsxUI2pMWqRLWXf0N450BkERsD0xN1/QNkUwZWR4fuuC
	 Y1ihu30foxuV8psmHIu1288fA5Mmigjb7wO5/lqAD87buRsGRJ9+l6dizQ00aVw5StMTI
	 O1OtPq9QV1c6C3U+jSZxtqw8CNSrnsvfNwwxFyzmFL6dnmYG8hR64sF1NpW88c8l7OdJY
	 Usk0luvhlDL13xuI2iL7yyYCaeCHvIZyGKO1fi1tD2FnU63t/trLt8wHdeGAq6i8p+w==
X-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:
	 MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=g/nOn6dEcEYfz4tSGWr4ply5nFQeDEwFV3n7zbyfN/o=;
	b=pVXsCDsQV2sVK8I3NTIANbwUf3KqPdnriieAQ0FYn+XbOZ3nrnpzv3VHcLYGIP2LlKxV
	 Lk+kivIFc5Yv1WDerKz5sp+FgxWOF/PN9Yn6obOnSiKSn5lDwagHCvQ15kk4GPy4EvF/Z
	 FpAagmTXY434ZItkUGqhujn/I3Eh3dGO4tYCvQ0J9su7h90lO1fhsFhTdzk8tcgQUSD6i
	 85cEz8HjsgcdWcOi72lYAOs3XAMbj7DOSLPM26cuF30QPFd8gdmvONr2LjDLMoRFAP4BB
	 tbQ9AXHJ7HQycXhOXAe5GYlE0dke2Phj/DgI49iF46UwrubQrbdu2kZqqx6PUw25V0A==
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 CA46F606A33B;
	Fri,  4 Dec 2026 04:01:42 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CA46F606A33B
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 E01BAC92FE; Fri,  4 Dec 2026 13:01:35 +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-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