]> git.baikalelectronics.ru Git - kernel.git/commit
mt76: fix potential NULL pointer dereference in mt76_stop_tx_queues
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Fri, 16 Nov 2018 16:19:21 +0000 (17:19 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 13 Dec 2018 14:19:56 +0000 (16:19 +0200)
commitedb3a9560e0c6668e8d47eaed70eec3c80bc5e62
tree6b6075993c567bed1b9dcb176e17769a805a5d19
parentdedfa690cd365b418866e84183db6be5af93e216
mt76: fix potential NULL pointer dereference in mt76_stop_tx_queues

Starting from mac80211 commit a3024ca15127 ("mac80211: add an optional
TXQ for other PS-buffered frames") and commit 73458fcb9377 ("mac80211:
add an option for station management TXQ") a new per-sta queue has been
introduced for bufferable management frames.
sta->txq[IEEE80211_NUM_TIDS] is initialized just if the driver reports
the following hw flags:
- IEEE80211_HW_STA_MMPDU_TXQ
- IEEE80211_HW_BUFF_MMPDU_TXQ
This can produce a NULL pointer dereference in mt76_stop_tx_queues
since mt76 iterates on all available sta tx queues assuming they are
initialized by mac80211. This issue has been spotted analyzing the code
(it has not triggered any crash yet)

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt76/tx.c