CVE-2025-38657
published high CVSS 3.1 · 7.3wifi: rtw89: mcc: prevent shift wrapping in rtw89_core_mlsr_switch()
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux9dd85e739ce0765f022014c3e0713e1007d7ef60 to < 417cfa9cc44fbe6bceab786f9a4ee5a210f1288e · 9dd85e739ce0765f022014c3e0713e1007d7ef60 to < 53cf488927a0f79968f9c03c4d1e00d2a79731c3 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.16 (affected) · 0 to < 6.16 (unaffected · semver) · 6.16.1 through 6.16.* (unaffected · semver) · 6.17 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: wifi: rtw89: mcc: prevent shift wrapping in rtw89_core_mlsr_switch() The "link_id" value comes from the user via debugfs. If it's larger than BITS_PER_LONG then that would result in shift wrapping and potentially an out of bounds access later. In fact, we can limit it to IEEE80211_MLD_MAX_NUM_LINKS (15). Fortunately, only root can write to debugfs files so the security impact is minimal.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.3 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H
- Scenarios
- en: AV:L - The only attacker-controlled path into `rtw89_core_mlsr_switch()` is a local `write()` to `/sys/kernel/debug/ieee80211/phyX/rtw89/mlo_mode`; the driver's other caller derives `link_id` from a bitmap already bounded by `IEEE80211_MLD_MAX_NUM_LINKS`, and no received frame or remote peer data reaches this function. AC:L - The attacker picks `link_id` outright, and the mod-64 shift wrap plus the `rtwvif->links[link_id]` over-index happen deterministically on every write — no race, no memory grooming. The only precondition is an MLD vif with a usable-but-inactive link, which is the ordinary steady state of Wi-Fi 7 hardware associated in MLSR mode and can be re-attempted at will. PR:L - The driver deliberately creates `mlo_mode` world-writable (`rtw89_debugfs_add_rw` uses `S_IFREG | 0666`) beneath 0755 directories, so on the embedded, BMC and Android-derived images that mount debugfs 0755 for diagnostics any unprivileged local user can trigger it; no `capable()` check exists anywhere in the rtw89 debugfs write path. Low is chosen over High per the higher-severity-when-uncertain rule, consistent with prior kernel CNA scoring of world-accessible debugfs files (CVE-2025-38719). UI:N - The attacker performs the single debugfs write themselves and the out-of-bounds access occurs synchronously in their own `write()` syscall; no victim must open a file, associate, or take any other action. S:U - The out-of-bounds reads and the resulting fault stay entirely within the kernel's own security authority — no hypervisor, IOMMU, or sandbox boundary is crossed. C:H - This is not a bounded few-byte over-read: `rtwvif->links[link_id]` reads a pointer from an attacker-chosen offset up to ~32 GB past a 15-entry array, and the recovered value is dereferenced as a `struct rtw89_vif_link *` whose `mac_id` is shipped to the Wi-Fi firmware, whose `link_id` is printed to dmesg, and whose `chanctx_idx` drives a second unchecked `hal->chanctx[idx]` over-read — an unbounded, repeatable kernel-memory disclosure primitive. I:L - No out-of-bounds write or write-through-pointer exists on this path, but values harvested from out-of-bounds kernel memory are programmed into the device: a bogus `mac_id` is sent to the Wi-Fi firmware in an H2C MLO link-cfg command and an out-of-range `chanctx_idx`/`phy_idx` steer TXGAPK/IQK/TSSI/DPK calibration writes to RF and BB registers, modifying radio state in ways the attacker cannot precisely steer. A:H - Dereferencing the garbage pointer read from far outside `links[]` — for `mac_id`, `chanctx_idx` and `phy_idx` — readily oopses the kernel (and KASAN reports the out-of-bounds access outright), while surviving cases run RF calibration with nonsense parameters that can wedge the adapter; the write can be repeated at will and escalates to a panic under `panic_on_oops`.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 9dd85e739ce0765f022014c3e0713e1007d7ef60 to < 417cfa9cc44fbe6bceab786f9a4ee5a210f1288e (affected · git)9dd85e739ce0765f022014c3e0713e1007d7ef60 to < 53cf488927a0f79968f9c03c4d1e00d2a79731c3 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.16 (affected)0 to < 6.16 (unaffected · semver)6.16.1 through 6.16.* (unaffected · semver)6.17 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
2Provider assertions
1Linux · cna
wifi: rtw89: mcc: prevent shift wrapping in rtw89_core_mlsr_switch()
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- d407c0fd12bd409278dd3c35ca4aa972a4c16ebeee8c957894d9f796ee67d1e1
- Ingested
- 23 Sep 2026, 08:46:47 UTC
- Source record
- Official CVE record