CVE-2025-22126

HIGH

Linux Kernel 6.0-6.1.134, 6.2-6.6.87, 6.7-6.12.24, 6.13-6.14.1 - Use-After-Free in MD Device List Iteration

Title source: llm
STIX 2.1

Description

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.

Scores

CVSS v3 7.8
EPSS 0.0016
EPSS Percentile 5.8%
Attack Vector LOCAL
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Details

CWE
CWE-416
Status published
Products (17)
linux/Kernel 6.0.0 - 6.1.135linux
linux/Kernel 6.13.0 - 6.14.2linux
linux/Kernel 6.2.0 - 6.6.88linux
linux/Kernel 6.7.0 - 6.12.25linux
Linux/Linux < 6.0
Linux/Linux 6.0
Linux/Linux 6.1.135 - 6.1.*
Linux/Linux 6.12.25 - 6.12.*
Linux/Linux 6.14.2 - 6.14.*
Linux/Linux 6.15
... and 7 more
Published Apr 16, 2025
Tracked Since Feb 18, 2026