net: hsr: require valid EOT supervision TLV
Subsystems (3)
PATCH v7 1/1 net: hsr: require valid EOT supervision TLV
From: Luka Gejak <[email protected]>
Supervision frames are only valid if terminated with a zero-length EOT TLV. The current check fails to reject non-EOT entries as the terminal TLV, potentially allowing malformed supervision traffic.
Fix this by strictly requiring the terminal TLV to be HSR_TLV_EOT with a length of zero.
---
Changes in v7:
- Send as standalone patch as other patch was moved to net. See NOTE.
NOTE: This patch was previously part of a net-next series and was seperated as requested by Jakub Kicinski. Link to the old series is [1]. [1]:https://lore.kernel.org/netdev/[email protected]/
net/hsr/hsr_forward.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/hsr/hsr_forward.c +1 -1
@@ -110,7 +110,7 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) }/* end of tlvs must follow at the end */ -if (hsr_sup_tlv->HSR_TLV_type ==HSR_TLV_EOT && +if (hsr_sup_tlv->HSR_TLV_type !=HSR_TLV_EOT || hsr_sup_tlv->HSR_TLV_length !=0 )return false;
Signature · 1 line
2.54.0
Quoted 11 lines · On 5/23/26 3:04 PM, [email protected] wrote:
From: Luka Gejak <[email protected]>
Supervision frames are only valid if terminated with a zero-length EOT TLV. The current check fails to reject non-EOT entries as the terminal TLV, potentially allowing malformed supervision traffic.
Fix this by strictly requiring the terminal TLV to be
HSR_TLV_EOTwith a length of zero.Assisted-by Gemini:Gemini-3.1-flashSigned-off-by Luka Gejak <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Sat, 23 May 2026 15:04:20 +0200 you wrote:
From: Luka Gejak <[email protected]>
Supervision frames are only valid if terminated with a zero-length EOT TLV. The current check fails to reject non-EOT entries as the terminal TLV, potentially allowing malformed supervision traffic.
Fix this by strictly requiring the terminal TLV to be
HSR_TLV_EOTwith a length of zero.[...]
Here is the summary with links:
- [net-next,v7] net: hsr: require valid EOT supervision TLV
https://git.kernel.org/netdev/net-next/c/46d111a3ef3b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html