aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-11-05 03:27:52 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-05 08:19:55 -0500
commit987c285c2ae2e4e32aca3a9b3252d28171c75711 (patch)
tree4002d4e6567005eb594b494c0e08424fa5eb2511 /net/mac80211
parentbca1e29fb54c51856dda6772d488d41b10ed91da (diff)
mac80211: sync acccess to tx_filtered/ps_tx_buf queues
These are accessed without a lock when ending STA PSM. If the sta_cleanup timer accesses these lists at the same time, we might crash. This may fix some mysterious crashes we had during ieee80211_sta_ps_deliver_wakeup. Cc: stable@vger.kernel.org Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/sta_info.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 797dd36a220d..89ccd3ec7eb8 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -961,6 +961,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
961 struct ieee80211_local *local = sdata->local; 961 struct ieee80211_local *local = sdata->local;
962 struct sk_buff_head pending; 962 struct sk_buff_head pending;
963 int filtered = 0, buffered = 0, ac; 963 int filtered = 0, buffered = 0, ac;
964 unsigned long flags;
964 965
965 clear_sta_flag(sta, WLAN_STA_SP); 966 clear_sta_flag(sta, WLAN_STA_SP);
966 967
@@ -976,12 +977,16 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
976 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { 977 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
977 int count = skb_queue_len(&pending), tmp; 978 int count = skb_queue_len(&pending), tmp;
978 979
980 spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags);
979 skb_queue_splice_tail_init(&sta->tx_filtered[ac], &pending); 981 skb_queue_splice_tail_init(&sta->tx_filtered[ac], &pending);
982 spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags);
980 tmp = skb_queue_len(&pending); 983 tmp = skb_queue_len(&pending);
981 filtered += tmp - count; 984 filtered += tmp - count;
982 count = tmp; 985 count = tmp;
983 986
987 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags);
984 skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending); 988 skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending);
989 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags);
985 tmp = skb_queue_len(&pending); 990 tmp = skb_queue_len(&pending);
986 buffered += tmp - count; 991 buffered += tmp - count;
987 } 992 }