blob: ac57265eb9df7cc0e37b7f2b3b9452ca5e45e740 [file] [log] [blame]
From: Ilan Tayari <>
Date: Sun, 18 Sep 2016 07:42:53 +0000
Subject: xfrm: Fix memory leak of aead algorithm name
commit b588479358ce26f32138e0f0a7ab0678f8e3e601 upstream.
commit 1a6509d99122 ("[IPSEC]: Add support for combined mode algorithms")
introduced aead. The function attach_aead kmemdup()s the algorithm
name during xfrm_state_construct().
However this memory is never freed.
Implementation has since been slightly modified in
commit ee5c23176fcc ("xfrm: Clone states properly on migration")
without resolving this leak.
This patch adds a kfree() call for the aead algorithm name.
Fixes: 1a6509d99122 ("[IPSEC]: Add support for combined mode algorithms")
Signed-off-by: Ilan Tayari <>
Acked-by: Rami Rosen <>
Signed-off-by: Steffen Klassert <>
Signed-off-by: Ben Hutchings <>
net/xfrm/xfrm_state.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -339,6 +339,7 @@ static void xfrm_state_gc_destroy(struct
+ kfree(x->aead);