Skip to contentSkip to conversation

net: dsa: tag_brcm: legacy: fix pskb_may_pull length

PATCH Applied Álvaro Fernández Rojas 3 participants 3 messages May 29, 2025 – May 31, 2025

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

PATCH 1/1 net: dsa: tag_brcm: legacy: fix pskb_may_pull length

BRCM_LEG_PORT_ID was incorrectly used for pskb_may_pull length. The correct check is BRCM_LEG_TAG_LEN + VLAN_HLEN, or 10 bytes.

Fixes 964dbf186eaa ("net: dsa: tag_brcm: add support for legacy tags")
---
 net/dsa/tag_brcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/dsa/tag_brcm.c +1 -1
index 8c3c068728e5..fe75821623a4 100644
@@ -257,7 +257,7 @@ static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb,
 	int source_port;
 	u8 *brcm_tag;
 
-	if (unlikely(!pskb_may_pull(skb, BRCM_LEG_PORT_ID)))
+	if (unlikely(!pskb_may_pull(skb, BRCM_LEG_TAG_LEN + VLAN_HLEN)))
 		return NULL;
 
 	brcm_tag = dsa_etype_header_pos_rx(skb);
Signature · 1 line
2.39.5
#2 lore raw
In reply to Álvaro Fernández Rojas
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 8 lines · On Thu, 29 May 2025 14:44:06 +0200 you wrote:

BRCM_LEG_PORT_ID was incorrectly used for pskb_may_pull length. The correct check is BRCM_LEG_TAG_LEN + VLAN_HLEN, or 10 bytes.

Fixes 964dbf186eaa ("net: dsa: tag_brcm: add support for legacy tags")
---
 net/dsa/tag_brcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- net: dsa: tag_brcm: legacy: fix pskb_may_pull length

    https://git.kernel.org/netdev/net/c/efdddc448485

You are awesome, thank you!

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