mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
wifi: rtw89: Fix array index mistake in rtw89_sta_info_get_iter()
[ Upstream commit 85099c7ce4f9e64c66aa397cd9a37473637ab891 ]
In rtw89_sta_info_get_iter() 'status->he_gi' is compared to array size.
But then 'rate->he_gi' is used as array index instead of 'status->he_gi'.
This can lead to go beyond array boundaries in case of 'rate->he_gi' is
not equal to 'status->he_gi' and is bigger than array size. Looks like
"copy-paste" mistake.
Fix this mistake by replacing 'rate->he_gi' with 'status->he_gi'.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: e3ec7017f6 ("rtw89: add Realtek 802.11ax driver")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240703210510.11089-1-amishin@t-argos.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cd34f515c4
commit
a2a095c08b
@@ -2386,7 +2386,7 @@ static void rtw89_sta_info_get_iter(void *data, struct ieee80211_sta *sta)
|
|||||||
case RX_ENC_HE:
|
case RX_ENC_HE:
|
||||||
seq_printf(m, "HE %dSS MCS-%d GI:%s", status->nss, status->rate_idx,
|
seq_printf(m, "HE %dSS MCS-%d GI:%s", status->nss, status->rate_idx,
|
||||||
status->he_gi <= NL80211_RATE_INFO_HE_GI_3_2 ?
|
status->he_gi <= NL80211_RATE_INFO_HE_GI_3_2 ?
|
||||||
he_gi_str[rate->he_gi] : "N/A");
|
he_gi_str[status->he_gi] : "N/A");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
seq_printf(m, "\t(hw_rate=0x%x)\n", rtwsta->rx_hw_rate);
|
seq_printf(m, "\t(hw_rate=0x%x)\n", rtwsta->rx_hw_rate);
|
||||||
|
|||||||
Reference in New Issue
Block a user