From: Edward Cree <ecree.xilinx@gmail.com>
To: Antoine Tenart <atenart@kernel.org>,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net] net: avoid race between device unregistration and set_channels
Date: Tue, 14 Jan 2025 10:09:07 +0000 [thread overview]
Message-ID: <8a1835db-b72c-4e9d-64e8-0bfffae2d8c8@gmail.com> (raw)
In-Reply-To: <20250113161842.134350-1-atenart@kernel.org>
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@gmail.com>
> Signed-off-by: Antoine Tenart <atenart@kernel.org>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
next prev parent reply other threads:[~2025-01-14 10:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 16:18 [PATCH net] net: avoid race between device unregistration and set_channels Antoine Tenart
2025-01-14 10:09 ` Edward Cree [this message]
2025-01-14 10:41 ` Antoine Tenart
2025-01-14 19:24 ` Jakub Kicinski
2025-01-15 2:51 ` Edward Cree
2025-01-15 9:41 ` Antoine Tenart
2025-01-15 11:04 ` Edward Cree
2025-01-15 11:12 ` Antoine Tenart
2025-01-15 9:39 ` Antoine Tenart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8a1835db-b72c-4e9d-64e8-0bfffae2d8c8@gmail.com \
--to=ecree.xilinx@gmail.com \
--cc=atenart@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.