Message ID | 20221201140032.26746-1-artem.chernyshev@red-soft.ru (mailing list archive) |
---|---|
State | Accepted |
Commit | 3d8fdcbf1f42e2bb9ae8b8c0b6f202278c788a22 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v3,1/3] net: dsa: ksz: Check return value | expand |
On 12/1/2022 6:00 AM, Artem Chernyshev wrote: > 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>
Hello: This series was applied to netdev/net.git (master) by Jakub Kicinski <kuba@kernel.org>: On Thu, 1 Dec 2022 17:00:30 +0300 you wrote: > 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> > > [...] Here is the summary with links: - [v3,1/3] net: dsa: ksz: Check return value https://git.kernel.org/netdev/net/c/3d8fdcbf1f42 - [v3,2/3] net: dsa: hellcreek: Check return value https://git.kernel.org/netdev/net/c/d4edb5068865 - [v3,3/3] net: dsa: sja1105: Check return value https://git.kernel.org/netdev/net/c/8948876335b1 You are awesome, thank you!
diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index 38fa19c1e2d5..429250298ac4 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -21,7 +21,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);