mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
wifi: cfg80211: restore netns_immutable on failures
Switching a wiphy's netns has to clear netns_immutable before moving
interfaces, but then if any of the interfaces fails to move, it gets
netns_immutable cleared forever. Then userspace can move it by itself,
breaking the assumption that they all move together.
Fix the order here and always reset netns_immutable after attempting
the move.
Assisted-by: LLM
Fixes: 463d018323 ("cfg80211: make aware of net namespaces")
Link: https://patch.msgid.link/20260904170220.7ea88157dcbc.Id868585a790be8b9ece9b39b0db464a5963faaf3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
6f0a100df8
commit
eeee52cfd1
|
|
@ -167,9 +167,9 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
|
|||
continue;
|
||||
wdev->netdev->netns_immutable = false;
|
||||
err = dev_change_net_namespace(wdev->netdev, net, "wlan%d");
|
||||
wdev->netdev->netns_immutable = true;
|
||||
if (err)
|
||||
break;
|
||||
wdev->netdev->netns_immutable = true;
|
||||
}
|
||||
|
||||
if (err) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user