linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: fix txq queue related crashes
@ 2016-01-21 13:23 Michal Kazior
  2016-01-21 13:23 ` [PATCH 2/2] mac80211: expose txq queue depth and size to drivers Michal Kazior
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Michal Kazior @ 2016-01-21 13:23 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Michal Kazior

The driver can access the queue simultanously
while mac80211 tears down the interface. Without
spinlock protection this could lead to corrupting
sk_buff_head and subsequently to an invalid
pointer dereference.

Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 net/mac80211/iface.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 33ae3c81bfc5..0451f120746e 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -977,7 +977,10 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 	if (sdata->vif.txq) {
 		struct txq_info *txqi = to_txq_info(sdata->vif.txq);
 
+		spin_lock_bh(&txqi->queue.lock);
 		ieee80211_purge_tx_queue(&local->hw, &txqi->queue);
+		spin_unlock_bh(&txqi->queue.lock);
+
 		atomic_set(&sdata->txqs_len[txqi->txq.ac], 0);
 	}
 
-- 
2.1.4


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

end of thread, other threads:[~2016-02-02 15:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21 13:23 [PATCH 1/2] mac80211: fix txq queue related crashes Michal Kazior
2016-01-21 13:23 ` [PATCH 2/2] mac80211: expose txq queue depth and size to drivers Michal Kazior
2016-01-26 10:45   ` Felix Fietkau
2016-01-26 11:56     ` Michal Kazior
2016-01-26 12:04       ` Felix Fietkau
2016-01-26 12:45         ` Michal Kazior
2016-01-26 12:56       ` Johannes Berg
2016-01-25 17:59 ` [PATCH 1/2] mac80211: fix txq queue related crashes Ben Greear
2016-01-26  6:35   ` Michal Kazior
2016-01-26 15:29     ` Ben Greear
2016-01-26 13:11 ` Johannes Berg
2016-01-27 14:26 ` [PATCH v2] mac80211: expose txq queue depth and size to drivers Michal Kazior
2016-01-27 14:26   ` Johannes Berg
2016-01-27 14:33     ` Michal Kazior
2016-01-27 14:36       ` Johannes Berg
2016-02-02 15:07   ` 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).