* [PATCH] wifi: cw1200: fix link_id_db OOB access via device-controlled link ID
@ 2026-09-24 9:03 Tianchu Chen
0 siblings, 0 replies; only message in thread
From: Tianchu Chen @ 2026-09-24 9:03 UTC (permalink / raw)
To: linux-wireless; +Cc: stable
From: Tianchu Chen <flynnnchen@tencent.com>
cw1200_rx_cb() stores the link ID from the device-supplied WSM
header (a 4-bit field, range 0-15) into priv->action_linkid for P2P
public action frames without an upper bound check. The work handler
cw1200_link_id_reset() then uses it to index link_id_db[], which has
only CW1200_MAX_STA_IN_AP_MODE (5) entries, so a device reporting a
link ID of 6-15 makes the driver read and write cw1200_common fields
past the array (a status copy and a constant store onto adjacent
work/lock/timer fields), corrupting driver state.
The first link ID check in the same function (used for timestamp
tracking) already validates against CW1200_MAX_STA_IN_AP_MODE and
degrades out-of-range IDs to untracked handling, so out-of-range
link IDs on the RX path are anticipated; the P2P remap branch was
missed.
Add the same bound to the remap branch. This is expected to keep
driver behavior unchanged in most cases: the driver itself only
assigns link IDs 1..5, and a P2P public action frame carrying any
other ID now degrades to the same untracked handling the first
branch already applies, instead of corrupting memory.
Discovered by Atuin - Automated Vulnerability Discovery Engine.
Fixes: a910e4a94f69 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Tianchu Chen <flynnnchen@tencent.com>
---
drivers/net/wireless/st/cw1200/txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/st/cw1200/txrx.c b/drivers/net/wireless/st/cw1200/txrx.c
index e13695667a00b..33b02e562b79e 100644
--- a/drivers/net/wireless/st/cw1200/txrx.c
+++ b/drivers/net/wireless/st/cw1200/txrx.c
@@ -1050,7 +1050,7 @@ void cw1200_rx_cb(struct cw1200_common *priv,
schedule_work(&priv->linkid_reset_work);
}
- if (link_id && p2p &&
+ if (link_id && link_id <= CW1200_MAX_STA_IN_AP_MODE && p2p &&
ieee80211_is_action(frame->frame_control) &&
(mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)) {
/* Link ID already exists for the ACTION frame.
--
2.51.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-24 9:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24 9:03 [PATCH] wifi: cw1200: fix link_id_db OOB access via device-controlled link ID Tianchu Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox