rpcd: iwinfo plugin fixes
[openwrt.git] / package / kernel / mac80211 / patches / 312-mac80211-fix-txq-queue-related-crashes.patch
1 From: Michal Kazior <michal.kazior@tieto.com>
2 Date: Thu, 21 Jan 2016 14:23:07 +0100
3 Subject: [PATCH] mac80211: fix txq queue related crashes
4
5 The driver can access the queue simultanously
6 while mac80211 tears down the interface. Without
7 spinlock protection this could lead to corrupting
8 sk_buff_head and subsequently to an invalid
9 pointer dereference.
10
11 Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation")
12 Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
13 ---
14
15 --- a/net/mac80211/iface.c
16 +++ b/net/mac80211/iface.c
17 @@ -977,7 +977,10 @@ static void ieee80211_do_stop(struct iee
18         if (sdata->vif.txq) {
19                 struct txq_info *txqi = to_txq_info(sdata->vif.txq);
20  
21 +               spin_lock_bh(&txqi->queue.lock);
22                 ieee80211_purge_tx_queue(&local->hw, &txqi->queue);
23 +               spin_unlock_bh(&txqi->queue.lock);
24 +
25                 atomic_set(&sdata->txqs_len[txqi->txq.ac], 0);
26         }
27