diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2024-11-07 16:48:15 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-11-11 17:26:51 -0800 |
commit | 6b57ff21a3109b1dba2d286ff415463e6fb1fca3 (patch) | |
tree | 422ce0bd4dd0ae915e044478a5fd83a1a5a2a977 /scripts/lib/kdoc/kdoc_parser.py | |
parent | d5ec8d91f82ef78405b506737952dec8af95a95b (diff) |
rtnetlink: Protect link_ops by mutex.
rtnl_link_unregister() holds RTNL and calls synchronize_srcu(),
but rtnl_newlink() will acquire SRCU frist and then RTNL.
Then, we need to unlink ops and call synchronize_srcu() outside
of RTNL to avoid the deadlock.
rtnl_link_unregister() rtnl_newlink()
---- ----
lock(rtnl_mutex);
lock(&ops->srcu);
lock(rtnl_mutex);
sync(&ops->srcu);
Let's move as such and add a mutex to protect link_ops.
Now, link_ops is protected by its dedicated mutex and
rtnl_link_register() no longer needs to hold RTNL.
While at it, we move the initialisation of ops->dellink and
ops->srcu out of the mutex scope.
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20241108004823.29419-3-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions