Article View: linux.kernel.netdev
Article #3681Re: [PATCH net-next v2 4/7] net: resolve uncommon partial checksums at ingress
From: Willem de Bruijn
Date: Thu, 15 Oct 2026 18:07
Date: Thu, 15 Oct 2026 18:07
38 lines
10384 bytes
10384 bytes
Michael S. Tsirkin wrote:
> As reported first by Paulos Yibelo <habte.yibelo@gmail.com> (after which
> others, credited below, found more ways the bug can affect users) a
> virtio net header can place CHECKSUM_PARTIAL at any in-packet offset.
> If that state is retained, later checksum completion can modify the
> packet after protocol processing has made decisions from it.
>
> Let's fix that: let's validate csum_start and csum_offset and only keep
> CHECKSUM_PARTIAL when csum_start and csum_offset match a parsed TCP or
> UDP header, while handling VLAN headers, IPv4 options and IPv6 extension
> headers. Complete other non-GSO checksums immediately, before any
> protocol processing runs.
>
> We can't easily "complete the checksum" for GSO we don't recognize - GSO
> assumes knowledge of the protocol. We could segment ignoring the
> checksum then do whatever csum_start and csum_offset say, but that
> seems like an overkill for something that shouldn't happen.
>
> There's some risk here:
> - non-gso packets which can't be parsed get checksum calculated in
> software, adding performance overhead
> - gso packets which can't be parsed get dropped
The biggest risk I see of valid packets reaching this path is packet
sockets that are not bound to a specific protocol (ETH_P_ALL) over a
non Ethernet device.
Iff proto is 0 we could try to infer from the first nibble at the
network header:
+ iph = (const void *)(skb->data + nhoff);
+ if (!proto) {
+ if (iph->version == 4)
+ proto = htons(ETH_P_IP);
+ else if (iph->version == 6)
+ proto = htons(ETH_P_IPV6);
+ }
Technical Details
Message-ID:
<willemdebruijn.kernel.18c52b086550a@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346867-linux-kernel-netdev=dewy.ruReferences:
<cover.1792067836.git.mst@redhat.com> <e66f7984fdeb8168e07fd7d0dad3deb8c30ead0a.1792067836.git.mst@redhat.com>Show 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-346867-linux-kernel-netdev=dewy.ru
From: willemdebruijn.kernel@gmail.com (Willem de Bruijn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 4/7] net: resolve uncommon partial checksums
at ingress
Date: Thu, 15 Oct 2026 14:07:38 -0400
Organization: Usenet Network
Message-ID: <willemdebruijn.kernel.18c52b086550a@gmail.com>
References: <cover.1792067836.git.mst@redhat.com>
<e66f7984fdeb8168e07fd7d0dad3deb8c30ead0a.1792067836.git.mst@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="2598824"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:OaVXGSLZKvNPgM7eEyVcDI6u4v4= sha256:awWGk6YRMY1Z2zteElAZ28jycaVZRUuZ51oZxLnhJRk=
sha1:LCyVLUJjBRQGV+sfsKA9aQUNMa8= sha256:+kKWutotn86hIBR8QLnfICbyNNvx9cESK/y8Xn+FTrU=
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 70233110398; Thu, 15 Oct 2026 22:01:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.047
X-Spam-Status: No, score=-3.047 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, FSL_HELO_FAKE=0.001,
HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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=gmail.com
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 CZGyrDfaiXPY;
Thu, 15 Oct 2026 22:00:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-346867-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id E72351101D8; Thu, 15 Oct 2026 22:00:48 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 8396F80B33; Thu, 15 Oct 2026 18:07:49 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id F25595625FE;
Thu, 15 Oct 2026 18:07:48 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a4z1QMg3"
X-Received: from mail-vk1-f176.google.com (mail-vk1-f176.google.com [209.85.221.176])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A61CD56E05E
for <netdev@vger.kernel.org>; Thu, 15 Oct 2026 18:07:40 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.176
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1792087668; cv=none; b=p6IToDZYBn8nsp21bHMPKfypD4O/3oFINHsGoqM9hn8IBjK32XOH440FrtwF3ZC/YloTTXCfr9+bUcAykF3TkHms3TdGwxs7j1fEZFMlyYwzu89ySVdpcTs9RK47yixna59uiy24JOqf2xAIamnfZHdwGyjVfDVRBc/2NZD15/c=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1792087668; c=relaxed/simple;
bh=xAk9jUZ4tHEIPjhowarDu1pLkojlKzRtPIaVJYJ41As=;
h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:
MIME-Version:Content-Type; b=fCnvD0sftR+/iMkJhC+XQtE1oW/bQBjNQSXRlJWeTe3qwozzzOmn9WcLK4t/7W+Cax6tM8kHR9fnbcIjMpLRofnf/MX7OEHzqJNaCaiGvYGGvjrl/u8AYa/8cRlQzQ5G3WE5t0JY46ORpAnwbw+SaSmok+MAEqckdLjrJTzUycQ=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=a4z1QMg3; arc=none smtp.client-ip=209.85.221.176
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-vk1-f176.google.com with SMTP id 71dfb90a1353d-5e94120191cso3559049e0c.0
for <netdev@vger.kernel.org>; Thu, 15 Oct 2026 11:07:40 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792087659; x=1792692459; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:mime-version:subject
:references:in-reply-to:message-id:cc:to:from:date:from:to:cc
:subject:date:message-id:reply-to:content-type;
bh=nq2p8yOce4bNMEA6ygRhHxutRNrExZqu0Cd/fcqSm44=;
b=a4z1QMg3lpDADkHZ0FctIrivV63CKx3EReOyWjA5oQvTVEfkTbINiZ0ckZZLvlXeD3
SU0Iy5oiPGh4EP+3rxENFq1QGaz5JQjhi3fscWCJhcN5UzhtNFAQvH6mJbvzFa6feFUI
PS4HZKyROvXdIGQ98gwjmL17bfLtiXCG7iqnc17e5zBBGQ9P3DGRUR6mvz0frntzWF2E
u8NjnM175NdKh4jhI0Ss/32vLg2bMJBImwVa4Mem0eu83UDTuc3A12iiWy2uKqG82muf
ZQIIFxHAjdmihHYPgvT1Sykr/GKoKvLGXkFFTf49z3fl4R2ScO9KLUE1HGeUIB6+KoEA
keow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792087659; x=1792692459;
h=content-transfer-encoding:content-type:mime-version:subject
:references:in-reply-to:message-id:cc:to:from:date:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=nq2p8yOce4bNMEA6ygRhHxutRNrExZqu0Cd/fcqSm44=;
b=gMYCG88Ucwv6ipiNGDtn/WmZZhLUxDMTu1c/n69trhPp2BBqXP4OFxPd2Ic1rSpYwD
NNYMjuSoEnqFJX1GOS10QSK5AueGjhdg+NL4n/6s7UXZKiocJop7/bgS/ZTQv+/K6OOs
x71Nfo0lDeM9copXqBfCEkJE2YMHbNPQezfSwvO7WLQIGm9H32cf6XjbW6ZzJFKbxT4i
uXG0zKdMCYXznmFP1nexei1OOCL9jbtBZKkAeX/BnM2j3OV/7bSfLy7P84Fj1QzyXaFC
FK8nB9b7o5DsxWIsoqFGy4NUUFpC8r49Q3QVR8QiXFWtFgm1dyRxd4BFrNhZTkeOJZ5q
qHhw==
X-Forwarded-Encrypted: i=1; AKwUvBznyPmf6KwbMRtWFwKmp1vjNCgYzQNdCx9OoYnxJ0EFe/S90rtMjEQ2Q+1PJOYa+rcGbl0W0q0=@vger.kernel.org
X-Gm-Message-State: AFq9FYLT6ju5kyP6ODYJSHkdgiewXw+OyfwpXuqDpnXF7E4cq6LS8kYn
9BtmSwCXw2qJrszIUNahKvj8D1F8Ri+1Rs/6yvXLCC6FihgD0e1tFgqX
X-Gm-Gg: AYBFou1Sot3YZj01cbRRD6vBSnmuZR8I1OnS2h09uK6gmeNO/C3kfdbOH9FvvLRMOGw
568Agl5FvKPtY7k3kRcOb/McpHB8wQQ3kP+wlqq0CFQXIGqvoR1k//UbblINNG86BZYmSUHA71q
kEP/0Y92ksBKjmAEF+yTogGygkCZ0fl7fwx6Iqs7X7pEh9E11t1u+yEJ2rQ+KRiWleazIDmB6U2
kDuO4FOUzMEcz4MpXItQBH5HjH5M4mFRihsAz9lYlIIUp7feR0bf3Y9l8ZuwOklk64TgYKPolFV
LgqkgYJCUzDKvIhJFSlGZwP6jgJcdgq85Uc3TxoPl6ToORNjgZF9GyQ3UQuxQYeGBVNT0Rxc7DI
py0RYeXlLcX+GZ3K98KAqxgK5daj8H4KFaO+mEBhdxj7667W6Ltbf0Q2GNi5Tye8UAy84jje2Zq
TaKfnlGvYgy2bwKTErYlJbK1414vTYSlS2ebiiHPYV1FpGXqLpP/fl7Z/QtTdAlBc7rHPC/gobd
p9vUdgSfeBeDnyPBl2TLDDGQxYRhWnwBKlV4+yRDfNl6fYXl7ku+UqLXyOjKH8xYOZe96VSZ7Cv
IW+eZxkOnJuX9OloJqV19YVmFPUXeATAtkx6rQ==
X-Received: by 2002:a05:6122:8b83:b0:5ea:389c:51e4 with SMTP id 71dfb90a1353d-5ea389c5604mr1033114e0c.2.1792087659373;
Thu, 15 Oct 2026 11:07:39 -0700 (PDT)
X-Received: from gmail.com (111.46.245.35.bc.googleusercontent.com. [35.245.46.111])
by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5ea99491db7sm304799e0c.10.2026.10.15.11.07.38
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 15 Oct 2026 11:07:38 -0700 (PDT)
X-Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Jason Wang <jasowangio@gmail.com>,
Eugenio PΓ©rez <eperezma@redhat.com>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org,
virtualization@lists.linux.dev,
Rusty Russell <rusty@rustcorp.com.au>,
Max Krasnyansky <maxk@qualcomm.com>,
Paulos Yibelo <habte.yibelo@gmail.com>,
Chris Arges <carges@cloudflare.com>
X-In-Reply-To: <e66f7984fdeb8168e07fd7d0dad3deb8c30ead0a.1792067836.git.mst@redhat.com>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>