mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-10-29 20:22:52 +10:00
net: dsa: tag_brcm: legacy: fix pskb_may_pull length
[ Upstream commitefdddc4484] 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:964dbf186e("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
82230d6f50
commit
1bcddbc388
@ -253,7 +253,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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user