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 <[email protected]>
---
V1->V2 Fixes for tag_hellcreek.c and tag_sja1105.c
V2->V3 Split patch in 3 separate parts
net/dsa/tag_hellcreek.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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);
--
2.30.3
On 12/1/2022 6:00 AM, Artem Chernyshev wrote:
> 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 <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
--
Florian
On Thu Dec 01 2022, Artem Chernyshev wrote:
> Return NULL if we got unexpected value from skb_trim_rcsum()
^ pskb_trim_rcsum()
> in hellcreek_rcv()
For the next time, a change log should rather explain *why* a change is
made instead of *what* the patch is doing.
Other than that,
Reviewed-by: Kurt Kanzenbach <[email protected]>