wifi: ath9k: fix OOB access from firmware tx status queue ID
PATCH v2 1/1 wifi: ath9k: fix OOB access from firmware tx status queue ID
From: Tristan Madani <[email protected]>
ath_tx_edma_tasklet() accesses sc->tx.txq[ts.qid] where ts.qid is a 4-bit hardware field (0-15), but the txq array only has ATH9K_NUM_TX_QUEUES (10) entries. A qid >= 10 causes an OOB array access.
Add a bounds check on ts.qid before using it as an array index.
---
Note: v2 resubmission -- original sent via Gmail had HTML rendering issues. This version uses git send-email for plain-text formatting.
drivers/net/wireless/ath/ath9k/xmit.c | 5 +++++
1 file changed, 5 insertions(+)
drivers/net/wireless/ath/ath9k/xmit.c +5 -0
@@ -2755,6 +2755,11 @@ static void ath_tx_edma_tasklet(struct ath_softc *sc)continue ; } +if (ts.qid >=ATH9K_NUM_TX_QUEUES ) { +ath_dbg (common,XMIT ,"invalid qid %d\n" , ts.qid); +continue ; + } + txq = &sc->tx.txq[ts.qid];ath_txq_lock (sc, txq);
--
2.43.0
Quoted 11 lines · Tristan Madani
From: Tristan Madani <[email protected]>
ath_tx_edma_tasklet()accesses sc->tx.txq[ts.qid] where ts.qid is a 4-bit hardware field (0-15), but the txq array only hasATH9K_NUM_TX_QUEUES(10) entries. A qid >= 10 causes an OOB array access.Add a bounds check on ts.qid before using it as an array index.
Fixes fce041beb03f ("ath9k: unify edma and non-edma tx code, improve tx fifo handling")Signed-off-by Tristan Madani <[email protected]>
Jeff Johnson
AppliedQuoted 8 lines · Tristan Madani
ath_tx_edma_tasklet()accesses sc->tx.txq[ts.qid] where ts.qid is a 4-bit hardware field (0-15), but the txq array only hasATH9K_NUM_TX_QUEUES(10) entries. A qid >= 10 causes an OOB array access.Add a bounds check on ts.qid before using it as an array index.
[...]
Applied, thanks!
[1/1] wifi: ath9k: fix OOB access from firmware tx status queue ID
commit: 7ce2f118a2389e8f0a64068c6fe7cc7d40639be0
Best regards,
Signature · 1 line
Jeff Johnson <[email protected]>
Thanks for applying, Jeff.
Would you mind adding a Reported-by tag as well? I am both the finder and the fixer:
Best,
Tristan
Quoted 6 lines · Tristan Madani
Thanks for applying, Jeff.
Would you mind adding a Reported-by tag as well? I am both the finder and the fixer:
Reported-by Tristan Madani <[email protected]>
Unfortunately that is a public immutable branch so the commit can no longer be modified.
/jeff