linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix suspend vs. association race
@ 2014-05-13  9:54 Emmanuel Grumbach
  2014-05-13 10:08 ` Johannes Berg
  2014-05-13 11:59 ` Johannes Berg
  0 siblings, 2 replies; 3+ messages in thread
From: Emmanuel Grumbach @ 2014-05-13  9:54 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Emmanuel Grumbach, stable

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:

1a1cb744de160ee70086a77afff605bbc275d291
Author: Johannes Berg <johannes.berg@intel.com>

    mac80211: fix suspend vs. authentication race

Cc: <stable@vger.kernel.org>
Fixes: 12e7f517029d ("mac80211: cleanup generic suspend/resume procedures")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/mlme.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 139005d..5e4f7ea 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3600,7 +3600,7 @@ void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata)
 
 	sdata_lock(sdata);
 
-	if (ifmgd->auth_data) {
+	if (ifmgd->auth_data || ifmgd->assoc_data) {
 		/*
 		 * If we are trying to authenticate while suspending, cfg80211
 		 * won't know and won't actually abort those attempts, thus we
@@ -3611,7 +3611,10 @@ void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata)
 					       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);
 	}
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: fix suspend vs. association race
  2014-05-13  9:54 [PATCH] mac80211: fix suspend vs. association race Emmanuel Grumbach
@ 2014-05-13 10:08 ` Johannes Berg
  2014-05-13 11:59 ` Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2014-05-13 10:08 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: linux-wireless

On Tue, 2014-05-13 at 12:54 +0300, Emmanuel Grumbach wrote:
> 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:
> 
> 1a1cb744de160ee70086a77afff605bbc275d291
> Author: Johannes Berg <johannes.berg@intel.com>
> 
>     mac80211: fix suspend vs. authentication race
> 
> Cc: <stable@vger.kernel.org>
> Fixes: 12e7f517029d ("mac80211: cleanup generic suspend/resume procedures")
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Applied, thanks.

johannes


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: fix suspend vs. association race
  2014-05-13  9:54 [PATCH] mac80211: fix suspend vs. association race Emmanuel Grumbach
  2014-05-13 10:08 ` Johannes Berg
@ 2014-05-13 11:59 ` Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2014-05-13 11:59 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: linux-wireless, stable

On Tue, 2014-05-13 at 12:54 +0300, Emmanuel Grumbach wrote:
> 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:
> 
> 1a1cb744de160ee70086a77afff605bbc275d291
> Author: Johannes Berg <johannes.berg@intel.com>
> 
>     mac80211: fix suspend vs. authentication race
> 
> Cc: <stable@vger.kernel.org>
> Fixes: 12e7f517029d ("mac80211: cleanup generic suspend/resume procedures")
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> ---
>  net/mac80211/mlme.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 139005d..5e4f7ea 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -3600,7 +3600,7 @@ void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata)
>  
>  	sdata_lock(sdata);
>  
> -	if (ifmgd->auth_data) {
> +	if (ifmgd->auth_data || ifmgd->assoc_data) {

This can crash if auth_data is NULL (but we use it to build the deauth)
- I'm rolling in a fix for that.

johannes


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-13 12:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13  9:54 [PATCH] mac80211: fix suspend vs. association race Emmanuel Grumbach
2014-05-13 10:08 ` Johannes Berg
2014-05-13 11:59 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).