Skip to content

Commit c52666a

Browse files
egrumbachjmberg-intel
authored andcommitted
mac80211: fix suspend vs. association race
If the association is in progress while we suspend, the stack will be in a messed up state. Clean it before we suspend. This patch completes Johannes's patch: 1a1cb74 Author: Johannes Berg <johannes.berg@intel.com> mac80211: fix suspend vs. authentication race Cc: <stable@vger.kernel.org> Fixes: 12e7f51 ("mac80211: cleanup generic suspend/resume procedures") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent f9ac71b commit c52666a

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

‎net/mac80211/mlme.c‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,18 +3598,24 @@ void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata)
35983598

35993599
sdata_lock(sdata);
36003600

3601-
if (ifmgd->auth_data) {
3601+
if (ifmgd->auth_data || ifmgd->assoc_data) {
3602+
const u8 *bssid = ifmgd->auth_data ?
3603+
ifmgd->auth_data->bss->bssid :
3604+
ifmgd->assoc_data->bss->bssid;
3605+
36023606
/*
3603-
* If we are trying to authenticate while suspending, cfg80211
3604-
* won't know and won't actually abort those attempts, thus we
3605-
* need to do that ourselves.
3607+
* If we are trying to authenticate / associate while suspending,
3608+
* cfg80211 won't know and won't actually abort those attempts,
3609+
* thus we need to do that ourselves.
36063610
*/
3607-
ieee80211_send_deauth_disassoc(sdata,
3608-
ifmgd->auth_data->bss->bssid,
3611+
ieee80211_send_deauth_disassoc(sdata, bssid,
36093612
IEEE80211_STYPE_DEAUTH,
36103613
WLAN_REASON_DEAUTH_LEAVING,
36113614
false, frame_buf);
3612-
ieee80211_destroy_auth_data(sdata, false);
3615+
if (ifmgd->assoc_data)
3616+
ieee80211_destroy_assoc_data(sdata, false);
3617+
if (ifmgd->auth_data)
3618+
ieee80211_destroy_auth_data(sdata, false);
36133619
cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,
36143620
IEEE80211_DEAUTH_FRAME_LEN);
36153621
}

0 commit comments

Comments
 (0)