mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
wifi: cfg80211: switch wiphy netns under cfg80211_mutex
Hold the cfg80211_mutex across the whole netns switch, so we can walk the wiphy list without worrying about a wiphy switching away to a different namespace underneath. This will allow removing RTNL from netlink dumps. Link: https://patch.msgid.link/20261011113308.89f391aea519.I7529b9055f522cfeb8a26ae3a85c1b71a98e8192@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
79976044e4
commit
9a8407984a
|
|
@ -171,6 +171,9 @@ static int __cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
|
|||
struct wireless_dev *wdev, *tmp;
|
||||
int err = 0;
|
||||
|
||||
/* make the whole switch atomic for cfg80211_mutex holders, e.g. dumps */
|
||||
guard(mutex)(&cfg80211_mutex);
|
||||
|
||||
list_for_each_entry_safe(wdev, tmp, &rdev->wiphy.wdev_list, list) {
|
||||
err = cfg80211_switch_wdev_netns(wdev, net);
|
||||
if (!err)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "reg.h"
|
||||
|
||||
|
||||
/* protects the wiphy list and regulatory state */
|
||||
/* protects the wiphy list, wiphy netns changes and regulatory state */
|
||||
extern struct mutex cfg80211_mutex;
|
||||
|
||||
#define WIPHY_IDX_INVALID -1
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user