# CVE-2025-40223: most: usb: Fix use-after-free in hdm\_disconnect

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2025-12-04T15:31:15.158Z
- **Modified:** 2026-10-19T19:10:00.130Z

## Who should check

- Anyone running Linux \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 578eb18cd111addec94c43f61cd4b4429e454809; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 33daf469f5294b9d07c4fc98216cace9f4f34cc6; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 72427dc6f87523995f4e6ae35a948bb2992cabce; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< f93a84ffb884d761a9d4e869ba29c238711e81f1; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 3a3b8e89c7201c5b3b76ac4a4069d1adde1477d6; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 4b1270902609ef0d935ed2faa2ea6d122bd148f5
- Anyone running Linux 5.9

## Description

In the Linux kernel, the following vulnerability has been resolved:

most: usb: Fix use-after-free in hdm\_disconnect

hdm\_disconnect() calls most\_deregister\_interface(), which eventually
unregisters the MOST interface device with device\_unregister(iface-\>dev).
If that drops the last reference, the device core may call release\_mdev()
immediately while hdm\_disconnect() is still executing.

The old code also freed several mdev-owned allocations in
hdm\_disconnect() and then performed additional put\_device() calls.
Depending on refcount order, this could lead to use-after-free or
double-free when release\_mdev() ran (or when unregister paths also
performed puts).

Fix by moving the frees of mdev-owned allocations into release\_mdev(),
so they happen exactly once when the device is truly released, and by
dropping the extra put\_device() calls in hdm\_disconnect() that are
redundant after device\_unregister() and most\_deregister\_interface().

This addresses the KASAN slab-use-after-free reported by syzbot in
hdm\_disconnect(). See report and stack traces in the bug link below.

## Affected and fixed versions

- Linux: \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 578eb18cd111addec94c43f61cd4b4429e454809; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 33daf469f5294b9d07c4fc98216cace9f4f34cc6; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 72427dc6f87523995f4e6ae35a948bb2992cabce; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< f93a84ffb884d761a9d4e869ba29c238711e81f1; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 3a3b8e89c7201c5b3b76ac4a4069d1adde1477d6; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 4b1270902609ef0d935ed2faa2ea6d122bd148f5 (cvelist)
- Linux: 5.9 (cvelist)

## Mitigation

- Upgrade Linux to 4b1270902609ef0d935ed2faa2ea6d122bd148f5 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-40223.md
Affected: Linux >= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, < 5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831; >= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, < 578eb18cd111addec94c43f61cd4b4429e454809; >= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, < 33daf469f5294b9d07c4fc98216cace9f4f34cc6; >= 97a6f772f36b7f52bcfa56a…
Fixed in: Linux 5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831, Linux 578eb18cd111addec94c43f61cd4b4429e454809, Linux 33daf469f5294b9d07c4fc98216cace9f4f34cc6, Linux 72427dc6f87523995f4e6ae35a948bb2992cabce, Linux 3a3b8e89c7201c5b3b76ac4a4069d1adde1477d6, Linux 4b1270902609ef0d935ed2faa2ea6d122bd148f5

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-2025-40223 being exploited?

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

### How serious is CVE-2025-40223?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2025-40223?

Linux \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 578eb18cd111addec94c43f61cd4b4429e454809; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 33daf469f5294b9d07c4fc98216cace9f4f34cc6; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 72427dc6f87523995f4e6ae35a948bb2992cabce; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< f93a84ffb884d761a9d4e869ba29c238711e81f1; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 3a3b8e89c7201c5b3b76ac4a4069d1adde1477d6; \>= 97a6f772f36b7f52bcfa56a581bbd2470cffe23d, \< 4b1270902609ef0d935ed2faa2ea6d122bd148f5; Linux 5.9.

### Is there a fix for CVE-2025-40223?

Yes. Fixed in Linux 5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831, Linux 578eb18cd111addec94c43f61cd4b4429e454809, Linux 33daf469f5294b9d07c4fc98216cace9f4f34cc6, Linux 72427dc6f87523995f4e6ae35a948bb2992cabce, Linux 3a3b8e89c7201c5b3b76ac4a4069d1adde1477d6, Linux 4b1270902609ef0d935ed2faa2ea6d122bd148f5. Upgrade Linux to 4b1270902609ef0d935ed2faa2ea6d122bd148f5 or later.

### How do I check if I'm affected by CVE-2025-40223?

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

- other: <https://git.kernel.org/stable/c/5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831>
- other: <https://git.kernel.org/stable/c/578eb18cd111addec94c43f61cd4b4429e454809>
- other: <https://git.kernel.org/stable/c/33daf469f5294b9d07c4fc98216cace9f4f34cc6>
- other: <https://git.kernel.org/stable/c/72427dc6f87523995f4e6ae35a948bb2992cabce>
- other: <https://git.kernel.org/stable/c/f93a84ffb884d761a9d4e869ba29c238711e81f1>
- other: <https://git.kernel.org/stable/c/3a3b8e89c7201c5b3b76ac4a4069d1adde1477d6>
- other: <https://git.kernel.org/stable/c/4b1270902609ef0d935ed2faa2ea6d122bd148f5>

## 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-2025-40223>

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