public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND net-next 0/2] net_rwsem fixes
@ 2018-03-30 16:38 Kirill Tkhai
  2018-03-30 16:38 ` [PATCH RESEND net-next 1/2] net: Remove net_rwsem from {, un}register_netdevice_notifier() Kirill Tkhai
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kirill Tkhai @ 2018-03-30 16:38 UTC (permalink / raw)
  To: davem, zhangshengju, ktkhai, jakub.kicinski, dsahern, mschiffer,
	daniel, netdev

(Forgot to CC netdev@ :)

Hi,

there is wext_netdev_notifier_call()->wireless_nlevent_flush()
netdevice notifier, which takes net_rwsem, so we can't take
net_rwsem in {,un}register_netdevice_notifier().

Since {,un}register_netdevice_notifier() is executed under
pernet_ops_rwsem, net_namespace_list can't change, while we
holding it, so there is no need net_rwsem in these functions [1/2].

The same is in [2/2]. We make callers of __rtnl_link_unregister()
take pernet_ops_rwsem, and close the race with setup_net()
and cleanup_net(), so __rtnl_link_unregister() does not need it.
This also fixes the problem of that __rtnl_link_unregister() does
not see initializing and exiting nets.

Thanks,
Kirill
---

Kirill Tkhai (2):
      net: Remove net_rwsem from {,un}register_netdevice_notifier()
      net: Do not take net_rwsem in __rtnl_link_unregister()


 drivers/net/dummy.c      |    2 ++
 drivers/net/ifb.c        |    2 ++
 net/core/dev.c           |    5 -----
 net/core/net_namespace.c |    1 +
 net/core/rtnetlink.c     |    6 +++---
 5 files changed, 8 insertions(+), 8 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-01  2:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-30 16:38 [PATCH RESEND net-next 0/2] net_rwsem fixes Kirill Tkhai
2018-03-30 16:38 ` [PATCH RESEND net-next 1/2] net: Remove net_rwsem from {, un}register_netdevice_notifier() Kirill Tkhai
2018-03-30 16:38 ` [PATCH RESEND net-next 2/2] net: Do not take net_rwsem in __rtnl_link_unregister() Kirill Tkhai
2018-04-01  2:25 ` [PATCH RESEND net-next 0/2] net_rwsem fixes David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox