# CVE-2023-53665: md: don't dereference mddev after export\_rdev()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.19% (percentile 5, 2026-11-26)
- **Published:** 2025-10-07T15:21:23.808Z
- **Modified:** 2026-06-17T06:45:49.650Z

## Who should check

- Anyone running Linux \>= 3ce94ce5d05ae89190a23f6187f64d8f4b2d3782, \< ad430ad0669d2757377373390d68e1454fc7a344; \>= 3ce94ce5d05ae89190a23f6187f64d8f4b2d3782, \< 7deac114be5fb25a4e865212ed0feaf5f85f2a28
- Anyone running Linux 6.5

## Description

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().

## Affected and fixed versions

- Linux: \>= 3ce94ce5d05ae89190a23f6187f64d8f4b2d3782, \< ad430ad0669d2757377373390d68e1454fc7a344; \>= 3ce94ce5d05ae89190a23f6187f64d8f4b2d3782, \< 7deac114be5fb25a4e865212ed0feaf5f85f2a28 (cvelist)
- Linux: 6.5 (cvelist)

## Mitigation

- Upgrade Linux to 7deac114be5fb25a4e865212ed0feaf5f85f2a28 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-53665. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-53665.md
Affected: Linux >= 3ce94ce5d05ae89190a23f6187f64d8f4b2d3782, < ad430ad0669d2757377373390d68e1454fc7a344; >= 3ce94ce5d05ae89190a23f6187f64d8f4b2d3782, < 7deac114be5fb25a4e865212ed0feaf5f85f2a28; Linux 6.5
Fixed in: Linux 7deac114be5fb25a4e865212ed0feaf5f85f2a28

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-53665 being exploited?

There is no confirmed exploitation: CVE-2023-53665 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.19% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-53665?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-53665?

Linux \>= 3ce94ce5d05ae89190a23f6187f64d8f4b2d3782, \< ad430ad0669d2757377373390d68e1454fc7a344; \>= 3ce94ce5d05ae89190a23f6187f64d8f4b2d3782, \< 7deac114be5fb25a4e865212ed0feaf5f85f2a28; Linux 6.5.

### Is there a fix for CVE-2023-53665?

Yes. Fixed in Linux 7deac114be5fb25a4e865212ed0feaf5f85f2a28. Upgrade Linux to 7deac114be5fb25a4e865212ed0feaf5f85f2a28 or later.

### How do I check if I'm affected by CVE-2023-53665?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/ad430ad0669d2757377373390d68e1454fc7a344>
- patch: <https://git.kernel.org/stable/c/7deac114be5fb25a4e865212ed0feaf5f85f2a28>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-53665>

HTML: <https://flawdb.com/CVE-2023-53665> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-53665>
