summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlan Tayari <ilant@mellanox.com>2016-09-18 10:42:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-10 11:26:04 +0300
commitbe9113b305e2b9a91fa6e9b47f1df29eef255fb0 (patch)
tree1c92333a14cd20db927ac2648bff2e2bc6ec9d12
parent38e6f8d468d5b6e08e4dba4f6065bf58182af2bf (diff)
downloadlinux-be9113b305e2b9a91fa6e9b47f1df29eef255fb0.tar.xz
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 <ilant@mellanox.com> Acked-by: Rami Rosen <roszenrami@gmail.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/xfrm/xfrm_state.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 787f2cac18c5..d3595f1d00f2 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -332,6 +332,7 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x)
{
tasklet_hrtimer_cancel(&x->mtimer);
del_timer_sync(&x->rtimer);
+ kfree(x->aead);
kfree(x->aalg);
kfree(x->ealg);
kfree(x->calg);