Skip to contentSkip to conversation

net: bridge: mrp: fix Option TLV length in MRP_Test frames

PATCH Applied David Corvaglia 3 participants 3 messages Jul 26 – Jul 27

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: bridge: mrp: fix Option TLV length in MRP_Test frames

oui is a pointer, so sizeof(oui) is the pointer size. The MRA Option TLV thus advertises a wrong length (15 vs 10 on x86_64), causing misparsing of the frame on peers. Fix is to replace with sizeof(*oui).

Fixes f7458934b079 ("net: bridge: mrp: Update the Test frames for MRA")

---
v2: target net and add Fixes header
v1: https://lore.kernel.org/bridge/[email protected]/

---
 net/bridge/br_mrp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_mrp.c +1 -1
index 3f7126a7d720..179d2470b724 100644
@@ -215,7 +215,7 @@ static struct sk_buff *br_mrp_alloc_test_skb(struct br_mrp *mrp,
 		struct br_mrp_oui_hdr *oui = NULL;
 		u8 length;
 
-		length = sizeof(*sub_opt) + sizeof(*sub_tlv) + sizeof(oui) +
+		length = sizeof(*sub_opt) + sizeof(*sub_tlv) + sizeof(*oui) +
 			MRP_OPT_PADDING;
 		br_mrp_skb_tlv(skb, BR_MRP_TLV_HEADER_OPTION, length);
 
Signature · 1 line
2.55.0
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 30 lines · David Corvaglia

oui is a pointer, so sizeof(oui) is the pointer size. The MRA Option TLV thus advertises a wrong length (15 vs 10 on x86_64), causing misparsing of the frame on peers. Fix is to replace with sizeof(*oui).

Fixes f7458934b079 ("net: bridge: mrp: Update the Test frames for MRA")

---
v2: target net and add Fixes header
v1: https://lore.kernel.org/bridge/[email protected]/

---
 net/bridge/br_mrp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_mrp.c +1 -1
index 3f7126a7d720..179d2470b724 100644
@@ -215,7 +215,7 @@ static struct sk_buff *br_mrp_alloc_test_skb(struct br_mrp *mrp,
 		struct br_mrp_oui_hdr *oui = NULL;
 		u8 length;
 
-		length = sizeof(*sub_opt) + sizeof(*sub_tlv) + sizeof(oui) +
+		length = sizeof(*sub_opt) + sizeof(*sub_tlv) + sizeof(*oui) +
 			MRP_OPT_PADDING;
 		br_mrp_skb_tlv(skb, BR_MRP_TLV_HEADER_OPTION, length);
 
Signature · 1 line
2.55.0
#2 lore raw
In reply to David Corvaglia
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Sun, 26 Jul 2026 06:26:05 +0000 you wrote:

oui is a pointer, so sizeof(oui) is the pointer size. The MRA Option TLV thus advertises a wrong length (15 vs 10 on x86_64), causing misparsing of the frame on peers. Fix is to replace with sizeof(*oui).

Fixes f7458934b079 ("net: bridge: mrp: Update the Test frames for MRA")

[...]

Here is the summary with links:
- [net,v2] net: bridge: mrp: fix Option TLV length in MRP_Test frames

    https://git.kernel.org/netdev/net/c/5546da86894d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html