diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-10-25 18:31:11 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-29 14:18:21 -0400 |
commit | 8c6e30936a7893a85f6222084f0f26aceb81137a (patch) | |
tree | 4130286b0162d3eb16d09286f6b254564faf3ec4 /drivers/net/wireless | |
parent | efec22b4689bbfdbed26367219e981fcc946b9a6 (diff) |
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 <nbd@openwrt.org>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 378bd70256b2..1ffca7511fa8 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -312,6 +312,7 @@ static struct ath_buf *ath_tx_get_buffer(struct ath_softc *sc) | |||
312 | } | 312 | } |
313 | 313 | ||
314 | bf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list); | 314 | bf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list); |
315 | bf->bf_next = NULL; | ||
315 | list_del(&bf->list); | 316 | list_del(&bf->list); |
316 | 317 | ||
317 | spin_unlock_bh(&sc->tx.txbuflock); | 318 | spin_unlock_bh(&sc->tx.txbuflock); |
@@ -1774,6 +1775,7 @@ static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, | |||
1774 | list_add_tail(&bf->list, &bf_head); | 1775 | list_add_tail(&bf->list, &bf_head); |
1775 | bf->bf_state.bf_type = 0; | 1776 | bf->bf_state.bf_type = 0; |
1776 | 1777 | ||
1778 | bf->bf_next = NULL; | ||
1777 | bf->bf_lastbf = bf; | 1779 | bf->bf_lastbf = bf; |
1778 | ath_tx_fill_desc(sc, bf, txq, fi->framelen); | 1780 | ath_tx_fill_desc(sc, bf, txq, fi->framelen); |
1779 | ath_tx_txqaddbuf(sc, txq, &bf_head, false); | 1781 | ath_tx_txqaddbuf(sc, txq, &bf_head, false); |