Commit 36f6e4b5 authored by Ilan Tayari's avatar Ilan Tayari Committed by Kleber Sacilotto de Souza

xfrm: Fix memory leak of aead algorithm name

BugLink: https://bugs.launchpad.net/bugs/1878232

commit b5884793 upstream.

commit 1a6509d9 ("[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 ee5c2317 ("xfrm: Clone states properly on migration")
without resolving this leak.
This patch adds a kfree() call for the aead algorithm name.

Fixes: 1a6509d9 ("[IPSEC]: Add support for combined mode algorithms")
Signed-off-by: default avatarIlan Tayari <ilant@mellanox.com>
Acked-by: default avatarRami Rosen <roszenrami@gmail.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent d607e3e8
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment