[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8a1835db-b72c-4e9d-64e8-0bfffae2d8c8@gmail.com>
Date: Tue, 14 Jan 2025 10:09:07 +0000
From: Edward Cree <ecree.xilinx@...il.com>
To: Antoine Tenart <atenart@...nel.org>, davem@...emloft.net,
kuba@...nel.org, pabeni@...hat.com, edumazet@...gle.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net] net: avoid race between device unregistration and
set_channels
On 13/01/2025 16:18, Antoine Tenart wrote:
> This is because unregister_netdevice_many_notify might run before
> set_channels (both are under rtnl). When that happens, the rss lock is
> being destroyed before being used again. Fix this by destroying the rss
> lock in run_todo, outside an rtnl lock section and after all references
> to net devices are gone.
The latter (refs gone) being the important part? Doesn't seem
particularly relevant that we've dropped rtnl, this wording had me
confused for a little while as to why this closed the race.
> Note that allowing to run set_channels after the rtnl section of the
> unregistration path should be fine as it still runs before the
> destructors (thanks to refcount). This patch does not change that.
>
> Fixes: 87925151191b ("net: ethtool: add a mutex protecting RSS contexts")
> Cc: Edward Cree <ecree.xilinx@...il.com>
> Signed-off-by: Antoine Tenart <atenart@...nel.org>
Reviewed-by: Edward Cree <ecree.xilinx@...il.com>
Powered by blists - more mailing lists