From: Andrew Stellman <aste…@stellman-greene.com>
prp_fill_frame_info() looks for an RCT at the end of every received
frame, including frames from the PRP master and the RedBox interlink.
If a payload ended in bytes that look like one, the master frame went
out 6 bytes shorter, with its payload changed and a sequence number
taken from it, and the interlink frame did not appear on slave egress
within a 15-second capture.
Skip RCT recognition on master and interlink ingress. Frames from
either port that already end in a valid RCT are now handled as
untagged frames, so that RCT is no longer reused.
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), this changelog with
OpenAI GPT-6 (Codex) and Claude Opus 5.5, and both were reviewed by me.
Fixes: 451d8123f897 ("net: prp: add packet handling support")
Fixes: 841afc9143ee ("net: hsr: add PRP interlink (RedBox) datapath and duplicate discard")
Suggested-by: Daniel Machon <dani…@microchip.com>
Signed-off-by: Andrew Stellman <aste…@stellman-greene.com>
---
v2: Also skip the check on the interlink port, as Daniel Machon
suggested. hsr_get_node() has the same test but only uses san for
LAN A and LAN B, so it is unchanged.
v1: https://lore.kernel.org/netdev/2026…@stellman-greene.com/
Tested on net 90ae4042bd9f (7.4.0-rc4), arm64 QEMU/HVF, generic KASAN:
both cases failed on base and passed with this fix.
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..86d72325afe3 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 &&
+ if (rct && frame->port_rcv->type != HSR_PT_MASTER &&
+ frame->port_rcv->type != HSR_PT_INTERLINK &&
prp_check_lsdu_size(skb, rct, frame->is_supervision)) {
frame->skb_hsr = NULL;
frame->skb_std = NULL;
--
2.53.0