* [PATCH net] net: hsr: don't take the PRP RCT from host frame payloads
@ 2026-12-02 16:50 Andrew Stellman
0 siblings, 0 replies; only message in thread
From: Andrew Stellman @ 2026-12-02 16:50 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, Willem de Bruijn, Felix Maurer, Luka Gejak,
Fernando Fernandez Mancera, Shaurya Rane, Xin Xie, netdev
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-02 16:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 16:50 [PATCH net] net: hsr: don't take the PRP RCT from host frame payloads Andrew Stellman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox