[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230717144946.26495-1-ruc_gongyuanjun@163.com>
Date: Mon, 17 Jul 2023 22:49:46 +0800
From: Yuanjun Gong <ruc_gongyuanjun@....com>
To: Yuanjun Gong <ruc_gongyuanjun@....com>,
Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
David Ahern <dsahern@...nel.org>,
netdev@...r.kernel.org
Subject: [PATCH 1/1] net: ipv6: check the return value of pskb_trim()
return an error number if an unexpected result is returned by
pskb_tirm() in esp_remove_trailer().
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@....com>
---
net/ipv6/esp6.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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];
--
2.17.1
Powered by blists - more mailing lists