Skip to content

Commit 6937180

Browse files
committed
wifi: mac80211: fix locking in auth/assoc timeout
If we hit an authentication or association timeout, we only release the chanctx for the deflink, and the other link(s) are released later by ieee80211_vif_set_links(), but we're not locking this correctly. Fix the locking here while releasing the channels and links. Change-Id: I9e08c1a5434592bdc75253c1abfa6c788f9f39b1 Fixes: 81151ce ("wifi: mac80211: support MLO authentication/association with one link") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 7a2c6d1 commit 6937180

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

net/mac80211/mlme.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3420,11 +3420,11 @@ static void ieee80211_destroy_auth_data(struct ieee80211_sub_if_data *sdata,
34203420
ieee80211_link_info_change_notify(sdata, &sdata->deflink,
34213421
BSS_CHANGED_BSSID);
34223422
sdata->u.mgd.flags = 0;
3423+
34233424
mutex_lock(&sdata->local->mtx);
34243425
ieee80211_link_release_channel(&sdata->deflink);
3425-
mutex_unlock(&sdata->local->mtx);
3426-
34273426
ieee80211_vif_set_links(sdata, 0);
3427+
mutex_unlock(&sdata->local->mtx);
34283428
}
34293429

34303430
cfg80211_put_bss(sdata->local->hw.wiphy, auth_data->bss);
@@ -3462,10 +3462,6 @@ static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata,
34623462
sdata->u.mgd.flags = 0;
34633463
sdata->vif.bss_conf.mu_mimo_owner = false;
34643464

3465-
mutex_lock(&sdata->local->mtx);
3466-
ieee80211_link_release_channel(&sdata->deflink);
3467-
mutex_unlock(&sdata->local->mtx);
3468-
34693465
if (status != ASSOC_REJECTED) {
34703466
struct cfg80211_assoc_failure data = {
34713467
.timeout = status == ASSOC_TIMEOUT,
@@ -3484,7 +3480,10 @@ static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata,
34843480
cfg80211_assoc_failure(sdata->dev, &data);
34853481
}
34863482

3483+
mutex_lock(&sdata->local->mtx);
3484+
ieee80211_link_release_channel(&sdata->deflink);
34873485
ieee80211_vif_set_links(sdata, 0);
3486+
mutex_unlock(&sdata->local->mtx);
34883487
}
34893488

34903489
kfree(assoc_data);

0 commit comments

Comments
 (0)