Skip to content

Commit

Permalink
mac80211: fix suspend vs. association race
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Emmanuel Grumbach authored and Johannes Berg committed May 13, 2014
1 parent f9ac71b commit c52666a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -3598,18 +3598,24 @@ void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata)

sdata_lock(sdata);

if (ifmgd->auth_data) {
if (ifmgd->auth_data || ifmgd->assoc_data) {
const u8 *bssid = ifmgd->auth_data ?
ifmgd->auth_data->bss->bssid :
ifmgd->assoc_data->bss->bssid;

/*
* If we are trying to authenticate while suspending, cfg80211
* won't know and won't actually abort those attempts, thus we
* need to do that ourselves.
* If we are trying to authenticate / associate while suspending,
* cfg80211 won't know and won't actually abort those attempts,
* thus we need to do that ourselves.
*/
ieee80211_send_deauth_disassoc(sdata,
ifmgd->auth_data->bss->bssid,
ieee80211_send_deauth_disassoc(sdata, bssid,
IEEE80211_STYPE_DEAUTH,
WLAN_REASON_DEAUTH_LEAVING,
false, frame_buf);
ieee80211_destroy_auth_data(sdata, false);
if (ifmgd->assoc_data)
ieee80211_destroy_assoc_data(sdata, false);
if (ifmgd->auth_data)
ieee80211_destroy_auth_data(sdata, false);
cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,
IEEE80211_DEAUTH_FRAME_LEN);
}
Expand Down

0 comments on commit c52666a

Please sign in to comment.