diff mbox

mac80211: fix the kernel panic on ath_tx_aggr_wakeup on mesh

Message ID 1371803215-2685-1-git-send-email-yeohchunyeow@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Chun-Yeow Yeoh June 21, 2013, 8:26 a.m. UTC
The is to fix the kernel panic happens if user space inserts the mesh
STA and not proceed with the SAE and AMPE, and later the same mesh STA
is detected again. The sta_state of the mesh STA remains at
IEEE80211_STA_NONE and if the ieee80211_sta_ps_deliver_wakeup
is called and subsequently the ath_tx_aggr_wakeup, the kernel panic due
to ath_tx_node_init is not called before to initialize the require data
structures.

This issue is reported by Cedric Voncken before.
http://www.spinics.net/lists/linux-wireless/msg106342.html

[<831ea6b4>] ath_tx_aggr_wakeup+0x44/0xcc [ath9k]
[<83084214>] ieee80211_sta_ps_deliver_wakeup+0xb8/0x208 [mac80211]
[<830b9824>] ieee80211_mps_sta_status_update+0x94/0x108 [mac80211]
[<83099398>] ieee80211_sta_ps_transition+0xc94/0x34d8 [mac80211]
[<8022399c>] nf_iterate+0x98/0x104
[<8309bb60>] ieee80211_sta_ps_transition+0x345c/0x34d8 [mac80211]

Thomas Perdersen also mentioned that this patch has fixed the
bad sta magic warning in mac80211_hwsim_set_tim() when applied to
mac80211-next/master

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
 net/mac80211/mesh_ps.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Johannes Berg June 21, 2013, 8:48 p.m. UTC | #1
On Fri, 2013-06-21 at 16:26 +0800, Chun-Yeow Yeoh wrote:
> The is to fix the kernel panic happens if user space inserts the mesh
> STA and not proceed with the SAE and AMPE, and later the same mesh STA
> is detected again. The sta_state of the mesh STA remains at
> IEEE80211_STA_NONE and if the ieee80211_sta_ps_deliver_wakeup
> is called and subsequently the ath_tx_aggr_wakeup, the kernel panic due
> to ath_tx_node_init is not called before to initialize the require data
> structures.

I'd like to have a less ath9k-centric description, and particularly
subject, please.

> Thomas Perdersen

I think you misspelled that :)

> also mentioned that this patch has fixed the
> bad sta magic warning in mac80211_hwsim_set_tim() when applied to
> mac80211-next/master

"The bad sta magic warning"? That sounds like everyone should know about
that, but I don't think I do, or maybe it just slipped my mind?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chun-Yeow Yeoh June 24, 2013, 12:44 a.m. UTC | #2
> I'd like to have a less ath9k-centric description, and particularly
> subject, please.

Alright. But Bob has commented on this patch so may need to take
further investigation.

> I think you misspelled that :)

Opps....

----
Chun-Yeow
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/mesh_ps.c b/net/mac80211/mesh_ps.c
index 3b7bfc0..0e42758 100644
--- a/net/mac80211/mesh_ps.c
+++ b/net/mac80211/mesh_ps.c
@@ -251,7 +251,8 @@  void ieee80211_mps_sta_status_update(struct sta_info *sta)
 		mps_dbg(sta->sdata, "start PS buffering frames towards %pM\n",
 			sta->sta.addr);
 	} else {
-		ieee80211_sta_ps_deliver_wakeup(sta);
+		if (sta->sta_state >= IEEE80211_STA_ASSOC)
+			ieee80211_sta_ps_deliver_wakeup(sta);
 	}
 
 	/* clear the MPSP flags for non-peers or active STA */