1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless/intel
Alexey Kodanev a8eb8e6f71 wifi: iwlegacy: 4965: fix potential off-by-one overflow in il4965_rs_fill_link_cmd()
As a result of the execution of the inner while loop, the value
of 'idx' can be equal to LINK_QUAL_MAX_RETRY_NUM. However, this
is not checked after the loop and 'idx' is used to write the
LINK_QUAL_MAX_RETRY_NUM size array 'lq_cmd->rs_table[idx]' below
in the outer loop.

The fix is to check the new value of 'idx' inside the nested loop,
and break both loops if index equals the size. Checking it at the
start is now pointless, so let's remove it.

Detected using the static analysis tool - Svace.

Fixes: be663ab670 ("iwlwifi: split the drivers for agn and legacy devices 3945/4965")
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220608171614.28891-1-aleksei.kodanev@bell-sw.com
2022-06-21 09:13:07 +03:00
..
ipw2x00 ipw2x00: use DEVICE_ATTR_*() macro 2022-04-06 15:16:35 +03:00
iwlegacy wifi: iwlegacy: 4965: fix potential off-by-one overflow in il4965_rs_fill_link_cmd() 2022-06-21 09:13:07 +03:00
iwlwifi wifi: mac80211: return a beacon for a specific link 2022-06-20 12:57:08 +02:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile iwlwifi: fix build error for IWLMEI 2022-03-02 22:36:49 +01:00