CVE-2023-53665: md: don't dereference mddev after export_rdev()
In the Linux kernel, the following vulnerability has been resolved:
md: don't dereference mddev after export_rdev()
Except for initial reference, mddev->kobject is referenced by
rdev->kobject, and if the last rdev is freed, there is no guarantee that
mddev is still valid. Hence mddev should not be used anymore after
export_rdev().
This problem can be triggered by following test for mdadm at very
low rate:
New file: mdadm/tests/23rdev-lifetime
devname=${dev0##*/}
devt=`cat /sys/block/$devname/dev`
pid=""
runtime=2
clean_up_test() {
pill -9 $pid
echo clear > /sys/block/md0/md/array_state
}
trap 'clean_up_test' EXIT
add_by_sysfs() {
while true; do
echo $devt > /sys/block/md0/md/new_dev
done
}
remove_by_sysfs(){
while true; do
echo remove > /sys/block/md0/md/dev-${devname}/state
done
}
echo md0 > /sys/module/md_mod/parameters/new_array || die "create md0 failed"
add_by_sysfs &
pid="$pid $!"
remove_by_sysfs &
pid="$pid $!"
sleep $runtime
exit 0
Test cmd:
./test --save-logs --logdir=/tmp/ --keep-going --dev=loop --tests=23rdev-lifetime
Test result:
general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6bcb: 0000 [#4] PREEMPT SMP
CPU: 0 PID: 1292 Comm: test Tainted: G D W 6.5.0-rc2-00121-g01e55c376936 #562
RIP: 0010:md_wakeup_thread+0x9e/0x320 [md_mod]
Call Trace:
<TASK>
mddev_unlock+0x1b6/0x310 [md_mod]
rdev_attr_store+0xec/0x190 [md_mod]
sysfs_kf_write+0x52/0x70
kernfs_fop_write_iter+0x19a/0x2a0
vfs_write+0x3b5/0x770
ksys_write+0x74/0x150
__x64_sys_write+0x22/0x30
do_syscall_64+0x40/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Fix this problem by don't dereference mddev after export_rdev().
Security readout for executives and security teams
Plain-English summary
CVE-2023-53665 is a Linux kernel MD RAID bug where the kernel may use an object after it has been released. The provided evidence shows it can crash the kernel during rapid RAID device add/remove activity. There is no KEV listing or cited evidence of active exploitation.
Executive priority
Treat this as a targeted kernel reliability risk, not confirmed internet-scale exploitation. Prioritize patching systems that use Linux MD RAID, especially infrastructure where a local kernel crash would affect availability.
Technical view
The MD subsystem can dereference mddev after export_rdev(), although mddev lifetime may end when the last rdev is freed. The source reports a low-rate mdadm test triggering a general protection fault in md_wakeup_thread through sysfs MD device state changes. Stable kernel commits change the code to avoid using mddev after export_rdev().
Likely exposure
Exposure is most relevant to Linux systems running affected kernel versions in the CVE record and using the MD RAID subsystem. Systems without MD RAID usage are less likely to encounter the vulnerable path. Distribution backports may change actual exposure.
Exploitation context
No provided source claims public exploitation, weaponized exploit availability, or active attacks. The only trigger evidence is a local mdadm test exercising sysfs MD add/remove behavior. Required privileges are not stated in the source bundle.
Researcher notes
Evidence supports a lifetime bug in Linux MD rdev removal handling. The source does not provide CVSS, CWE, exploit status, or privilege requirements. Avoid expanding affected products beyond Linux kernels and MD RAID context without vendor confirmation.
Mitigation direction
Apply a kernel version containing the referenced stable fixes.
Check Linux distribution advisories for backported kernel packages.
Limit administrative access to MD RAID sysfs management interfaces.
Review fleet inventory for Linux 6.5-era kernels using MD RAID.
Validation and detection
Identify kernels matching the affected versions in the CVE record.
Check whether MD RAID is enabled or actively used.
Confirm installed kernel includes one of the referenced stable commits or vendor backport.
Review crash logs for md_wakeup_thread or rdev_attr_store traces.
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-2023-53665 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
0ADP providers
3Source 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.
Oct 7, 2025, 15:21 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.