]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: carl9170: fix buffer overflow in rx_stream failover path
authorTristan Madani <tristan@talencesecurity.com>
Tue, 21 Apr 2026 13:49:28 +0000 (13:49 +0000)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 13 Jul 2026 13:55:20 +0000 (06:55 -0700)
The failover continuation in carl9170_rx_stream() copies the full tlen
from the second USB transfer instead of capping at rx_failover_missing
bytes. When both transfers are near maximum size, the total exceeds the
65535-byte failover SKB, triggering skb_over_panic.

Limit the copy size to the missing byte count.

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-4-tristmd@gmail.com
[Fix checkpatch CHECK:PARENTHESIS_ALIGNMENT]
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/carl9170/rx.c

index f6855efc05c0f1a44f49e7368a32c9d365124310..0383d5c9698bfa4d4c88a68323632591c0172adc 100644 (file)
@@ -918,7 +918,9 @@ static void carl9170_rx_stream(struct ar9170 *ar, void *buf, unsigned int len)
                                }
                        }
 
-                       skb_put_data(ar->rx_failover, tbuf, tlen);
+                       skb_put_data(ar->rx_failover, tbuf,
+                                    min_t(unsigned int, tlen,
+                                          ar->rx_failover_missing));
                        ar->rx_failover_missing -= tlen;
 
                        if (ar->rx_failover_missing <= 0) {