]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: rtw89: phy: fix out-of-bounds access in rtw89_phy_read_txpwr_limit()
authorKuan-Chung Chen <damon.chen@realtek.com>
Tue, 11 Nov 2025 02:24:49 +0000 (10:24 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Thu, 13 Nov 2025 01:36:40 +0000 (09:36 +0800)
commit1dd7e743dd37361c8c1ac89355a8da738e2b81fb
tree32ef78c012157065b036c4d266b8ec39b468cee3
parentb37fb77d4530f711a08b6dd860a8a4839897aba2
wifi: rtw89: phy: fix out-of-bounds access in rtw89_phy_read_txpwr_limit()

Coverity reported a potential out-of-bounds access when 'bw' exceeds the
valid range for the specified band. Add a helper `rtw89_bw_is_valid()`
to check bandwidth validity for each band before accessing limit tables.

Addresses-Coverity-ID: 1598844 ("Out-of-bounds access")
Addresses-Coverity-ID: 1598896 ("Out-of-bounds access")

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251111022452.28093-6-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/phy.c