Message ID | 20230717144946.26495-1-ruc_gongyuanjun@163.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/1] net: ipv6: check the return value of pskb_trim() | expand |
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index fddd0cbdede1..81111ccadf34 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -770,7 +770,10 @@ 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); + if (pskb_trim(skb, skb->len - trimlen)) { + ret = -EINVAL; + goto out; + } ret = nexthdr[1];
return an error number if an unexpected result is returned by pskb_tirm() in esp_remove_trailer(). Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> --- net/ipv6/esp6.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)