312-mac80211-fix-txq-queue-related-crashes.patch 882 B

123456789101112131415161718192021222324252627
  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. The driver can access the queue simultanously
  5. while mac80211 tears down the interface. Without
  6. spinlock protection this could lead to corrupting
  7. sk_buff_head and subsequently to an invalid
  8. pointer dereference.
  9. Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation")
  10. Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
  11. ---
  12. --- a/net/mac80211/iface.c
  13. +++ b/net/mac80211/iface.c
  14. @@ -977,7 +977,10 @@ static void ieee80211_do_stop(struct iee
  15. if (sdata->vif.txq) {
  16. struct txq_info *txqi = to_txq_info(sdata->vif.txq);
  17. + spin_lock_bh(&txqi->queue.lock);
  18. ieee80211_purge_tx_queue(&local->hw, &txqi->queue);
  19. + spin_unlock_bh(&txqi->queue.lock);
  20. +
  21. atomic_set(&sdata->txqs_len[txqi->txq.ac], 0);
  22. }