CVE-2025-68373
Description
In the Linux kernel, the following vulnerability has been resolved:
md: avoid repeated calls to del_gendisk
There is a uaf problem which is found by case 23rdev-lifetime:
Oops: general protection fault, probably for non-canonical address 0xdead000000000122 RIP: 0010:bdi_unregister+0x4b/0x170 Call Trace:
__del_gendisk+0x356/0x3e0 mddev_unlock+0x351/0x360 rdev_attr_store+0x217/0x280 kernfs_fop_write_iter+0x14a/0x210 vfs_write+0x29e/0x550 ksys_write+0x74/0xf0 do_syscall_64+0xbb/0x380 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff5250a177e
The sequence is: 1. rdev remove path gets reconfig_mutex 2. rdev remove path release reconfig_mutex in mddev_unlock 3. md stop calls do_md_stop and sets MD_DELETED 4. rdev remove path calls del_gendisk because MD_DELETED is set 5. md stop path release reconfig_mutex and calls del_gendisk again
So there is a race condition we should resolve. This patch adds a flag MD_DO_DELETE to avoid the race condition.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A race condition in the Linux kernel's MD (RAID) driver allows a use-after-free when removing an rdev (member disk) and stopping the array concurrently, due to repeated calls to `del_gendisk`.
Vulnerability
A use-after-free vulnerability exists in the Linux kernel's MD (Multiple Device) driver, which manages software RAID arrays. The root cause is a race condition between the removal of a member disk (rdev) and the stopping of the entire MD array. When an rdev is removed, it releases the reconfig_mutex via mddev_unlock. In a concurrent code path, the md_stop function sets the MD_DELETED flag. After the rdev removal path re-acquires the mutex, it checks for the MD_DELETED flag and calls del_gendisk. Separately, the md_stop path also calls del_gendisk after releasing the mutex. This results in del_gendisk being called twice on the same gendisk structure, leading to a use-after-free when bdi_unregister is invoked on the already-freed object. [1]
Exploitation
An attacker with the ability to trigger the rdev removal (e.g., via sysfs attribute writes) and simultaneously cause the MD array to stop (e.g., via mdadm --stop or other management commands) can exploit this race. The attack requires local access to the system and sufficient privileges to manage MD devices, typically root or a user with CAP_SYS_ADMIN. The race window is small but exploitable, as evidenced by the crash trace. [1]
Impact
Successful exploitation results in a use-after-free condition, which can lead to a kernel crash (denial of service) or potentially arbitrary code execution, depending on how the freed memory is reused. The vulnerability demonstrates a classic race condition in kernel device management. [1]
Mitigation
The fix introduces a new flag MD_DO_DELETE to synchronize the two code paths, ensuring del_gendisk is called only once. The patch has been applied to the Linux kernel stable tree as commit 90e3bb44c0a86e245d8e5c6520206fa113acb1ee. Users should update their kernels to incorporate this fix. [1]
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
3News mentions
0No linked articles in our index yet.