[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231130174410.GJ32077@kernel.org>
Date: Thu, 30 Nov 2023 17:44:10 +0000
From: Simon Horman <horms@...nel.org>
To: Dinghao Liu <dinghao.liu@....edu.cn>
Cc: Saeed Mahameed <saeedm@...dia.com>, Leon Romanovsky <leon@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rahul Rameshbabu <rrameshbabu@...dia.com>,
Zhengchao Shao <shaozhengchao@...wei.com>,
Aya Levin <ayal@...dia.com>, Tariq Toukan <tariqt@...dia.com>,
netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [v2] net/mlx5e: fix a potential double-free in
fs_any_create_groups
On Tue, Nov 28, 2023 at 05:29:01PM +0800, Dinghao Liu wrote:
> When kcalloc() for ft->g succeeds but kvzalloc() for in fails,
> fs_any_create_groups() will free ft->g. However, its caller
> fs_any_create_table() will free ft->g again through calling
> mlx5e_destroy_flow_table(), which will lead to a double-free.
> Fix this by setting ft->g to NULL in fs_any_create_groups().
>
> Fixes: 0f575c20bf06 ("net/mlx5e: Introduce Flow Steering ANY API")
> Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
> ---
>
> Changelog:
>
> v2: Setting ft->g to NULL instead of removing the kfree().
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists