CVE-2025-38687
comedi: fix race between polling and detaching
Mitigation
- Upgrade Linux to 35b6fc51c666fc96355be5cd633ed0fe4ccf68b2 or later.
Who should check
- Anyone running Linux >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < fe67122ba781df44a1a9716eb1dfd751321ab512; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < cd4286123d6948ff638ea9cd5818ae4796d5d252; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < d85fac8729c9acfd72368faff1d576ec585e5c8f; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 0f989f9d05492028afd2bded4b42023c57d8a76e; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 5c4a2ffcbd052c69bbf4680677d4c4eaa5a252d4; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 017198079551a2a5cf61eae966af3c4b145e1f3b; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 71ca60d2e631cf9c63bcbc7017961c61ff04e419; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 5724e82df4f9a4be62908362c97d522d25de75dd; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 35b6fc51c666fc96355be5cd633ed0fe4ccf68b2
- Anyone running Linux 3.14
Vulnerability facts
- Affected
- Linux >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < fe67122ba781df44a1a9716eb1dfd751321ab512; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < cd4286123d6948ff638ea9cd5818ae4796d5d252; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < d85fac8729c9acfd72368faff1d576ec585e5c8f; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 0f989f9d05492028afd2bded4b42023c57d8a76e; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 5c4a2ffcbd052c69bbf4680677d4c4eaa5a252d4; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 017198079551a2a5cf61eae966af3c4b145e1f3b; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 71ca60d2e631cf9c63bcbc7017961c61ff04e419; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 5724e82df4f9a4be62908362c97d522d25de75dd; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 35b6fc51c666fc96355be5cd633ed0fe4ccf68b2; Linux 3.14
- Fixed in
- Linux 0f989f9d05492028afd2bded4b42023c57d8a76e, Linux 5c4a2ffcbd052c69bbf4680677d4c4eaa5a252d4, Linux 017198079551a2a5cf61eae966af3c4b145e1f3b, Linux 71ca60d2e631cf9c63bcbc7017961c61ff04e419, Linux 5724e82df4f9a4be62908362c97d522d25de75dd, Linux 35b6fc51c666fc96355be5cd633ed0fe4ccf68b2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.3 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: Low
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 0.20% chance of exploitation in 30 days (percentile 6, 2026-11-26)
- CWE
- CWE-362
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: comedi: fix race between polling and detaching syzbot reports a use-after-free in comedi in the below link, which is due to comedi gladly removing the allocated async area even though poll requests are still active on the wait_queue_head inside of it. This can cause a use-after-free when the poll entries are later triggered or removed, as the memory for the wait_queue_head has been freed. We need to check there are no tasks queued on any of the subdevices' wait queues before allowing the device to be detached by the `COMEDI_DEVCONFIG` ioctl. Tasks will read-lock `dev->attach_lock` before adding themselves to the subdevice wait queue, so fix the problem in the `COMEDI_DEVCONFIG` ioctl handler by write-locking `dev->attach_lock` before checking that all of the subdevices are safe to be deleted. This includes testing for any sleepers on the subdevices' wait queues. It remains locked until the device has been detached. This requires the `comedi_device_detach()` function to be refactored slightly, moving the bulk of it into new function `comedi_device_detach_locked()`. Note that the refactor of `comedi_device_detach()` results in `comedi_device_cancel_all()` now being called while `dev->attach_lock` is write-locked, which wasn't the case previously, but that does not matter. Thanks to Jens Axboe for diagnosing the problem and co-developing this patch.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < fe67122ba781df44a1a9716eb1dfd751321ab512; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < cd4286123d6948ff638ea9cd5818ae4796d5d252; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < d85fac8729c9acfd72368faff1d576ec585e5c8f; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 0f989f9d05492028afd2bded4b42023c57d8a76e; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 5c4a2ffcbd052c69bbf4680677d4c4eaa5a252d4; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 017198079551a2a5cf61eae966af3c4b145e1f3b; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 71ca60d2e631cf9c63bcbc7017961c61ff04e419; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 5724e82df4f9a4be62908362c97d522d25de75dd; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 35b6fc51c666fc96355be5cd633ed0fe4ccf68b2 | — | cvelist |
| Linux | 3.14 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-38687. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-38687.md Affected: Linux >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < fe67122ba781df44a1a9716eb1dfd751321ab512; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < cd4286123d6948ff638ea9cd5818ae4796d5d252; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < d85fac8729c9acfd72368faff1d576ec585e5c8f; >= 2f3fdcd7ce935f6f2899cea… Fixed in: Linux 0f989f9d05492028afd2bded4b42023c57d8a76e, Linux 5c4a2ffcbd052c69bbf4680677d4c4eaa5a252d4, Linux 017198079551a2a5cf61eae966af3c4b145e1f3b, Linux 71ca60d2e631cf9c63bcbc7017961c61ff04e419, Linux 5724e82df4f9a4be62908362c97d522d25de75dd, Linux 35b6fc51c666fc96355be5cd633ed0fe4ccf68b2 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.
References
Patches
- https://git.kernel.org/stable/c/fe67122ba781df44a1a9716eb1dfd751321ab512
- https://git.kernel.org/stable/c/cd4286123d6948ff638ea9cd5818ae4796d5d252
- https://git.kernel.org/stable/c/d85fac8729c9acfd72368faff1d576ec585e5c8f
- https://git.kernel.org/stable/c/0f989f9d05492028afd2bded4b42023c57d8a76e
- https://git.kernel.org/stable/c/5c4a2ffcbd052c69bbf4680677d4c4eaa5a252d4
- https://git.kernel.org/stable/c/017198079551a2a5cf61eae966af3c4b145e1f3b
- https://git.kernel.org/stable/c/71ca60d2e631cf9c63bcbc7017961c61ff04e419
- https://git.kernel.org/stable/c/5724e82df4f9a4be62908362c97d522d25de75dd
- https://git.kernel.org/stable/c/35b6fc51c666fc96355be5cd633ed0fe4ccf68b2
FAQ
Is CVE-2025-38687 being exploited?
There is no confirmed exploitation: CVE-2025-38687 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.20% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-38687?
High: CVSS 7.3 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2025-38687?
Linux >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < fe67122ba781df44a1a9716eb1dfd751321ab512; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < cd4286123d6948ff638ea9cd5818ae4796d5d252; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < d85fac8729c9acfd72368faff1d576ec585e5c8f; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 0f989f9d05492028afd2bded4b42023c57d8a76e; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 5c4a2ffcbd052c69bbf4680677d4c4eaa5a252d4; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 017198079551a2a5cf61eae966af3c4b145e1f3b; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 71ca60d2e631cf9c63bcbc7017961c61ff04e419; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 5724e82df4f9a4be62908362c97d522d25de75dd; >= 2f3fdcd7ce935f6f2899ceab57dc8fe5286db3e1, < 35b6fc51c666fc96355be5cd633ed0fe4ccf68b2; Linux 3.14.
Is there a fix for CVE-2025-38687?
Yes. Fixed in Linux 0f989f9d05492028afd2bded4b42023c57d8a76e, Linux 5c4a2ffcbd052c69bbf4680677d4c4eaa5a252d4, Linux 017198079551a2a5cf61eae966af3c4b145e1f3b, Linux 71ca60d2e631cf9c63bcbc7017961c61ff04e419, Linux 5724e82df4f9a4be62908362c97d522d25de75dd, Linux 35b6fc51c666fc96355be5cd633ed0fe4ccf68b2. Upgrade Linux to 35b6fc51c666fc96355be5cd633ed0fe4ccf68b2 or later.
How do I check if I'm affected by CVE-2025-38687?
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.