]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: dsa: tag_brcm: legacy: fix pskb_may_pull length
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Thu, 29 May 2025 12:44:06 +0000 (14:44 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 31 May 2025 02:20:18 +0000 (19:20 -0700)
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")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20250529124406.2513779-1-noltari@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/tag_brcm.c

index 8c3c068728e51c38d68d8a90e1b75601c40f1392..fe75821623a4fca2f57fc7051acd821461e4a657 100644 (file)
@@ -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);