diff options
author | Artem Chernyshev <artem.chernyshev@red-soft.ru> | 2022-12-01 15:00:31 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-12-03 05:46:52 +0100 |
commit | d4edb50688652eb10be270bc515da63815de428f (patch) | |
tree | b8b6d7d63316e346271ceaea6a006ee9a9c8b169 /net/dsa | |
parent | net: dsa: ksz: Check return value (diff) | |
download | linux-d4edb50688652eb10be270bc515da63815de428f.tar.xz linux-d4edb50688652eb10be270bc515da63815de428f.zip |
net: dsa: hellcreek: Check return value
Return NULL if we got unexpected value from skb_trim_rcsum()
in hellcreek_rcv()
Fixes: 01ef09caad66 ("net: dsa: Add tag handling for Hirschmann Hellcreek switches")
Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Link: https://lore.kernel.org/r/20221201140032.26746-2-artem.chernyshev@red-soft.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/tag_hellcreek.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dsa/tag_hellcreek.c b/net/dsa/tag_hellcreek.c index 846588c0070a..53a206d11685 100644 --- a/net/dsa/tag_hellcreek.c +++ b/net/dsa/tag_hellcreek.c @@ -49,7 +49,8 @@ static struct sk_buff *hellcreek_rcv(struct sk_buff *skb, return NULL; } - pskb_trim_rcsum(skb, skb->len - HELLCREEK_TAG_LEN); + if (pskb_trim_rcsum(skb, skb->len - HELLCREEK_TAG_LEN)) + return NULL; dsa_default_offload_fwd_mark(skb); |