All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] esp6: fix memleak on error path in esp6_input
@ 2018-06-27  3:49 Zhen Lei
  2018-06-27 15:51 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Zhen Lei @ 2018-06-27  3:49 UTC (permalink / raw
  To: Steffen Klassert, Herbert Xu, David S. Miller, Alexey Kuznetsov,
	Hideaki YOSHIFUJI, netdev, linux-kernel
  Cc: Zhen Lei, Hanjun Guo, Libin, YueHaibing

This ought to be an omission in e6194923237 ("esp: Fix memleaks on error
paths."). The memleak on error path in esp6_input is similar to esp_input
of esp4.

Fixes: e6194923237 ("esp: Fix memleaks on error paths.")
Fixes: 3f29770723f ("ipsec: check return value of skb_to_sgvec always")

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 net/ipv6/esp6.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 97513f3..88a7579 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -669,8 +669,10 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)

 	sg_init_table(sg, nfrags);
 	ret = skb_to_sgvec(skb, sg, 0, skb->len);
-	if (unlikely(ret < 0))
+	if (unlikely(ret < 0)) {
+		kfree(tmp);
 		goto out;
+	}

 	skb->ip_summed = CHECKSUM_NONE;

--
1.8.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] esp6: fix memleak on error path in esp6_input
  2018-06-27  3:49 [PATCH 1/1] esp6: fix memleak on error path in esp6_input Zhen Lei
@ 2018-06-27 15:51 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2018-06-27 15:51 UTC (permalink / raw
  To: Zhen Lei
  Cc: Herbert Xu, David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	netdev, linux-kernel, Hanjun Guo, Libin, YueHaibing

On Wed, Jun 27, 2018 at 11:49:28AM +0800, Zhen Lei wrote:
> This ought to be an omission in e6194923237 ("esp: Fix memleaks on error
> paths."). The memleak on error path in esp6_input is similar to esp_input
> of esp4.
> 
> Fixes: e6194923237 ("esp: Fix memleaks on error paths.")
> Fixes: 3f29770723f ("ipsec: check return value of skb_to_sgvec always")
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

Applied, thanks a lot for the fix!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-27 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-27  3:49 [PATCH 1/1] esp6: fix memleak on error path in esp6_input Zhen Lei
2018-06-27 15:51 ` Steffen Klassert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.