Article View: linux.kernel.netdev
Article #25887[PATCH net] net: hsr: don't take the PRP RCT from host frame payloads
From: Andrew Stellman
Date: Wed, 02 Dec 2026 16:50
Date: Wed, 02 Dec 2026 16:50
44 lines
12930 bytes
12930 bytes
From: Andrew Stellman <astellman@stellman-greene.com>
prp_fill_frame_info() looks for a Redundancy Control Trailer (RCT) at
the end of every frame, including frames sent through the PRP master.
If a UDP payload ends in bytes that look like an RCT, the frame goes
out with no new RCT, with the payload's sequence number and the LAN ID
written into the payload, and hsr->sequence_nr isn't advanced.
Skip the RCT check for frames received on the master port. Frames sent
through the master that already end in a valid RCT now get a second
RCT instead of having theirs reused.
Fixes: 451d8123f897 ("net: prp: add packet handling support")
Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
---
Tested on mainline 19cc08c1a6a6 (7.4.0-rc5) in arm64 QEMU with KASAN: a
UDP payload with such a tail went out as a 106-byte frame with a changed
payload before the fix, and as a 112-byte frame with the payload intact
with it.
Found with Quality Playbook
(https://github.com/andrewstellman/quality-playbook) running Claude Opus
5.5; the fix was drafted with OpenAI GPT-6 (Codex).
A reproducer is available on request.
net/hsr/hsr_forward.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index 44f6d9c83180..6cec0d36e9e8 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -682,7 +682,8 @@ int prp_fill_frame_info(__be16 proto, struct sk_buff *skb,
/* Supervision frame */
struct prp_rct *rct = skb_get_PRP_rct(skb);
- if (rct &&
+ /* Host frames have no RCT yet, even if their payload looks like one. */
+ if (rct && frame->port_rcv->type != HSR_PT_MASTER &&
prp_check_lsdu_size(skb, rct, frame->is_supervision)) {
frame->skb_hsr = NULL;
frame->skb_std = NULL;
--
2.53.0
Technical Details
Message-ID:
<20261202165002.49988-1-bugs@stellman-greene.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375941-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375941-linux-kernel-netdev=dewy.ru
From: bugs@stellman-greene.com (Andrew Stellman)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] net: hsr: don't take the PRP RCT from host frame payloads
Date: Wed, 2 Dec 2026 11:50:02 -0500
Organization: Usenet Network
Message-ID: <20261202165002.49988-1-bugs@stellman-greene.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2013551"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:HRGS01JkxvwrfWA5BgOEF3tMB24= sha256:nVyP+9Q0wkEUi1SZWKXAuorfyET+p+poeuWVAM51FbY=
sha1:OXU8Xcrfh/Im1XPLdigtcZ+TRp0= sha256:GUXvpdKeF8Xtdr7roByM/APxEUUhw+HsfUfaNqOzm60=
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 67A661176BE; Wed, 2 Dec 2026 19:50:42 +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 FoKtGcLK1R8A;
Wed, 2 Dec 2026 19:50:39 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-375941-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id D2C1B117634; Wed, 2 Dec 2026 19:50:30 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 3F2412B33D; Wed, 2 Dec 2026 16:50:17 +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=1796230205;
b=492ZwXaOCNW1pRF5sAakPgDyGllIhnRDwmt6bXnePAUG79aw1V21XPAUYK7HtgMA5khN
syHejrCtJOHhirnKLtOfpTUrxwERCSEU4r6oGJkWGCfmQId3l/TYQKLHGCdDke+2g/HSu
OXZLmtwS2LkKQdnzFv/8t9SOj/Bt5SivsvDsAdERVlV4btnRJg3yLBY2gX2WU34ZA260Q
CCLiKRVvG2JauM7B6RDePIODPA/s+d3GrKnW5Lf/cx2ivERDBpR6CNxwLeyaw7Dzg2lTH
b1Q6aT5lxj8J8PI3HDf5TFZmySruFdTHaIkMKq7EhApP91OY/31zWhXREpCweubKQeA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796230205;
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=prKr06LpFOIufV1E28DD7NyZNmLnVKxKz7kp/KBTHT4=;
b=OvOlKgwMq4hIBbnmiinvMOsjzYT7G14LdeafW/dHU5nGtwoTSfLIfeuqnG5BniL0wOlT
xh60FkrN+/lT4klhRZ+PPH8A2C566sj7ZCBZ2npKdUl85RfkOaHrjLqha9LW6zgwkCkdq
mR8UARLB+xctYlMof3zlfoem8X8q3VSV7lBhWYdlznqFLtf5kZXjgLNpHayOo+uCR7CHy
URoKxk74js5V3NNAFoWHmIMPExxDhzz3z8Nz0rFZr1WsSfdovCCBnuDMzILud2iM8ZAW5
PovopWRFinAnYMy4yIZ56OT90qnE9TYG7J+gAMpXUfqH0QiYMEJTdGWN+sIYVjP3BPg==
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="oT8z9xy/";
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 84AEC606A6B8;
Wed, 2 Dec 2026 16:50:05 +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=oT8z9xy/
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.169
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796230204;
b=Cu2IEFVT9o0F5JbzkUOuPKuRq/W4e0WOa+vbGIp0nKmGodkd9j8yoRoMRniy5EeiOqMw
83kdOyLZuJb+xTM4O+0jiGpamQ5n6AUthuDgc9ZfMrtSlu5So8F/YLUKggnBcLGMXpKjS
NdfWhRZHxvVUVYmjGYYgdXxwO2Tofn13M57rNtuTi+VyYz8oML3Za3v+G1wFtKHWsH1wk
ol68vM/+BVJHK2QZ22RCpmoBl++o/nKd92y+5ACmuyyws2de/hDTp43hfuz7HXb5QsDC2
g0G723FibEdeCZH+XBAqZLpFRG5vmZylcuqQwXEKHT7cuLrBdD0VkUKQ1I7AXA2Szew==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796230204;
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=prKr06LpFOIufV1E28DD7NyZNmLnVKxKz7kp/KBTHT4=;
b=2g6M4uUo4bzze6uLrVX5LSaEVuaxs4JGVAoP1d/7cBJbwksf2IJI8DLexhZE4M02KVC9
YPqrn+G5ufsPteDlFosliMEWnVxsoA7+0msY2SQrFsg6ZgyVFQ9wv7B4owWgY87sQbXpm
/4HwDIFqiZlvXf4CdvGaudZJ5HAGhbPHr6DdzL3e4n/OaVxyVRDhPmf8XUu/mG9goewBn
HR2VP/mB3fPwq7nsa9n4W5ih2OHkFHhI+NSe+DjugblHJyms97PVB46/K5/GtrfVBDCzT
emu44EMtKg3TBt3xdC/INtFCiDG2Yb9Td4exYmGJPJX8bUi8dqjs4gb1a83XEjn4RSQ==
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="oT8z9xy/";
arc=none smtp.remote-ip=209.85.160.169
X-Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169])
(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 5EF75606A6AC
for <netdev@vger.kernel.org>; Wed, 2 Dec 2026 16:50:04 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5EF75606A6AC
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-qt1-f169.google.com with SMTP id d75a77b69052e-55c48582654so145567181cf.0
for <netdev@vger.kernel.org>; Wed, 02 Dec 2026 08:50:04 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=stellman-greene-com.20260707.gappssmtp.com; s=20260707; t=1796230203; x=1796835003; 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=prKr06LpFOIufV1E28DD7NyZNmLnVKxKz7kp/KBTHT4=;
b=oT8z9xy/Pplyueh+/2LCy0qeXblwJjUFTQUM94MuS/mPr/vpqIB7sHcZukK3CchQax
ht8pOWK5nQviXE3n4N2zXLP1OxJdiL9O2dtUWDWJ40Au1uZsdLmsN9mzztpI7yz4e6BJ
8R3nK7VIdvkcWk52pgPz1lshpYX1/hobhRQK5z38oEk3nyKBlVp1mhzLtRf27fH+oMdl
D4JWqDLe45nKw7mzAsZCJ/ccirLkoH/iGOvcDxcoBg/D1ePQE5uwRZ2vNkKW7XkieV2J
h+cP+WTZujfE/wVH1jim7ci39xbRs4r8h2KXLC8tUYNxrszI002Vam6U8S9dytTcwZlB
KJCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796230203; x=1796835003;
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=prKr06LpFOIufV1E28DD7NyZNmLnVKxKz7kp/KBTHT4=;
b=Tc3Kd7mwE6D+rPRSGnutBvWKN+C/dPo5dSRU/PI44zdUifZf2p6+tA8TStDUvOcxhJ
H0ghxBs1jRcryJLcrw7WsRjKg6hRv4J5ZvpUeCersQGFKrYQrwPDDXbnmOJuCIg6hAp2
HtyHtt3Y+sNIsQ773/KBvWBHqGRvsdouGx49HgbWg66RtuTcn8txRnfepcCbwFdUkxQH
SPJDfdCPxnuRyaKA6nZ/ocYV3RmZu0s8JcrRbsTf8RCZMNDRn16nyUqhzkfLLmpDGK4y
bPr8HupxRqDEoLYt0qjAGg2mYZsWqoTJyVJG0OjLXMfZAh6ERLw9+YQOaZ+owDHdW0bf
mH8g==
X-Forwarded-Encrypted: i=1; AL+hErEnd5hMcYDW7KhZf6KbOr9WBdRfQ21p8+V/Vz5+kJbyRZluW87SpCCo7aCT7Zd3D5wzWa+g8Kk=@vger.kernel.org
X-Gm-Message-State: APuU4Z9nxbRwz0+VW/km7RGBiitBwrBRJv33llkFU0AjhHXUuBpyFeHi
pWW/djdZEae55O3i+d4yqTPGC7KuPQIkiWcxfrOIST+BH8Y/F3qqGpWkaGczrt3PynC9hmDTl4u
Oh0ae4uY=
X-Gm-Gg: AZFdTZddMHqHCO1blWtGDxCQS6zwDdGtGae4CaE/8UIfQ1VRA0GF8BsI6E6LTt3qAda
/OhenLzkK43EcM0BkyLWelZlDVWz2g3b0RKSl7K3X3DbMthRR9SicQpnPRX6zJpMbOMm2wCemU7
xfRoQih7mp6xHeDiVfIRq81XTM2evhHwcITmUd4uoc2XiS58O2zTOrDKx6M4EKld5zvsuoQR2cK
IR5qaiuqsraEGiYWfYLc4Sf4UfmpCFxq35TbkDQMrHpDt1IEVidI8pxtdde4rICkCNIdBRF/UhY
j0eoXzhLK03bQArmQ9PEXdOWhIhGHfEefCHCU+uzpHYTfqRIno3p92aWpI35onZsByvcD39S2lx
/SNOXBC1eqh625Gjt+Y1eY1iheig8pXuQTqYU2fPTXhQydqjGTJOQFLBkHRWk6wwqe293KtSjFt
aL9lXwmwQIqu3WucWS6gGIiPcFlFBZd+i2mfFbl1vkssff6XOra/sV0Zl3xa77WWoloKeGZsVY9
MEaEH07kpXfHmKM7SftEQs7G2qY9d0nUCgKADTT4fQ9FvVgoG2Gm6XfQEWNVZh2IdGEgiXEL7O1
+Gt7xW/8566aj/Vn46UuZ/3/RR5wk4AhDc+htSeVYIXslU8OnzIhF3EbjdyZA7JVFarwqJAbc6k
W
X-Received: by 2002:a05:622a:581a:b0:535:28bf:5561 with SMTP id d75a77b69052e-55d76994161mr772433751cf.6.1796230203427;
Wed, 02 Dec 2026 08:50:03 -0800 (PST)
X-Received: from Mac.mynetworksettings.com ([2600:4041:5c28:200:9fd:9761:5b78:f32c])
by smtp.gmail.com with ESMTPSA id d75a77b69052e-55d7882e32dsm345070891cf.13.2026.12.02.08.50.02
(version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
Wed, 02 Dec 2026 08:50:03 -0800 (PST)
X-Cc: Simon Horman <horms@kernel.org>,
Willem de Bruijn <willemb@google.com>,
Felix Maurer <fmaurer@redhat.com>,
Luka Gejak <luka.gejak@linux.dev>,
Fernando Fernandez Mancera <fmancera@suse.de>,
Shaurya Rane <ssrane_b23@ee.vjti.ac.in>,
Xin Xie <xiexinet@gmail.com>,
netdev@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