CVE-2025-22126: md: fix mddev uaf while iterating all_mddevs list
In the Linux kernel, the following vulnerability has been resolved:
md: fix mddev uaf while iterating all_mddevs list
While iterating all_mddevs list from md_notify_reboot() and md_exit(),
list_for_each_entry_safe is used, and this can race with deletint the
next mddev, causing UAF:
t1:
spin_lock
//list_for_each_entry_safe(mddev, n, ...)
mddev_get(mddev1)
// assume mddev2 is the next entry
spin_unlock
t2:
//remove mddev2
...
mddev_free
spin_lock
list_del
spin_unlock
kfree(mddev2)
mddev_put(mddev1)
spin_lock
//continue dereference mddev2->all_mddevs
The old helper for_each_mddev() actually grab the reference of mddev2
while holding the lock, to prevent from being freed. This problem can be
fixed the same way, however, the code will be complex.
Hence switch to use list_for_each_entry, in this case mddev_put() can free
the mddev1 and it's not safe as well. Refer to md_seq_show(), also factor
out a helper mddev_put_locked() to fix this problem.
Security readout for executives and security teams
Plain-English summary
CVE-2025-22126 is a Linux kernel flaw in the md RAID subsystem. A race while walking the global md device list can cause use-after-free memory access during reboot notification or md cleanup paths. The sources do not provide CVSS, impact rating, or evidence of active exploitation.
Executive priority
Treat as a kernel maintenance priority for Linux storage platforms, especially where md RAID is used. Urgency is lower than a confirmed exploited remote flaw, but kernel memory-safety bugs should be patched through normal accelerated maintenance windows.
Technical view
The issue is a use-after-free in md_notify_reboot() and md_exit() when iterating all_mddevs. list_for_each_entry_safe could retain a next pointer while another thread removes and frees that mddev. The fix changes iteration behavior and adds mddev_put_locked() handling, based on the kernel commit descriptions.
Likely exposure
Exposure is most relevant to Linux systems running affected 6.x kernels with md RAID functionality present or enabled. The bundled affected-version data is incomplete and ambiguous, so confirm exact exposure against kernel vendor or distribution advisories.
Exploitation context
The source bundle marks KEV as false and provides no cited evidence of exploitation in the wild. The described condition is a kernel race/use-after-free, but the sources do not establish attacker prerequisites, exploitability, or practical impact.
Researcher notes
Evidence supports a race-triggered mddev lifetime bug fixed upstream and in stable branches. The bundle lacks CVSS, CWE, attacker model, crash details, and exploit confirmation. Avoid claiming privilege escalation, denial of service, or remote reachability without additional vendor evidence.
Mitigation direction
Apply vendor kernel updates that include the referenced stable md fixes.
Check Debian or distribution advisories for packaged fixed kernel versions.
Prioritize systems using Linux md RAID or storage-heavy reboot workflows.
Avoid unsupported custom kernels lacking the referenced stable commits.
Validation and detection
Inventory Linux kernel versions across servers and appliances.
Identify systems using md RAID or loading the md subsystem.
Compare deployed kernels with vendor advisories and stable commit inclusion.
Confirm Debian LTS or distro package updates are installed where applicable.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-22126 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
0CVSS vectors
3Timeline events
1ADP providers
7Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
Apr 16, 2025, 14:13 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.