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=pVhmeKzYsysyPW2ndIks9vhYXynKKn28WWD5P/3L92LMRIWYJPa8VxA+OjUrR/Bk65sP PUhvobMpai4h4iw8vWHNoNQOWZsxUI2pMWqRLWXf0N450BkERsD0xN1/QNkUwZWR4fuuC Y1ihu30foxuV8psmHIu1288fA5Mmigjb7wO5/lqAD87buRsGRJ9+l6dizQ00aVw5StMTI O1OtPq9QV1c6C3U+jSZxtqw8CNSrnsvfNwwxFyzmFL6dnmYG8hR64sF1NpW88c8l7OdJY Usk0luvhlDL13xuI2iL7yyYCaeCHvIZyGKO1fi1tD2FnU63t/trLt8wHdeGAq6i8p+w== 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== 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 CA46F606A33B; Fri, 4 Dec 2026 04:01:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CA46F606A33B 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 E01BAC92FE; Fri, 4 Dec 2026 13:01:35 +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 0/6] more virtio-net csum hardening Date: Fri, 04 Dec 2026 13:01:23 +0900 Message-ID: <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 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)