2014-04-22 10:19:50

by Chun-Yeow Yeoh

[permalink] [raw]
Subject: [PATCH] mac80211: avoid handling of SMPS for mesh

The patch "mac80211: implement SMPS for AP" has caused kernel
oops at mesh STA if the peer mesh STA operates in sleep mode
and then becomes active mode. It can be easily reproduced by
setting the following commands at peer mesh STA:

iw mesh0 station set aa:bb:cc:dd:ee:ff mesh_power_mode deep
iw mesh0 station set aa:bb:cc:dd:ee:ff mesh_power_mode active

Kernel oops will happen at mesh STA aa:bb:cc:dd:ee:ff.

Fix this by avoiding SMPS for mesh mode.

Signed-off-by: Chun-Yeow Yeoh <[email protected]>
---
net/mac80211/sta_info.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 137a192..847d92f 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1148,7 +1148,8 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
atomic_dec(&ps->num_sta_ps);

/* This station just woke up and isn't aware of our SMPS state */
- if (!ieee80211_smps_is_restrictive(sta->known_smps_mode,
+ if (!ieee80211_vif_is_mesh(&sdata->vif) &&
+ !ieee80211_smps_is_restrictive(sta->known_smps_mode,
sdata->smps_mode) &&
sta->known_smps_mode != sdata->bss->req_smps &&
sta_info_tx_streams(sta) != 1) {
--
1.9.2



2014-04-22 14:39:10

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: avoid handling of SMPS for mesh

On Tue, 2014-04-22 at 18:19 +0800, Chun-Yeow Yeoh wrote:
> The patch "mac80211: implement SMPS for AP" has caused kernel
> oops at mesh STA if the peer mesh STA operates in sleep mode
> and then becomes active mode. It can be easily reproduced by
> setting the following commands at peer mesh STA:
>
> iw mesh0 station set aa:bb:cc:dd:ee:ff mesh_power_mode deep
> iw mesh0 station set aa:bb:cc:dd:ee:ff mesh_power_mode active
>
> Kernel oops will happen at mesh STA aa:bb:cc:dd:ee:ff.
>
> Fix this by avoiding SMPS for mesh mode.

Applied, thanks.

johannes