[PATCH] rsi: fix array out of bound

Subsystems: redpine wireless driver, the rest

STALE1765d LANDED

Landed in mainline as 4d375c2e51d5 on 2021-12-15.

2 messages, 2 authors, 2021-12-15 · open the first message on its own page

[PATCH] rsi: fix array out of bound

From: zhangyue <hidden>
Date: 2021-12-09 00:57:14

Limit the max of 'ii'. If 'ii' greater than or
equal to 'RSI_MAX_VIFS', the array 'adapter->vifs'
may be out of bound

Signed-off-by: zhangyue <redacted>
---
 drivers/net/wireless/rsi/rsi_91x_mac80211.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index e70c1c7fdf59..913e11fb3807 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -1108,6 +1108,9 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,
 			break;
 	}
 
+	if (ii >= RSI_MAX_VIFS)
+		return status;
+
 	mutex_lock(&common->mutex);
 
 	if (ssn != NULL)
-- 
2.30.0

Re: [PATCH] rsi: fix array out of bound

From: Kalle Valo <kvalo@kernel.org>
Date: 2021-12-15 14:28:46

zhangyue [off-list ref] wrote:
Limit the max of 'ii'. If 'ii' greater than or
equal to 'RSI_MAX_VIFS', the array 'adapter->vifs'
may be out of bound

Signed-off-by: zhangyue <redacted>
Patch applied to wireless-drivers-next.git, thanks.

4d375c2e51d5 rsi: fix array out of bound

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211208095341.47777-1-zhangyue1@kylinos.cn/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help