1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless/intel/iwlegacy
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
..
3945-debug.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 183 2019-05-30 11:29:20 -07:00
3945-mac.c wifi: mac80211: move interface config to new struct 2022-06-20 12:55:03 +02:00
3945-rs.c mac80211: prepare sta handling for MLO support 2022-04-11 16:42:03 +02:00
3945.c intel: switch from 'pci_' to 'dma_' API 2021-08-29 14:47:21 +03:00
3945.h wireless-drivers-next patches for 5.3 2019-06-26 10:12:17 -07:00
4965-calib.c iwlegacy: 4965-calib: Demote seemingly accidental kernel-doc header 2020-09-01 12:22:42 +03:00
4965-debug.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 183 2019-05-30 11:29:20 -07:00
4965-mac.c wireless: Remove redundant 'flush_workqueue()' calls 2021-10-13 09:22:19 +03:00
4965-rs.c wifi: iwlegacy: 4965: fix potential off-by-one overflow in il4965_rs_fill_link_cmd() 2022-06-21 09:13:07 +03:00
4965.c wifi: mac80211: move interface config to new struct 2022-06-20 12:55:03 +02:00
4965.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 183 2019-05-30 11:29:20 -07:00
commands.h treewide: Replace open-coded flex arrays in unions 2021-10-18 12:28:53 -07:00
common.c wifi: mac80211: return a beacon for a specific link 2022-06-20 12:57:08 +02:00
common.h wifi: mac80211: split bss_info_changed method 2022-06-20 12:55:09 +02:00
csr.h
debug.c iwlegacy: debug: Demote seemingly unintentional kerneldoc header 2020-09-01 12:02:40 +03:00
iwl-spectrum.h iwlegacy: Replace zero-length array with flexible-array 2020-05-12 11:54:47 +03:00
Kconfig iwlwifi: fix LED dependencies 2021-12-08 20:17:06 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
prph.h