Blame SOURCES/0004-iwlegacy-ensure-loop-counter-addr-does-not-wrap-and-.patch
|
Kmods SIG |
9a70cc |
From c2f9a4e4a5abfc84c01b738496b3fd2d471e0b18 Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
9a70cc |
From: Colin Ian King <colin.king@canonical.com>
|
|
Kmods SIG |
9a70cc |
Date: Sun, 26 Jan 2020 00:09:54 +0000
|
|
Kmods SIG |
9a70cc |
Subject: [Backport c2f9a4e4a5ab] iwlegacy: ensure loop counter addr does not
|
|
Kmods SIG |
9a70cc |
wrap and cause an infinite loop
|
|
Kmods SIG |
9a70cc |
|
|
Kmods SIG |
9a70cc |
The loop counter addr is a u16 where as the upper limit of the loop
|
|
Kmods SIG |
9a70cc |
is an int. In the unlikely event that the il->cfg->eeprom_size is
|
|
Kmods SIG |
9a70cc |
greater than 64K then we end up with an infinite loop since addr will
|
|
Kmods SIG |
9a70cc |
wrap around an never reach upper loop limit. Fix this by making addr
|
|
Kmods SIG |
9a70cc |
an int.
|
|
Kmods SIG |
9a70cc |
|
|
Kmods SIG |
9a70cc |
Addresses-Coverity: ("Infinite loop")
|
|
Kmods SIG |
9a70cc |
Fixes: be663ab67077 ("iwlwifi: split the drivers for agn and legacy devices 3945/4965")
|
|
Kmods SIG |
9a70cc |
Signed-off-by: Colin Ian King <colin.king@canonical.com>
|
|
Kmods SIG |
9a70cc |
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
|
Kmods SIG |
9a70cc |
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
|
Kmods SIG |
9a70cc |
---
|
|
Kmods SIG |
9a70cc |
src/common.c | 2 +-
|
|
Kmods SIG |
9a70cc |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Kmods SIG |
9a70cc |
|
|
Kmods SIG |
9a70cc |
diff --git a/src/common.c b/src/common.c
|
|
Kmods SIG |
9a70cc |
index d966b29b45ee7716499edae1ff171cd77176604b..348c17ce72f5cd57b66fb5ae161b2381b3585bf3 100644
|
|
Kmods SIG |
9a70cc |
--- a/src/common.c
|
|
Kmods SIG |
9a70cc |
+++ b/src/common.c
|
|
Kmods SIG |
9a70cc |
@@ -699,7 +699,7 @@ il_eeprom_init(struct il_priv *il)
|
|
Kmods SIG |
9a70cc |
u32 gp = _il_rd(il, CSR_EEPROM_GP);
|
|
Kmods SIG |
9a70cc |
int sz;
|
|
Kmods SIG |
9a70cc |
int ret;
|
|
Kmods SIG |
9a70cc |
- u16 addr;
|
|
Kmods SIG |
9a70cc |
+ int addr;
|
|
Kmods SIG |
9a70cc |
|
|
Kmods SIG |
9a70cc |
/* allocate eeprom */
|
|
Kmods SIG |
9a70cc |
sz = il->cfg->eeprom_size;
|
|
Kmods SIG |
9a70cc |
--
|
|
Kmods SIG |
9a70cc |
2.31.1
|
|
Kmods SIG |
9a70cc |
|