diff options
author | Ma Ke <make_ruc2021@163.com> | 2023-10-07 08:59:53 +0800 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2023-10-10 09:55:35 +0200 |
commit | dad4e491e30b20f4dc615c9da65d2142d703b5c2 (patch) | |
tree | be4e499190041579c228129658e00034d31f8636 /net/ipv6/esp6.c | |
parent | cc9b364bb1d58d3dae270c7a931a8cc717dc2b3b (diff) |
net: ipv6: fix return value check in esp_remove_trailer
In esp_remove_trailer(), to avoid an unexpected result returned by
pskb_trim, we should check the return value of pskb_trim().
Signed-off-by: Ma Ke <make_ruc2021@163.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv6/esp6.c')
-rw-r--r-- | net/ipv6/esp6.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index fddd0cbdede1..e023d29e919c 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -770,7 +770,9 @@ static inline int esp_remove_trailer(struct sk_buff *skb) skb->csum = csum_block_sub(skb->csum, csumdiff, skb->len - trimlen); } - pskb_trim(skb, skb->len - trimlen); + ret = pskb_trim(skb, skb->len - trimlen); + if (unlikely(ret)) + return ret; ret = nexthdr[1]; |