Skip to contentSkip to conversation

xfrm: Fix xfrm_state_migrate leak

PATCH Applied Steffen Klassert 3 participants 3 messages Dec 7, 2010 – Dec 10, 2010

Subsystems (3)
lore
Share & tools
lore

Steffen Klassert

author maintainer
#0 lore raw

PATCH 1/1 xfrm: Fix xfrm_state_migrate leak

From: Thomas Egerer <[email protected]>

xfrm_state_migrate calls kfree instead of xfrm_state_put to free a failed state. According to git commit 553f9118 this can cause memory leaks.

---
 net/xfrm/xfrm_state.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/xfrm/xfrm_state.c +1 -1
index eb96ce5..220ebc0 100644
@@ -1268,7 +1268,7 @@ struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x,
 
 	return xc;
 error:
-	kfree(xc);
+	xfrm_state_put(xc);
 	return NULL;
 }
 EXPORT_SYMBOL(xfrm_state_migrate);
Signature · 1 line
1.7.0.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Steffen Klassert

From: Thomas Egerer <[email protected]>

xfrm_state_migrate calls kfree instead of xfrm_state_put to free a failed state. According to git commit 553f9118 this can cause memory leaks.

Good catch. Thanks!

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
maintainer Applied
#2 lore raw

From: Herbert Xu <[email protected]>
Date: Tue, 7 Dec 2010 17:31:57 +0800

Quoted 7 lines · Steffen Klassert
Quoted 6 lines

From: Thomas Egerer <[email protected]>

xfrm_state_migrate calls kfree instead of xfrm_state_put to free a failed state. According to git commit 553f9118 this can cause memory leaks.

Quoted 6 lines
Quoted 2 lines

Good catch. Thanks!

Applied, thanks.