]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: iwlwifi: dvm: fix potential overflow in rs_fill_link_cmd()
authorRand Deeb <rand.sec96@gmail.com>
Wed, 13 Mar 2024 10:17:55 +0000 (13:17 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:15 +0000 (18:41 +0200)
commitee7961bd4afc3f00bc84c1f6045813ccab6c745f
tree43be77d39948d39e95ef8b81ba1b26a741fce945
parentc437bac35171ad1cc5347649d44fab6642c3f125
wifi: iwlwifi: dvm: fix potential overflow in rs_fill_link_cmd()

[ Upstream commit e3ad987e9dc7d1e12e3f2f1e623f0e174cd0ca78 ]

The 'index' variable in the rs_fill_link_cmd() function can reach
LINK_QUAL_MAX_RETRY_NUM during the execution of the inner loop. This
variable is used as an index for the lq_cmd->rs_table array, which has a
size of LINK_QUAL_MAX_RETRY_NUM, without proper validation.

Modify the condition of the inner loop to ensure that the 'index' variable
does not exceed LINK_QUAL_MAX_RETRY_NUM - 1, thereby preventing any
potential overflow issues.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Rand Deeb <rand.sec96@gmail.com>
Link: https://patch.msgid.link/20240313101755.269209-1-rand.sec96@gmail.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/dvm/rs.c