Skip to content
/ linux Public

Commit f6a620a

Browse files
jmberg-intelgregkh
authored andcommitted
wifi: mac80211: remove keys after disabling beaconing
[ Upstream commit 708bbb4 ] We shouldn't remove keys before disable beaconing, at least when beacon protection is used, since that would remove keys that are still used for beacon transmission at the same time. Stop before removing keys so there's no race. Fixes: af2d14b ("mac80211: Beacon protection using the new BIGTK (STA)") Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20260303150339.574e7887b3ab.I50d708f5aa22584506a91d0da7f8a73ba39fceac@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c2f6107 commit f6a620a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

net/mac80211/cfg.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,12 +1872,6 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
18721872

18731873
__sta_info_flush(sdata, true, link_id, NULL);
18741874

1875-
ieee80211_remove_link_keys(link, &keys);
1876-
if (!list_empty(&keys)) {
1877-
synchronize_net();
1878-
ieee80211_free_key_list(local, &keys);
1879-
}
1880-
18811875
ieee80211_stop_mbssid(sdata);
18821876
RCU_INIT_POINTER(link_conf->tx_bss_conf, NULL);
18831877

@@ -1889,6 +1883,12 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
18891883
ieee80211_link_info_change_notify(sdata, link,
18901884
BSS_CHANGED_BEACON_ENABLED);
18911885

1886+
ieee80211_remove_link_keys(link, &keys);
1887+
if (!list_empty(&keys)) {
1888+
synchronize_net();
1889+
ieee80211_free_key_list(local, &keys);
1890+
}
1891+
18921892
if (sdata->wdev.links[link_id].cac_started) {
18931893
chandef = link_conf->chanreq.oper;
18941894
wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work);

0 commit comments

Comments
 (0)