提交 b5884793 编写于 作者: I Ilan Tayari 提交者: Steffen Klassert

xfrm: Fix memory leak of aead algorithm name

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: NIlan Tayari <ilant@mellanox.com>
Acked-by: NRami Rosen <roszenrami@gmail.com>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
上级 1fb81e09
......@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册