From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796317384; b=SXN/cPZb2zQpedy4KZ5TPH2NnaCCW+9CLY9fzC1agE+WVkbWHIg5aG93ETny4fOwpOvo N5W0dhi+gBjOzpTSCYTuB33DT5U4yJTpPkGrNDywgyuEMEdoyiO2qdN5+VgvitSaMp2SV mvwypjTPLVTphE9lkwu/+D0T2I6yh7C4wRO3DkySBSQqjNaOcfsBWS0MXWYA7d3u3kBuv iA1UmuAsBaIMkJp23VrhETeVKyLs1hkdLozRq7h6kpRiR+Upe9t/6PDQPmhJw/oy0ZXe/ 1/bPlh3VJONai3+Wzx0i5yQCq+5hk977wZ7Lu+6srHAJKmGPYKOerMnPJGHXK5cmAAQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796317384; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=fNJeRWzi0Z6A142pK95m9+ue1eIBc+YFpsJrcAUAT6Y=; b=JeVb9IecPUB6VN1R7LSkriaHCusHpGg4gkbtvRjkSlkNK8SJ/DRxNeUEhw8i23Slz1fW e04NRL0oGiwUCHkBIU3atUmOj49oX2bzGE0lQq/tt/cTOYzKYuizFaDOoD7/TfE8zPO5M oMoeBmcqA/sQqD+iEMGyz3bHbEbtYBYDLPY9ekO5QjUpmC7j6P+BRQUeuZ+tqx1Xn3x1H gxwcgPyTepn5g+m8+8vzmnK1P+LLpJizdkedUwKyTpBdGiWFhkGf2Ga/8ywqyiFufCGBT EpxrlYjlN66lGjeFb69OOkFJWuLGl0lMW1spwHC73TmQg3HjlSxLsr53W62HQnqvT6Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=f++ljWEb; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A343606A333 for ; Thu, 3 Dec 2026 17:03:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=f++ljWEb Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56C361F00926; Thu, 3 Dec 2026 17:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796317384; bh=fNJeRWzi0Z6A142pK95m9+ue1eIBc+YFpsJrcAUAT6Y=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=f++ljWEbU98zBHZGluCV5onm61xQbw+aUpuYG4H9IhZfI3O1sqyDNljAHLdHC18OV bhWKXwPKWzEu9il2PhrBp62RzJ4kqNEri2xlYO8NKa5TdKtpYwWN9FamP5Hk+Gs+QE EzXNsIQneNLRsz3vYFA7GMrjSjeBH5lYYjUq/utArWxr0p7dfMAdszLgb5yOPxlmBO nRIimpgSu0jpVkQoHGCflTQyJYjizPNLXf0lfDf7MJwsvzVYbN5dWj6k6KywCRZh0h dFZ7M4U5Tx6cKoIKVDQgOk+mhusbLulbTkEqdwyTNu3+s7+bZPOhlwB4rXY6nib8yV Vn8ak3OOeThZQ== Subject: Re: [PATCH net] net: hsr: don't take the PRP RCT from host frame payloads From: netdev-bot+sashiko@kernel.org To: bugs@stellman-greene.com Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, willemb@google.com, fmaurer@redhat.com, luka.gejak@linux.dev, fmancera@suse.de, ssrane_b23@ee.vjti.ac.in, xiexinet@gmail.com, netdev@vger.kernel.org Date: Thu, 03 Dec 2026 17:03:02 +0000 Message-ID: <179631738292.3146.356916563895231141@kernel.org> In-Reply-To: <20261202165002.49988-1-bugs@stellman-greene.com> References: <20261202165002.49988-1-bugs@stellman-greene.com> X-sashiko-severity: High Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 1 · Medium: 0 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [High] The fix is incomplete. -- net: hsr: don't take the PRP RCT from host frame payloads prp_fill_frame_info() checks the end of every frame for a Redundancy Control Trailer, including frames sent through the PRP master. This patch skips that check for frames received on the master port, so a payload that happens to end in RCT-like bytes is no longer treated as an RCT. > diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c > index 44f6d9c83180a..6cec0d36e9e84 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; [Severity: High] Should HSR_PT_INTERLINK also be excluded here? In PRP RedBox mode, frames arriving on the interlink come from SANs. Like host frames, they have no RCT yet. They still go through this check, though. handle_std_frame() already treats master and interlink the same way, as ports whose frames get the local sequence number: net/hsr/hsr_forward.c:handle_std_frame() { ... if (port->type == HSR_PT_MASTER || port->type == HSR_PT_INTERLINK) { /* Sequence nr for the master/interlink node */ lockdep_assert_held(&hsr->seqnr_lock); frame->sequence_nr = hsr->sequence_nr; WRITE_ONCE(hsr->sequence_nr, hsr->sequence_nr + 1); } } hsr_handle_frame() also takes seqnr_lock around hsr_forward_skb() only for interlink frames, because those frames are supposed to get a locally assigned sequence number. Suppose a SAN on the interlink sends a frame whose last 6 bytes end in 0x88FB, with the LSDU size field equal to skb->len - 14 (or skb->len - 18 with a VLAN tag). That frame takes the skb_prp path: hsr_handle_frame() hsr_forward_skb() fill_frame_info() prp_fill_frame_info() frame->skb_prp = skb; frame->sequence_nr = prp_get_skb_sequence_nr(rct); The result is the same failure this patch fixes for the master port: - frame->sequence_nr comes from the SAN's payload. - hsr->sequence_nr is not advanced. - handle_std_frame() is skipped, so is_from_san stays false. prp_create_tagged_frame() then writes the LAN ID into the payload bytes in place before cloning: if (frame->skb_prp) { struct prp_rct *trailer = skb_get_PRP_rct(frame->skb_prp); if (trailer) { prp_set_lan_id(trailer, port); ... return skb_clone(frame->skb_prp, GFP_ATOMIC); So the frame goes out on LAN A/B with a changed payload and no real RCT. On local delivery, prp_get_untagged_frame() also trims the last 6 payload bytes. The new comment ("Host frames have no RCT yet, even if their payload looks like one") seems to apply just as well to SAN frames bridged from the interlink. Would a check like the following cover both cases? frame->port_rcv->type != HSR_PT_MASTER && frame->port_rcv->type != HSR_PT_INTERLINK The commit message also doesn't say why the interlink is left out. hsr_get_node() in net/hsr/hsr_framereg.c uses the same master-only rule. An interlink SAN whose payload looks like an RCT therefore gets recorded with san == false: rct = skb_get_PRP_rct(skb); if (!rct && rx_port != HSR_PT_MASTER) san = true; Should that be updated together with this check? -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202165002.49988-1-bugs%40stellman-greene.com