[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKoUArkQE2keAsEwm87S7_BVtoog1DEZjhUs0U8o672mnMRf5Q@mail.gmail.com>
Date: Sun, 18 Sep 2016 20:39:41 +0300
From: Rami Rosen <roszenrami@...il.com>
To: Ilan Tayari <ilant@...lanox.com>
Cc: Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net] xfrm: Fix memory leak of aead algorithm name
Acked-by: Rami Rosen <roszenrami@...il.com>
On 18 September 2016 at 10:42, Ilan Tayari <ilant@...lanox.com> wrote:
> 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@...lanox.com>
> ---
> net/xfrm/xfrm_state.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> index 9895a8c..a30f898d 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);
> --
> 1.8.3.1
>
Powered by blists - more mailing lists