]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath6kl: fix OOB access from firmware ADDBA window size
authorTristan Madani <tristan@talencesecurity.com>
Thu, 2 Jul 2026 00:50:20 +0000 (00:50 +0000)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 13 Jul 2026 13:55:18 +0000 (06:55 -0700)
aggr_recv_addba_req_evt() logs a debug message when the firmware-supplied
win_sz is outside [AGGR_WIN_SZ_MIN, AGGR_WIN_SZ_MAX] but does not
return. The out-of-range win_sz is then used in TID_WINDOW_SZ() to
compute a kzalloc size and stored in rxtid->hold_q_sz, leading to
zero-size or overflowed allocations and subsequent out-of-bounds access.

Clean up any previously active aggregation session for the TID first,
then return early when win_sz is out of the valid range, instead of
proceeding with a broken allocation size.

Fixes: bdcd81707973 ("Add ath6kl cleaned up driver")
Cc: stable@vger.kernel.org
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
Link: https://patch.msgid.link/20260702005020.708717-1-tristmd@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath6kl/txrx.c

index 0e268017af528228b881bd9ab753e5dbadfd1962..d81825413906178d61bb52de6ad0935699276266 100644 (file)
@@ -1723,13 +1723,15 @@ void aggr_recv_addba_req_evt(struct ath6kl_vif *vif, u8 tid_mux, u16 seq_no,
 
        rxtid = &aggr_conn->rx_tid[tid];
 
-       if (win_sz < AGGR_WIN_SZ_MIN || win_sz > AGGR_WIN_SZ_MAX)
-               ath6kl_dbg(ATH6KL_DBG_WLAN_RX, "%s: win_sz %d, tid %d\n",
-                          __func__, win_sz, tid);
-
        if (rxtid->aggr)
                aggr_delete_tid_state(aggr_conn, tid);
 
+       if (win_sz < AGGR_WIN_SZ_MIN || win_sz > AGGR_WIN_SZ_MAX) {
+               ath6kl_dbg(ATH6KL_DBG_WLAN_RX, "%s: win_sz %d, tid %d\n",
+                          __func__, win_sz, tid);
+               return;
+       }
+
        rxtid->seq_next = seq_no;
        hold_q_size = TID_WINDOW_SZ(win_sz) * sizeof(struct skb_hold_q);
        rxtid->hold_q = kzalloc(hold_q_size, GFP_KERNEL);