Article View: linux.kernel.netdev
Article #371Re: [PATCH net] ipv4: validate checksum_start before completing checksum
From: Willem de Bruijn
Date: Wed, 07 Oct 2026 23:36
Date: Wed, 07 Oct 2026 23:36
46 lines
11354 bytes
11354 bytes
On Wed, Oct 7, 2026 at 6:42 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> If a packet with bad checksum metadata gets into the ipv4 stack,
> skb_checksum_help can corrupt the network header and cause a bunch of
> mischief.
>
> This was discovered and reported by Paulos, and has been reporoduced
(minor) typo: reproduced
> by others independently since.
>
> We really shouldn't allow such packets in, but as a defence
> in depth measure, let's also check before we complete the checksum.
>
> A more complete validation at input is forthcoming, but needs more work.
>
> Assisted-by: LLM
> Fixes: f43798c27684 ("tun: Allow GSO using virtio_net_hdr")
> Fixes: bfd5f4a3d605 ("packet: Add GSO/csum offload support.")
> Reported-by: Paulos Yibelo <habte.yibelo@gmail.com>
> Closes: https://lore.kernel.org/netdev/20260922030310.8684-2-habte.yibelo@gmail.com/
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: stable@vger.kernel.org
Reviewed-by: Willem de Bruijn <willemb@google.com>
One point about sending as a single patch touching five separate
modules: nf_br_ip_fragment was only introduced in Linux 5.3.
Such a block is probably easily dropped from a stable backport.
A single patch is likely still preferable over splitting into two
(core + optional) or even five (one per module) patches.
> ---
>
> Lightly tested.
Tested by me as well and found to block the known bad input.
Touching five modules is not ideal, but could not find any other
approach that would be preferable: low risk of unintended
consequences, out of the hot path, and relatively concise.
Technical Details
Message-ID:
<CAF=yD-L_sv90qxUxEh6HRrz3mHMRP=WK3smkMMYScLAnJbgTpA@mail.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-342584-linux-kernel-netdev=dewy.ruReferences:
<0a012b4923e189c4c593ef4f471e5ff0edbe9030.1791412497.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-342584-linux-kernel-netdev=dewy.ru
From: willemdebruijn.kernel@gmail.com (Willem de Bruijn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] ipv4: validate checksum_start before completing checksum
Date: Wed, 7 Oct 2026 19:36:09 -0400
Organization: Usenet Network
Message-ID: <CAF=yD-L_sv90qxUxEh6HRrz3mHMRP=WK3smkMMYScLAnJbgTpA@mail.gmail.com>
References: <0a012b4923e189c4c593ef4f471e5ff0edbe9030.1791412497.git.mst@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="760369"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:e7X4StO/gwq012Cex4vbWKny+Qc= sha256:4gv5vicE+5VvTzCDxigoRFZb+YuQKXVr7nw3lzTqp8s=
sha1:7DTgJzMTsOfJ/g3C1BfldJFlpB8= sha256:0o6kyL+ByopDN1Clg5c9uqB/qPBoZSyFmDsqDo4Eqqk=
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 575C210F27B; Thu, 8 Oct 2026 02:36:57 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
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 ypRJtL3vh8TE;
Thu, 8 Oct 2026 02:36:54 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-342584-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 0329010F023; Thu, 8 Oct 2026 02:36:50 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by tor.lore.kernel.org (Postfix) with ESMTP id 749BB29E9D; Wed, 7 Oct 2026 23:36:49 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 14A2F367F5E;
Wed, 7 Oct 2026 23:36:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qSXDPnFz"
X-Received: from mail-yx1-f45.google.com (mail-yx1-f45.google.com [74.125.224.45])
(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 990A42BE639
for <netdev@vger.kernel.org>; Wed, 7 Oct 2026 23:36:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=74.125.224.45
X-ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791416209; cv=pass; b=q09i9YdyGgoyfhVjVmmh5cXAApMiUE0eEInOvuxLODhppjQG4CdNYwB9bcXpzswHERTAEFVVe81xMJH/vPUXylBQcjC4mETTjzlFNOw+NThbWISWau4PfweOufqjugttiChq5X662q9QIaIJKJClqUW0sBUdUN1qPiTF3QqZZvs=
X-ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791416209; c=relaxed/simple;
bh=YW7ppVeoRLVQCLnGvfkZ3DPxaXrIg4n4TYyY9tNYUuU=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=gRrxfFrSlizar7jHSVSsvS+rjBI1AxEcL7iumSUkkueKHpeb7leTeylMmIR2OouscaHGMxLUNTa1mIES6kWRPFhZInV2WMhU4YBFAzAxm1Yy+6d9WVZMsb1bqz5xd7G+QDY0fpjJKRcPpHp3rjJ+ehpUOJVFPzr7a/++5T/5X1o=
X-ARC-Authentication-Results: i=2; 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=qSXDPnFz; arc=pass smtp.client-ip=74.125.224.45
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-yx1-f45.google.com with SMTP id 956f58d0204a3-677bf06de21so4552643d50.3
for <netdev@vger.kernel.org>; Wed, 07 Oct 2026 16:36:47 -0700 (PDT)
X-ARC-Seal: i=1; a=rsa-sha256; t=1791416206; cv=none;
d=google.com; s=arc-20260327;
b=ZyUN4TA/P+a5FltirM+JnXEpUh6AAo5BdRNYE4u4uGRcAflBM9rKVeV2cvrCf99+Dd
FscDuxlsJJCqz3CFkOW9mM0D1v/Wfmp/OX8UjJJ2uoz06m4IyhtP2s78puOWedQRVkEc
xSYTFIYeNGizw0e3gbpOXVzN0UpvByDtk3VPuFCH6UZvjaxIfgcFQA/bRoWkMiwHjGmm
tvE8PitaY/UQe5oRyCbXwhnq6iFs2vQx6tPo6qu3SAK0+RveejVQ2elqcOWeYU2etV4T
/0rFAP3IMi2ghrh4wcff9jgo1EZRcnVSiROkSxB9CjfCeANSaGEWfkTSHehqpKiMd+ju
m/xg==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:dkim-signature;
bh=YW7ppVeoRLVQCLnGvfkZ3DPxaXrIg4n4TYyY9tNYUuU=;
fh=E/oLRROGr8rl83+936lMngF+qbYTPVrgxnG015hGaWg=;
b=bBFgJt8PflBoL/3NtHjOqjnnyjGV2v+tmQ8nSsKzbE4OuW1xRZbXmaTulKTlxfx7xW
qAmDsgDdDjWg6sVxqI00i/OIAXmbFnIXwhmJhv/CEoQIeTY0MHMUqWL43NnSMoUoRz0a
jvN6opS7hRwxuw0ZXrCIjG9ru4J2Tjv04xxyy1oytvrZ4rlRwnEirCZsHkBQ93PbG+j3
ykq+Us6OWLHM2pTQCL9+x0wF6JDR6FdDyY949pt4iKdhV/4KLQknnm4c2n8TycZG+oxU
S0ueyTNWzD10aH/utDj9Mi9q2QKa+CzO61fJ+VhcoUOICThFh/+ebPN/OohgOteXh7ds
KIkw==;
darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1791416206; x=1792021006; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=YW7ppVeoRLVQCLnGvfkZ3DPxaXrIg4n4TYyY9tNYUuU=;
b=qSXDPnFzOgu1X/v4N/tt4GN26skSKHLDR0E0tu7JR5k8wGhuC8zYDK2vhdNvk88i1A
I+Xyx6+Dh+AhvMnUF7ulNkD3qLEfXCV1xPEmVAkRRBrHsAdn9fecAo+HoGop13Yr1mwJ
wHHO7dqerVtI8ScFlq4mhdTKxthUvVYEVk0zHQz9beaEkWuB0T5h59+7b3xmkFanfK02
4N9iGuNMwiXgTs2lG8t7AOe6muH9E9eLWRr5hzPDCdb9qx/OnV/tgiBzWweGmUuiSObK
+GoXxtqqdIXOYahnOCJlS7vENi204Ob+SsyBFzoZoRMPQbeLf8AH9XZSjgPWK6s1yuf5
ARdA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1791416206; x=1792021006;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=YW7ppVeoRLVQCLnGvfkZ3DPxaXrIg4n4TYyY9tNYUuU=;
b=e4dzsMb5aZ4h6WAEMLu9zlLp+NMNYcd9XqiJbEF01cy+MgZM4w068/QSx0oeL6gfXP
z+zkm7t1swt9SVg0jpaLlp7Ts6I9SC1hEhSdks2yvOlGxlH8Nfui5sRUYGiITQNOpzIV
o8g1OwxJeJXiuVNI6C0QLqjje6UVmJBs2qe4OqOeIuSZIBkRCWwsHPjFnmBdABeC64iD
NwPlyf6ZD/aIzm10OFJ5+5v0wPzyxxoU08fa1Qqbl+y41mfgp3+Hl0j3Z465PuvjUG8c
/PR4BV8PuJW74xXrZzFMZiEFfGvarA16aVv+hHoS7kEcmD3uxVt2kjw7F5dnU2mrrOax
a1GA==
X-Forwarded-Encrypted: i=1; AKwUvBwhoy5QIZHGnZEHSI7VZBOwG5HF/75VOVoN+t4hOX0w1GQQ8e8mmGLnM5bPn0bzZhx9r7PtIoI=@vger.kernel.org
X-Gm-Message-State: AFq9FYLX4sT7qCz+9g/ctppJf+n4edhL73mlQBxRvmZR7U68ZbJp0Fxn
00htJN7N4/quy2IedZ1Q2snUm0CcrPxl8EFUlNrKBlsG8/9+NNyhe0MT030az1UThD09yKn8m1I
hbNKNUlA8ne43MOgfGI838FxpYICabkc=
X-Gm-Gg: AYBFou0DxBGOH6R3ixwUvXm1KF+i+XdAkBG7uHiGIMw4rUBZXFuTh81rWHYHnqQWugl
Ptgyr1+cwklxD4J8S/FtIsa7bT3qUU4DOUgheKPqd2NC/898HvMXi2P7Wi60TVqKWRp6iVgF4Pn
JxuvB9P+AJEnPAiYlax7nj10ZmwfW8gHHmOgOesIqpJ6mlf22nB7UA1vlgaHuW2K81Lbatz+Cj5
1D4g4BuImh+nZo9uap8mKeFHcHlLHKMlJz1HDUezINMo5HmazHPlOF7dLj2JISwIWcW51RxuS2I
+dfrWlBCY5EC2GTwr237aa4crp/F5nDCfQX/lYsbf5eqJRZuAaxJSqFS4f0+P/1oXy4G9fN+jJR
qrAvgX5OkilF0XKM01D1hLgQBP+OMX4xIBi3xxH+BrGXTvxo049H4+OlDPvbNmtWlluHpHVOY2R
k=
X-Received: by 2002:a05:690e:4853:b0:677:c24d:ebfa with SMTP id
956f58d0204a3-6790a3eaa26mr994855d50.58.1791416206358; Wed, 07 Oct 2026
16:36:46 -0700 (PDT)
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>
X-In-Reply-To: <0a012b4923e189c4c593ef4f471e5ff0edbe9030.1791412497.git.mst@redhat.com>
X-Gm-Features: AclHuK9jyyf5sYugVmTQQFcLaa4pyEtdizNnLZGPpZtB9PsCE0-Mfu-D4Td6hn0
X-Cc: linux-kernel@vger.kernel.org, David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Pablo Neira Ayuso <pablo@netfilter.org>, Florian Westphal <fw@strlen.de>,
Phil Sutter <phil@nwl.cc>, Nikolay Aleksandrov <razor@blackwall.org>,
Steffen Klassert <steffen.klassert@secunet.com>, Herbert Xu <herbert@gondor.apana.org.au>,
netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
coreteam@netfilter.org, bridge@lists.linux.dev