net: Hold rtnl_net_lock() in (un)?register_netdevice_notifier_dev_net().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Mon, 6 Jan 2025 07:07:51 +0000 (16:07 +0900)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Jan 2025 01:49:20 +0000 (17:49 -0800)
commit7fb1073300a2ea8bd03b2fc7d5a591192e48ea24
tree5c2c6425874b20a37352fd2bf2cba874fea33ee4
parentca779f40654a046613ea812126055f161844f17b
net: Hold rtnl_net_lock() in (un)?register_netdevice_notifier_dev_net().

(un)?register_netdevice_notifier_dev_net() hold RTNL before triggering
the notifier for all netdev in the netns.

Let's convert the RTNL to rtnl_net_lock().

Note that move_netdevice_notifiers_dev_net() is assumed to be (but not
yet) protected by per-netns RTNL of both src and dst netns; we need to
convert wireless and hyperv drivers that call dev_change_net_namespace().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250106070751.63146-4-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c