[PATCH v3 1/6] wifi: mwifiex: fix OOB write from firmware queue_index in WMM status response

From: Tristan Madani

Date: Tue Apr 21 2026 - 09:54:57 EST


From: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>

The firmware-controlled queue_index (u8) from the WMM queue status TLV
is used to index the 4-entry ac_status[] array without validation. An
out-of-range value causes out-of-bounds writes of three firmware-
controlled bytes into adjacent struct fields.

Add a bounds check before using queue_index as an array index.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>
---
Changes in v3:
- Regenerated from wireless-next with proper git format-patch to
produce valid index hashes (v2 had post-processed index lines).

Changes in v2:
- No code changes from v1.

drivers/net/wireless/marvell/mwifiex/wmm.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/wmm.c b/drivers/net/wireless/marvell/mwifiex/wmm.c
index 841505e83c7fd..27e6dedcca2e8 100644
--- a/drivers/net/wireless/marvell/mwifiex/wmm.c
+++ b/drivers/net/wireless/marvell/mwifiex/wmm.c
@@ -943,6 +943,11 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
tlv_wmm_qstatus->flow_required,
tlv_wmm_qstatus->disabled);

+
+ if (tlv_wmm_qstatus->queue_index >=
+ IEEE80211_NUM_ACS) {
+ break;
+ }
ac_status = &priv->wmm.ac_status[tlv_wmm_qstatus->
queue_index];
ac_status->disabled = tlv_wmm_qstatus->disabled;
--
2.47.3