[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220530103734.GD2517843@gauss3.secunet.de>
Date: Mon, 30 May 2022 12:37:34 +0200
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Hangyu Hua <hbh25y@...il.com>
CC: <herbert@...dor.apana.org.au>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] xfrm: xfrm_input: fix a possible memory leak in
xfrm_input()
On Mon, May 30, 2022 at 06:20:46PM +0800, Hangyu Hua wrote:
> xfrm_input needs to handle skb internally. But skb is not freed When
> xo->flags & XFRM_GRO == 0 and decaps == 0.
>
> Fixes: 7785bba299a8 ("esp: Add a software GRO codepath")
> Signed-off-by: Hangyu Hua <hbh25y@...il.com>
> ---
> net/xfrm/xfrm_input.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
> index 144238a50f3d..6f9576352f30 100644
> --- a/net/xfrm/xfrm_input.c
> +++ b/net/xfrm/xfrm_input.c
> @@ -742,7 +742,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
> gro_cells_receive(&gro_cells, skb);
> return err;
> }
> -
> + kfree_skb(skb);
> return err;
> }
Did you test this? The function behind the 'afinfo->the transport_finish()'
pointer handles this skb and frees it in that case.
Powered by blists - more mailing lists