Commit ae028124 authored by Ilan Tayari's avatar Ilan Tayari Committed by Ben Hutchings

xfrm: Fix memory leak of aead algorithm name

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 avatarBen Hutchings <ben@decadent.org.uk>
parent 0f8ac3ee
......@@ -339,6 +339,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