From: Andrew Stellman <bugs@stellman-greene.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
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
Subject: [PATCH net] net: hsr: don't take the PRP RCT from host frame payloads
Date: Wed, 2 Dec 2026 11:50:02 -0500 [thread overview]
Message-ID: <20261202165002.49988-1-bugs@stellman-greene.com> (raw)
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
reply other threads:[~2026-12-02 16:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261202165002.49988-1-bugs@stellman-greene.com \
--to=bugs@stellman-greene.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fmancera@suse.de \
--cc=fmaurer@redhat.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=luka.gejak@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ssrane_b23@ee.vjti.ac.in \
--cc=willemb@google.com \
--cc=xiexinet@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox