[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240424144916.GE42092@kernel.org>
Date: Wed, 24 Apr 2024 15:49:16 +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 3/9] mlxsw: spectrum_acl_tcam: Fix possible
use-after-free during activity update
On Mon, Apr 22, 2024 at 05:25:56PM +0200, Petr Machata wrote:
> From: Ido Schimmel <idosch@...dia.com>
>
> The rule activity update delayed work periodically traverses the list of
> configured rules and queries their activity from the device.
>
> As part of this task it accesses the entry pointed by 'ventry->entry',
> but this entry can be changed concurrently by the rehash delayed work,
> leading to a use-after-free [1].
>
> Fix by closing the race and perform the activity query under the
> 'vregion->lock' mutex.
>
> [1]
> BUG: KASAN: slab-use-after-free in mlxsw_sp_acl_tcam_flower_rule_activity_get+0x121/0x140
...
> Fixes: 2bffc5322fd8 ("mlxsw: spectrum_acl: Don't take mutex in mlxsw_sp_acl_tcam_vregion_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