提交 e25d9313 编写于 作者: D Dan Carpenter 提交者: Zheng Zengkai

ath9k_htc: fix potential out of bounds access with invalid rxstatus->rs_keyix

stable inclusion
from stable-v5.10.121
commit 461e4c1f199076275f16bf6f3d3e42c6b6c79f33
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=461e4c1f199076275f16bf6f3d3e42c6b6c79f33

--------------------------------

[ Upstream commit 2dc50930 ]

The "rxstatus->rs_keyix" eventually gets passed to test_bit() so we need to
ensure that it is within the bitmap.

drivers/net/wireless/ath/ath9k/common.c:46 ath9k_cmn_rx_accept()
error: passing untrusted data 'rx_stats->rs_keyix' to 'test_bit()'

Fixes: 4ed1a8d4 ("ath9k_htc: use ath9k_cmn_rx_accept")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NToke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: NKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220409061225.GA5447@kiliSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 de6b8aa4
......@@ -1006,6 +1006,14 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
goto rx_next;
}
if (rxstatus->rs_keyix >= ATH_KEYMAX &&
rxstatus->rs_keyix != ATH9K_RXKEYIX_INVALID) {
ath_dbg(common, ANY,
"Invalid keyix, dropping (keyix: %d)\n",
rxstatus->rs_keyix);
goto rx_next;
}
/* Get the RX status information */
memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册