CVE-2025-40223

Source
https://cve.org/CVERecord?id=CVE-2025-40223
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40223.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-40223
Downstream
Related
Published
2025-12-04T15:31:15.158Z
Modified
2026-03-28T17:44:09.934119315Z
Summary
most: usb: Fix use-after-free in hdm_disconnect
Details

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

most: usb: Fix use-after-free in hdm_disconnect

hdmdisconnect() calls mostderegisterinterface(), which eventually unregisters the MOST interface device with deviceunregister(iface->dev). If that drops the last reference, the device core may call releasemdev() immediately while hdmdisconnect() is still executing.

The old code also freed several mdev-owned allocations in hdmdisconnect() and then performed additional putdevice() 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 releasemdev(), so they happen exactly once when the device is truly released, and by dropping the extra putdevice() calls in hdmdisconnect() that are redundant after deviceunregister() and mostderegisterinterface().

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

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40223.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
97a6f772f36b7f52bcfa56a581bbd2470cffe23d
Fixed
5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831
Fixed
578eb18cd111addec94c43f61cd4b4429e454809
Fixed
33daf469f5294b9d07c4fc98216cace9f4f34cc6
Fixed
72427dc6f87523995f4e6ae35a948bb2992cabce
Fixed
f93a84ffb884d761a9d4e869ba29c238711e81f1
Fixed
3a3b8e89c7201c5b3b76ac4a4069d1adde1477d6
Fixed
4b1270902609ef0d935ed2faa2ea6d122bd148f5

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40223.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.9.0
Fixed
5.10.246
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.196
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.158
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.115
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.56
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.17.6

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40223.json"