Skip to content

Commit 7ed0dce

Browse files
Tristan Madanigregkh
authored andcommitted
wifi: carl9170: fix OOB read from off-by-two in TX status handler
[ Upstream commit a3f42f1 ] 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: a84fab3 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f74e34e commit 7ed0dce

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/net/wireless/ath/carl9170

drivers/net/wireless/ath/carl9170/tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ void carl9170_tx_process_status(struct ar9170 *ar,
693693
unsigned int i;
694694

695695
for (i = 0; i < cmd->hdr.ext; i++) {
696-
if (WARN_ON(i > ((cmd->hdr.len / 2) + 1))) {
696+
if (WARN_ON(i >= (cmd->hdr.len / 2))) {
697697
print_hex_dump_bytes("UU:", DUMP_PREFIX_NONE,
698698
(void *) cmd, cmd->hdr.len + 4);
699699
break;

0 commit comments

Comments
 (0)