Patch "wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-ath9k-fix-potential-array-index-out-of-bounds-r.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c12fc9af09ac65e7f207b903b7aed4c0bbe190f4
Author: Minsuk Kang <linuxlovemin@xxxxxxxxxxxx>
Date:   Wed Nov 22 20:31:04 2023 +0200

    wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus()
    
    [ Upstream commit 2adc886244dff60f948497b59affb6c6ebb3c348 ]
    
    Fix an array-index-out-of-bounds read in ath9k_htc_txstatus(). The bug
    occurs when txs->cnt, data from a URB provided by a USB device, is
    bigger than the size of the array txs->txstatus, which is
    HTC_MAX_TX_STATUS. WARN_ON() already checks it, but there is no bug
    handling code after the check. Make the function return if that is the
    case.
    
    Found by a modified version of syzkaller.
    
    UBSAN: array-index-out-of-bounds in htc_drv_txrx.c
    index 13 is out of range for type '__wmi_event_txstatus [12]'
    Call Trace:
     ath9k_htc_txstatus
     ath9k_wmi_event_tasklet
     tasklet_action_common
     __do_softirq
     irq_exit_rxu
     sysvec_apic_timer_interrupt
    
    Signed-off-by: Minsuk Kang <linuxlovemin@xxxxxxxxxxxx>
    Acked-by: Toke Høiland-Jørgensen <toke@xxxxxxx>
    Signed-off-by: Kalle Valo <quic_kvalo@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231113065756.1491991-1-linuxlovemin@xxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 672789e3c55d..d6a3f001dacb 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -652,9 +652,10 @@ void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event)
 	struct ath9k_htc_tx_event *tx_pend;
 	int i;
 
-	for (i = 0; i < txs->cnt; i++) {
-		WARN_ON(txs->cnt > HTC_MAX_TX_STATUS);
+	if (WARN_ON_ONCE(txs->cnt > HTC_MAX_TX_STATUS))
+		return;
 
+	for (i = 0; i < txs->cnt; i++) {
 		__txs = &txs->txstatus[i];
 
 		skb = ath9k_htc_tx_get_packet(priv, __txs);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux