net: dsa: ksz: Check return value
[ Upstream commit 3d8fdcbf1f42e2bb9ae8b8c0b6f202278c788a22 ]
Return NULL if we got unexpected value from skb_trim_rcsum()
in ksz_common_rcv()
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: bafe9ba7d9
("net: dsa: ksz: Factor out common tag code")
Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20221201140032.26746-1-artem.chernyshev@red-soft.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2c6cf0afc3
commit
0834d4b121
@ -62,7 +62,8 @@ static struct sk_buff *ksz_common_rcv(struct sk_buff *skb,
|
||||
if (!skb->dev)
|
||||
return NULL;
|
||||
|
||||
pskb_trim_rcsum(skb, skb->len - len);
|
||||
if (pskb_trim_rcsum(skb, skb->len - len))
|
||||
return NULL;
|
||||
|
||||
skb->offload_fwd_mark = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user