Skip to content

Commit 8c6e309

Browse files
Felix Fietkaulinvjw
authored andcommitted
ath9k: fix stale pointers potentially causing access to free'd skbs
bf->bf_next is only while buffers are chained as part of an A-MPDU in the tx queue. When a tid queue is flushed (e.g. on tearing down an aggregation session), frames can be enqueued again as normal transmission, without bf_next being cleared. This can lead to the old pointer being dereferenced again later. This patch might fix crashes and "Failed to stop TX DMA!" messages. Signed-off-by: Felix Fietkau <[email protected]> Cc: [email protected] Signed-off-by: John W. Linville <[email protected]>
1 parent efec22b commit 8c6e309

File tree

1 file changed

+2
-0
lines changed
  • drivers/net/wireless/ath/ath9k

1 file changed

+2
-0
lines changed

drivers/net/wireless/ath/ath9k/xmit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ static struct ath_buf *ath_tx_get_buffer(struct ath_softc *sc)
312312
}
313313

314314
bf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list);
315+
bf->bf_next = NULL;
315316
list_del(&bf->list);
316317

317318
spin_unlock_bh(&sc->tx.txbuflock);
@@ -1774,6 +1775,7 @@ static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
17741775
list_add_tail(&bf->list, &bf_head);
17751776
bf->bf_state.bf_type = 0;
17761777

1778+
bf->bf_next = NULL;
17771779
bf->bf_lastbf = bf;
17781780
ath_tx_fill_desc(sc, bf, txq, fi->framelen);
17791781
ath_tx_txqaddbuf(sc, txq, &bf_head, false);

0 commit comments

Comments
 (0)