xfrm: Fix memory leak of aead algorithm name
authorIlan Tayari <ilant@mellanox.com>
Sun, 18 Sep 2016 07:42:53 +0000 (07:42 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 Nov 2016 01:01:41 +0000 (01:01 +0000)
commit749d0c9720607e8c85dc0323659fde9a53cd2e1f
tree2a3acb1129baffe6283d6192e1f1d58fb4c16900
parent801cbc88bdfa268dcd888163e2983c802cbc853a
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: Ben Hutchings <ben@decadent.org.uk>
net/xfrm/xfrm_state.c