Article View: linux.kernel.netdev
Article #23885[PATCH net] tipc: reject bundles too short for an inner header
From: Andrew Stellman
Date: Sat, 28 Nov 2026 14:08
Date: Sat, 28 Nov 2026 14:08
48 lines
13072 bytes
13072 bytes
From: Andrew Stellman <astellman@stellman-greene.com>
tipc_msg_extract() checks *pos against msg_data_sz(hdr) - MIN_H_SIZE.
msg_data_sz() is unsigned, so for a header-only MSG_BUNDLER, which
tipc_msg_validate() accepts, the subtraction wraps and the check
passes. The following msg_size(ihdr) then reads four bytes past the
end of the bundle. Check that the data can hold an inner header
before subtracting.
Tested on mainline (7cd8495c0f16) in arm64 QEMU with KASAN. A test-only
debugfs hook, not part of this patch, built a header-only bundle in the
kernel, passed it to tipc_msg_validate() and tipc_msg_extract(), and
poisoned 8 bytes of tailroom after it as a redzone so KASAN would flag
the read. No live TIPC link was used, and the bundle didn't come from a
peer. Without this patch KASAN reported a 4 byte read in
tipc_msg_extract() in both of two runs; with it, none in one run. A
bundle holding one valid 24 byte message was extracted the same way in
all three runs. No selftests were run.
Fixes: ef9be755697f ("tipc: eliminate buffer cloning in function tipc_msg_extract()")
Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
---
The issue was found by Claude Opus 5.5 running Quality Playbook, an
LLM-driven code review tool:
https://github.com/andrewstellman/quality-playbook
The fix was drafted with OpenAI GPT-6 (Codex) and this changelog with
Claude Opus 5.5, and both were reviewed by me.
A reproducer is available on request.
net/tipc/msg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 39dfd33c8eecc8..657c0709a0f7a1 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -600,7 +600,8 @@ bool tipc_msg_extract(struct sk_buff *skb, struct sk_buff **iskb, int *pos)
goto none;
hdr = buf_msg(skb);
- if (unlikely(*pos > (msg_data_sz(hdr) - MIN_H_SIZE)))
+ if (unlikely(msg_data_sz(hdr) < MIN_H_SIZE ||
+ *pos > (msg_data_sz(hdr) - MIN_H_SIZE)))
goto none;
ihdr = (struct tipc_msg *)(msg_data(hdr) + *pos);
Technical Details
Message-ID:
<20261128140830.58925-1-bugs@stellman-greene.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373148-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373148-linux-kernel-netdev=dewy.ru
From: bugs@stellman-greene.com (Andrew Stellman)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] tipc: reject bundles too short for an inner header
Date: Sat, 28 Nov 2026 09:08:30 -0500
Organization: Usenet Network
Message-ID: <20261128140830.58925-1-bugs@stellman-greene.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="962006"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:yAuu1mN9/EZJ1mK7Yurkbw8L4Lc= sha256:RESQXL9S6pHcMW26i3Yve2/q1/iLJ9Y1kIqHSs7trQw=
sha1:u2He468PovHvhUNFPU6JbAEgow0= sha256:3Zbc6VoKy3Yr1+tIoj6GjJhkI/9KzbpH5Jj/bfPD7+w=
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 457D7125F7D; Sat, 28 Nov 2026 17:08:53 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
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=stellman-greene-com.20260707.gappssmtp.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 oRnrg6oBUEkC;
Sat, 28 Nov 2026 17:08:49 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373148-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=stellman-greene.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id F0C8C125F79; Sat, 28 Nov 2026 17:08:40 +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 3EA87237D4; Sat, 28 Nov 2026 14:08:39 +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=1795874919;
b=W8rCmODdSE+b/pqqhAsKnAGnU7rqaP3YwHoRdJAmumHgAePywghRWRj5nmDGbmpfMz5O
mXDn4GbVF9CKYAVIAMBV/BwsOVLg1EpwtxeGj93s3bVMZ7SP4vfAtriCzedusLnXYc3rH
ZwckEEU5hZEqlIVph6K2CrEJZ9T8bHZEv1pu7u/4B7hyoamuMEpI5GfQ+Na2nR2AgD0Ip
k68Lea93h7TJl4i72pyxWyaJgXz86ucDRjZTgTkoZVzcxjaXK2xhyIbII85zIJP4YQ+y5
sqGxQoK46uCllsgufY7p2HKLz/A+lQeoW9+O+FuzKvu68rcRedJObM5CVqsl/1wGHVA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795874919;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received: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=y9d0KlkYkMPn1OGlex1T3FTiLNTnvIiCGzz3NKFSL5Q=;
b=i5/w/jtq4wa241QTaCMggIRKGpK3cpInw6PPyCj1rsvN9Pl+KdNHkye+RcmRxdVm77wr
rkK5n7JZeNJjhhleZTgtzWFXmyD6DJY8Gn/2j0tYmMnyZqvGmZyTfB62w/cVMbaGhhxyf
Yrw3YeKuYbk7WRQFSKOHYwDQC4M6Swb8Xln2Q49VSbut7GBvhoUaxWdq40QgaJKdlinsI
T5lk8xAN8Ek4YtV4KkbpgszMSLiCvSFvWHEe2s5IFGbyVXNN6cwRcu7sLbv7eVbd+f+d2
OjRaf+Q1vdmJ623comJJsMvLVZp71wxS4YE5/5+o6LiJUq7WNpLKTfbauuAeBTWIxyw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=stellman-greene-com.20260707.gappssmtp.com header.i=@stellman-greene-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=R2epY8c7;
dmarc=none header.from=stellman-greene.com;
spf=none smtp.mailfrom=stellman-greene.com;
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 0282C606A32A;
Sat, 28 Nov 2026 14:08:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=stellman-greene-com.20260707.gappssmtp.com header.i=@stellman-greene-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=R2epY8c7
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.171
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795874918;
b=sD4w56n2WbkcTnfEVqO/8guQc2uvQaj5JSiGDuKK3WUkumtB763kRj/DvSAQaqbMI/Ho
Y78/AJhM4ujiLXt0FgxtG+I1AqmuENHF36kHOn2Hzm8KLo3JDu4grneeace8edVuBfWEU
eFB+Q5si9BXGIjw6iFT3f3Xizq+o1YbfNqhkXE9yRvAnmhzgj+cj9227jnRrBoGtvVZ/N
AaUQNvr6EXaQwqZy/t4IsJXGGNXP6IWRbiDWBYL3ku3IrZ0QytRA9P6rv/IzyyATraUHQ
2buErJPuom++NuFbQhx9ujhcGGUEAdd4Y4gZAY84NzqfOyuraQTX6PfQb925X1rWFdQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795874918;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:
Content-Transfer-Encoding;
bh=y9d0KlkYkMPn1OGlex1T3FTiLNTnvIiCGzz3NKFSL5Q=;
b=vRG5ryhkSe3UBs5UgLJPNnYAe/fvlc8EY6SGz8zmgSq+mtVc+MXKZUesl8avMSa1aChr
Knqq+/mNsVSfx2KaxsN901X6ePUIlLa/7+gGX+3ZQcjo+NL5fWfy7htAT88LD1bzLodhq
7fX662W1BmPbJt3jlMGKaBLefX++9dTQhvCZ1QO2Shby7R3VnJ0eCvefnbw8RiAGk21Up
JwqLmFX/qSuoji34uzgdSHMlGu8JEgSHtbReezxmBYYmDhCQ9cglYjqGYuztH89WWnu+T
SlMnYaX0iEQ3FMh6xC7dpTvGBovH7mI8obZ7iGLp6VRbTu6wHA/lbwy0Ceo4mplnZeg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=stellman-greene.com;
spf=none smtp.mailfrom=stellman-greene.com;
dkim=pass header.d=stellman-greene-com.20260707.gappssmtp.com header.i=@stellman-greene-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=R2epY8c7;
arc=none smtp.remote-ip=209.85.128.171
X-Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4815606A31F
for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 14:08:37 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C4815606A31F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=stellman-greene.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=stellman-greene.com
X-Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-8b4cd576f2aso64661757b3.0
for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 06:08:37 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=stellman-greene-com.20260707.gappssmtp.com; s=20260707; t=1795874917; x=1796479717; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=y9d0KlkYkMPn1OGlex1T3FTiLNTnvIiCGzz3NKFSL5Q=;
b=R2epY8c7zatZG/RtMQ7ExJRvH9+vyyA2Z0aczkdjCHPzOeymu4tbOi+XPZOUhBAsbf
c1w3Pi29cXSWGFk0WlBMVw2OAyrtsGfIwQ2CjHCyRekc827nzxluaeXObjSBaYdP4Jx8
JhR3ixGFYw/8HUR/wVrYM/IjEgDHQrXSyvbsT+QCGgPoHJ8phpY5uGPxDvv8wzW5CUeA
WEUSqfXv/1MteZTIKHC68tPLkeOcBR/60PA/OwFusgXNIEwQj+ZvGHx6Sob0o4b9EDIH
8V7yYnVL125LpR0aSzazpGOp3gO/9FRTmdc9V8w3sNPwLq7V319kUsKhTcLfNvMs0ZTQ
DNDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795874917; x=1796479717;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=y9d0KlkYkMPn1OGlex1T3FTiLNTnvIiCGzz3NKFSL5Q=;
b=LQZKI+SqQrAf3kDjDNlr73UVlUJwvt9ba0DGIFrcmpQ7vabqSQoRh0kR9LlGz7IJV/
WBL2R6sIHBQ8rvfHoUCz/aqlMB/QeEDglCjZiicRNkTmXCaharP8B1tq3wNQ4n0TZiUL
uZrdkTM6AiVtl0eqoccOxrAXmVgcwscBBM4/7DsMc5uLWGEAIppMY1HpOX8oBRSwZbs0
oWLvdJtUZezmqqF3abO2dUJjM8TX5aehSifRjfyuYmeZyykiiDzLbhCMuIj3I3EWoWLI
8yZ9plZM2P2llQn19BuqaJIu4icYm263Iiw+JLZY311Ce0kG+9ng2HfrvDBRrgEP8gTH
vSGA==
X-Forwarded-Encrypted: i=1; AL+hErGO3tqAy2I05eH3SS1lhpE6t4eGLNtvx5GmCI9CAYcNDLjKqVxGCVt2H0iEwekGb/rVsrG/kPI=@vger.kernel.org
X-Gm-Message-State: APuU4Z+ImsExDg+LbD0wwSp07MMwB+mSBz7PNaO9WKimLY0lIDutuaST
QpSgBbDGpyo+G0aIG9Jgjp2vVWnQvoBsbyFQX+x8w/p0EnugPvfcGEPUpatxBIyN2iY=
X-Gm-Gg: AZFdTZfJ06oyxJ0tuC33XMgwcqd26NJmfa1puDQbjpe3MZ3KlAeQCVIMntfdNJTW/5D
2dBKvHS/YNtBvi52bGNc3Uxug0F5SQ65ojkwU7Li6KfivcvPX7kuL8gKft9Ve25JeOmg25Xj3cS
8JvYT2NQOf5yiYO/ik9GckPBLJHCTlkYY5HNyMNgdT/hfkQ552MinwtKCLEQZf/UfWnkGLxwB+h
SFmslm2NB/RtwgjzkUBEPgCu1ZU+I3BKQRD0A5rom7FN8axXSvodckcXS2gisbx1O6tT6YHh3gl
njw1DSvRMfraZwES5YQaORk1ngiaUqbzsnE4jj5M4z0xMGY6gIc2R+xvIEaRXHeB0Wt5pfxNzYO
zadSGRMID7IXVre/agUmlYOmTvcP9OOKCfY4TW+sPIyf54+A11C5XCfNLDaGAtZibMQZPSJ5oYQ
XvPpEO0pUOapSr3eUCCjmSSUsnJ9U4nE8fcKzfcsfINHU5IuZyoG0Djt1bdWpVCT4WU/desEqU4
UguvSyApi1V4Dv/jyMnyscfo2OdptVc1uMBxIaDmCNp6GedusMcYbSEOcJqyECHyq9JIR1I8sKY
Pj4rC2DBl2U8CP3R2NdY/DWzsvc6Efxzuso14TdwkllL08oDUoCvRMxr3vTsNAILtr/RDSFCOW7
H852AB7Y3jLYSVivHaUQ81zU=
X-Received: by 2002:a05:690c:e3d2:b0:873:5c0f:27c with SMTP id 00721157ae682-8b5204ad248mr121148297b3.38.1795874916722;
Sat, 28 Nov 2026 06:08:36 -0800 (PST)
X-Received: from Mac.mynetworksettings.com ([2600:4041:5c28:200:a4e3:fb15:aef5:60c7])
by smtp.gmail.com with ESMTPSA id af79cd13be357-949bb418241sm2050564885a.38.2026.11.28.06.08.36
(version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
Sat, 28 Nov 2026 06:08:36 -0800 (PST)
X-Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org,
tipc-discussion@lists.sourceforge.net,
linux-kernel@vger.kernel.org
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