CVE-2025-38657 (GCVE-0-2025-38657)

Vulnerability from cvelistv5 – Published: 2025-08-22 16:01 – Updated: 2026-08-05 12:03
VLAI
Title
wifi: rtw89: mcc: prevent shift wrapping in rtw89_core_mlsr_switch()
Summary
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.
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 9dd85e739ce0765f022014c3e0713e1007d7ef60 , < 417cfa9cc44fbe6bceab786f9a4ee5a210f1288e (git)
Affected: 9dd85e739ce0765f022014c3e0713e1007d7ef60 , < 53cf488927a0f79968f9c03c4d1e00d2a79731c3 (git)
guessed Create a notification for this product.
Linux Linux Affected: 6.16
Unaffected: 0 , < 6.16 (semver)
Unaffected: 6.16.1 , ≤ 6.16.* (semver)
Unaffected: 6.17 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/wireless/realtek/rtw89/core.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "417cfa9cc44fbe6bceab786f9a4ee5a210f1288e",
              "status": "affected",
              "version": "9dd85e739ce0765f022014c3e0713e1007d7ef60",
              "versionType": "git"
            },
            {
              "lessThan": "53cf488927a0f79968f9c03c4d1e00d2a79731c3",
              "status": "affected",
              "version": "9dd85e739ce0765f022014c3e0713e1007d7ef60",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/wireless/realtek/rtw89/core.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.16"
            },
            {
              "lessThan": "6.16",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.16.*",
              "status": "unaffected",
              "version": "6.16.1",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.17",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.16.1",
                  "versionStartIncluding": "6.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17",
                  "versionStartIncluding": "6.16",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nwifi: rtw89: mcc: prevent shift wrapping in rtw89_core_mlsr_switch()\n\nThe \"link_id\" value comes from the user via debugfs.  If it\u0027s larger\nthan BITS_PER_LONG then that would result in shift wrapping and\npotentially an out of bounds access later.  In fact, we can limit it\nto IEEE80211_MLD_MAX_NUM_LINKS (15).\n\nFortunately, only root can write to debugfs files so the security\nimpact is minimal."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.3,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "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\u0027s 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.\nAC:L - The attacker picks `link_id` outright, and the mod-64 shift wrap plus the `rtwvif-\u003elinks[link_id]` over-index happen deterministically on every write \u2014 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.\nPR: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).\nUI: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.\nS:U - The out-of-bounds reads and the resulting fault stay entirely within the kernel\u0027s own security authority \u2014 no hypervisor, IOMMU, or sandbox boundary is crossed.\nC:H - This is not a bounded few-byte over-read: `rtwvif-\u003elinks[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-\u003echanctx[idx]` over-read \u2014 an unbounded, repeatable kernel-memory disclosure primitive.\nI: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.\nA:H - Dereferencing the garbage pointer read from far outside `links[]` \u2014 for `mac_id`, `chanctx_idx` and `phy_idx` \u2014 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`."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:03:43.959Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/417cfa9cc44fbe6bceab786f9a4ee5a210f1288e"
        },
        {
          "url": "https://git.kernel.org/stable/c/53cf488927a0f79968f9c03c4d1e00d2a79731c3"
        }
      ],
      "title": "wifi: rtw89: mcc: prevent shift wrapping in rtw89_core_mlsr_switch()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38657",
    "datePublished": "2025-08-22T16:01:00.512Z",
    "dateReserved": "2025-04-16T04:51:24.030Z",
    "dateUpdated": "2026-08-05T12:03:43.959Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-38657",
      "date": "2026-10-02",
      "epss": "0.0015",
      "percentile": "0.03614"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "drivers/net/wireless/realtek/rtw89/core.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "417cfa9cc44fbe6bceab786f9a4ee5a210f1288e",
                    "status": "affected",
                    "version": "9dd85e739ce0765f022014c3e0713e1007d7ef60",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "53cf488927a0f79968f9c03c4d1e00d2a79731c3",
                    "status": "affected",
                    "version": "9dd85e739ce0765f022014c3e0713e1007d7ef60",
                    "versionType": "git"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "drivers/net/wireless/realtek/rtw89/core.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "6.16"
                  },
                  {
                    "lessThan": "6.16",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.16.*",
                    "status": "unaffected",
                    "version": "6.16.1",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "6.17",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "configurations": [
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:6.16:*:*:*:*:*:*:*",
                    "matchCriteriaId": "D6BFC4F7-7099-4420-AF39-DD1CEABB8DF9",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ]
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nwifi: rtw89: mcc: prevent shift wrapping in rtw89_core_mlsr_switch()\n\nThe \"link_id\" value comes from the user via debugfs.  If it\u0027s larger\nthan BITS_PER_LONG then that would result in shift wrapping and\npotentially an out of bounds access later.  In fact, we can limit it\nto IEEE80211_MLD_MAX_NUM_LINKS (15).\n\nFortunately, only root can write to debugfs files so the security\nimpact is minimal."
          },
          {
            "lang": "es",
            "value": "En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: wifi: rtw89: mcc: impide el ajuste de turnos en rtw89_core_mlsr_switch(). El valor \"link_id\" proviene del usuario a trav\u00e9s de debugfs. Si es mayor que BITS_PER_LONG, esto provocar\u00eda un ajuste de turnos y, potencialmente, un acceso fuera de los l\u00edmites posteriormente. De hecho, podemos limitarlo a IEEE80211_MLD_MAX_NUM_LINKS (15). Afortunadamente, solo el usuario root puede escribir en archivos de debugfs, por lo que el impacto en la seguridad es m\u00ednimo."
          }
        ],
        "id": "CVE-2025-38657",
        "lastModified": "2026-07-30T06:23:33.293",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.3,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "LOW",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.5,
              "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
              "type": "Secondary"
            },
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.1,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "NONE",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.2,
              "source": "nvd@nist.gov",
              "type": "Primary"
            }
          ]
        },
        "published": "2025-08-22T16:15:40.777",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/417cfa9cc44fbe6bceab786f9a4ee5a210f1288e"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/53cf488927a0f79968f9c03c4d1e00d2a79731c3"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Modified",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-125"
              }
            ],
            "source": "nvd@nist.gov",
            "type": "Primary"
          }
        ]
      }
    },
    "redhat_vex": {
      "aggregate_severity": "None",
      "current_release_date": "2026-06-30T10:24:45+00:00",
      "cve": "CVE-2025-38657",
      "id": "CVE-2025-38657",
      "initial_release_date": "2025-08-22T00:00:00+00:00",
      "product_status:known_not_affected": "274",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: wifi: rtw89: mcc: prevent shift wrapping in rtw89_core_mlsr_switch()",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-38657.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-09-03T16:34:06Z",
      "cve": "CVE-2025-38657",
      "id": "CVE-2025-38657",
      "initial_release_date": "2025-08-22T23:28:24Z",
      "product_status:known_not_affected": "524",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2025-38657",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2025-38657.json",
      "version": "7"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…