[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240424145002.GF42092@kernel.org>
Date: Wed, 24 Apr 2024 15:50:02 +0100
From: Simon Horman <horms@...nel.org>
To: Petr Machata <petrm@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, Ido Schimmel <idosch@...dia.com>,
Jiri Pirko <jiri@...nulli.us>, Alexander Zubkov <green@...tor.net>,
mlxsw@...dia.com
Subject: Re: [PATCH net 4/9] mlxsw: spectrum_acl_tcam: Fix possible
use-after-free during rehash
On Mon, Apr 22, 2024 at 05:25:57PM +0200, Petr Machata wrote:
> From: Ido Schimmel <idosch@...dia.com>
>
> The rehash delayed work migrates filters from one region to another
> according to the number of available credits.
>
> The migrated from region is destroyed at the end of the work if the
> number of credits is non-negative as the assumption is that this is
> indicative of migration being complete. This assumption is incorrect as
> a non-negative number of credits can also be the result of a failed
> migration.
>
> The destruction of a region that still has filters referencing it can
> result in a use-after-free [1].
>
> Fix by not destroying the region if migration failed.
>
> [1]
> BUG: KASAN: slab-use-after-free in mlxsw_sp_acl_ctcam_region_entry_remove+0x21d/0x230
...
> Fixes: c9c9af91f1d9 ("mlxsw: spectrum_acl: Allow to interrupt/continue rehash work")
> Signed-off-by: Ido Schimmel <idosch@...dia.com>
> Tested-by: Alexander Zubkov <green@...tor.net>
> Reviewed-by: Petr Machata <petrm@...dia.com>
> Signed-off-by: Petr Machata <petrm@...dia.com>
Reviewed-by: Simon Horman <horms@...nel.org>
...
Powered by blists - more mailing lists