projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
edf7284
)
net: dsa: ksz: Check return value
author
Artem Chernyshev
<artem.chernyshev@red-soft.ru>
Thu, 1 Dec 2022 14:00:30 +0000
(17:00 +0300)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:37:24 +0000
(11:37 +0100)
[ 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:
bafe9ba7d908
("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>
net/dsa/tag_ksz.c
patch
|
blob
|
history
diff --git
a/net/dsa/tag_ksz.c
b/net/dsa/tag_ksz.c
index
fa1d60d
..
6795dd0
100644
(file)
--- a/
net/dsa/tag_ksz.c
+++ b/
net/dsa/tag_ksz.c
@@
-22,7
+22,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;
dsa_default_offload_fwd_mark(skb);