Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: rtw89: check if sta's mac_id is valid under AP/TDLS

Add boundary check of mac_id when adding sta under AP/TDLS.
And, return -ENOSPC if the acquired mac_id is invalid.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221021091828.40157-1-pkshih@realtek.com

authored by

Zong-Zhe Yang and committed by
Kalle Valo
46245bc4 25f49617

+2
+2
drivers/net/wireless/realtek/rtw89/core.c
··· 2413 2413 } else if (vif->type == NL80211_IFTYPE_AP || sta->tdls) { 2414 2414 rtwsta->mac_id = rtw89_core_acquire_bit_map(rtwdev->mac_id_map, 2415 2415 RTW89_MAX_MAC_ID_NUM); 2416 + if (rtwsta->mac_id == RTW89_MAX_MAC_ID_NUM) 2417 + return -ENOSPC; 2416 2418 } 2417 2419 2418 2420 return 0;