]> git.baikalelectronics.ru Git - kernel.git/commit
rtw89: fix potentially access out of range of RF register array
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 19 Nov 2021 05:57:29 +0000 (13:57 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 26 Nov 2021 16:13:03 +0000 (18:13 +0200)
commitda9c7765d055db838257a6c378b9ed1f01acb178
treefdba5ca742e9dede075d42cdcfa4d7ea1401cb17
parent805baf752f077dd51f42579db8a9e00307c3ae08
rtw89: fix potentially access out of range of RF register array

The RF register array is used to help firmware to restore RF settings.
The original code can potentially access out of range, if the size is
between (RTW89_H2C_RF_PAGE_SIZE * RTW89_H2C_RF_PAGE_NUM + 1) to
((RTW89_H2C_RF_PAGE_SIZE + 1) * RTW89_H2C_RF_PAGE_NUM). Fortunately,
current used size doesn't fall into the wrong case, and the size will not
change if we don't update RF parameter.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211119055729.12826-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/phy.c