CVE-2025-39871

Source
https://cve.org/CVERecord?id=CVE-2025-39871
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-39871.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-39871
Downstream
Related
Published
2025-09-23T06:00:44.882Z
Modified
2026-03-20T12:43:05.403626Z
Summary
dmaengine: idxd: Remove improper idxd_free
Details

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

dmaengine: idxd: Remove improper idxd_free

The call to idxdfree() introduces a duplicate putdevice() leading to a reference count underflow: refcountt: underflow; use-after-free. WARNING: CPU: 15 PID: 4428 at lib/refcount.c:28 refcountwarnsaturate+0xbe/0x110 ... Call Trace: <TASK> idxdremove+0xe4/0x120 [idxd] pcideviceremove+0x3f/0xb0 devicereleasedriverinternal+0x197/0x200 driverdetach+0x48/0x90 busremovedriver+0x74/0xf0 pciunregisterdriver+0x2e/0xb0 idxdexitmodule+0x34/0x7a0 [idxd] _dosysdeletemodule.constprop.0+0x183/0x280 dosyscall64+0x54/0xd70 entrySYSCALL64afterhwframe+0x76/0x7e

The idxdunregisterdevices() which is invoked at the very beginning of idxdremove(), already takes care of the necessary putdevice() through the following call path: idxdunregisterdevices() -> deviceunregister() -> putdevice()

In addition, when CONFIGDEBUGKOBJECTRELEASE is enabled, putdevice() may trigger asynchronous cleanup via scheduledelayedwork(). If idxd_free() is called immediately after, it can result in a use-after-free.

Remove the improper idxd_free() to avoid both the refcount underflow and potential memory corruption during module unload.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39871.json"
}
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
68ac5a01f635b3791196fd1c39bc48497252c36f
Fixed
24414bbcb37e1af95190af36c21ae51d497e1a9e
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d2d05fd0fc95c4defed6f7b87550e20e8baa1d97
Fixed
0e95ee7f532b21206fe3f1c4054002b0d21e3b9c
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
21f9f5cd9a0c75084d4369ba0b8c4f695c41dea7
Fixed
dd7a7e43269711d757fc260b0bbdf7138f75de11
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d5449ff1b04dfe9ed8e455769aa01e4c2ccf6805
Fixed
da4fbc1488a4cec6748da685181ee4449a878dac
Fixed
f41c538881eec4dcf5961a242097d447f848cda6
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
2b7a961cea0e5b65afda911f76d14fec5c98d024

Database specific

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