]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: carl9170: fix OOB read from off-by-two in TX status handler
authorTristan Madani <tristan@talencesecurity.com>
Tue, 21 Apr 2026 13:49:27 +0000 (13:49 +0000)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 13 Jul 2026 13:55:19 +0000 (06:55 -0700)
The bounds check in carl9170_tx_process_status() uses
`i > ((cmd->hdr.len / 2) + 1)` which is off by two, allowing
2 extra iterations past valid _tx_status entries when the firmware-
controlled hdr.ext exceeds hdr.len/2. Fix by using the correct
comparison `i >= (cmd->hdr.len / 2)`.

Fixes: a84fab3cbfdc ("carl9170: 802.11 rx/tx processing and usb backend")
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=5c1ca6ccaa1215781cac
Link: https://patch.msgid.link/20260421134929.325662-3-tristmd@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/carl9170/tx.c

index 59caf1e4b15893b6de08150aac4707283b51b3d2..06aaf281655b1e1b1c4773a42782de379b3978b6 100644 (file)
@@ -692,7 +692,7 @@ void carl9170_tx_process_status(struct ar9170 *ar,
        unsigned int i;
 
        for (i = 0;  i < cmd->hdr.ext; i++) {
-               if (WARN_ON(i > ((cmd->hdr.len / 2) + 1))) {
+               if (WARN_ON(i >= (cmd->hdr.len / 2))) {
                        print_hex_dump_bytes("UU:", DUMP_PREFIX_NONE,
                                             (void *) cmd, cmd->hdr.len + 4);
                        break;