# CVE-2025-39684: comedi: Fix use of uninitialized memory in do\_insn\_ioctl() and do\_insnlist\_ioctl()

> 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.25% (percentile 10, 2026-11-26)
- **CWE:** CWE-908
- **Published:** 2025-09-05T17:20:50.827Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< 868a1b68dcd9f2805bb86aa64862402f785d8c4a; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< ff4a7c18799c7fe999fa56c5cf276e13866b8c1a; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< d84f6e77ebe3359394df32ecd97e0d76a25283dc; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< f3b0c9ec54736f3b8118f93a473d22e11ee65743; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< aecf0d557ddd95ce68193a5ee1dc4c87415ff08a; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< 3cd212e895ca2d58963fdc6422502b10dd3966bb
- Anyone running Linux 2.6.29

## Description

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

comedi: Fix use of uninitialized memory in do\_insn\_ioctl() and do\_insnlist\_ioctl()

syzbot reports a KMSAN kernel-infoleak in \`do\_insn\_ioctl()\`.  A kernel
buffer is allocated to hold \`insn-\>n\` samples (each of which is an
\`unsigned int\`).  For some instruction types, \`insn-\>n\` samples are
copied back to user-space, unless an error code is being returned.  The
problem is that not all the instruction handlers that need to return
data to userspace fill in the whole \`insn-\>n\` samples, so that there is
an information leak.  There is a similar syzbot report for
\`do\_insnlist\_ioctl()\`, although it does not have a reproducer for it at
the time of writing.

One culprit is \`insn\_rw\_emulate\_bits()\` which is used as the handler for
\`INSN\_READ\` or \`INSN\_WRITE\` instructions for subdevices that do not have
a specific handler for that instruction, but do have an \`INSN\_BITS\`
handler.  For \`INSN\_READ\` it only fills in at most 1 sample, so if
\`insn-\>n\` is greater than 1, the remaining \`insn-\>n - 1\` samples copied
to userspace will be uninitialized kernel data.

Another culprit is \`vm80xx\_ai\_insn\_read()\` in the "vm80xx" driver.  It
never returns an error, even if it fails to fill the buffer.

Fix it in \`do\_insn\_ioctl()\` and \`do\_insnlist\_ioctl()\` by making sure
that uninitialized parts of the allocated buffer are zeroed before
handling each instruction.

Thanks to Arnaud Lecomte for their fix to \`do\_insn\_ioctl()\`.  That fix
replaced the call to \`kmalloc\_array()\` with \`kcalloc()\`, but it is not
always necessary to clear the whole buffer.

## Affected and fixed versions

- Linux: \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< 868a1b68dcd9f2805bb86aa64862402f785d8c4a; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< ff4a7c18799c7fe999fa56c5cf276e13866b8c1a; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< d84f6e77ebe3359394df32ecd97e0d76a25283dc; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< f3b0c9ec54736f3b8118f93a473d22e11ee65743; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< aecf0d557ddd95ce68193a5ee1dc4c87415ff08a; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< 3cd212e895ca2d58963fdc6422502b10dd3966bb (cvelist)
- Linux: 2.6.29 (cvelist)

## Mitigation

- Upgrade Linux to 3cd212e895ca2d58963fdc6422502b10dd3966bb 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-39684. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-39684.md
Affected: Linux >= ed9eccbe8970f6eedc1b978c157caf1251a896d4, < 868a1b68dcd9f2805bb86aa64862402f785d8c4a; >= ed9eccbe8970f6eedc1b978c157caf1251a896d4, < ff4a7c18799c7fe999fa56c5cf276e13866b8c1a; >= ed9eccbe8970f6eedc1b978c157caf1251a896d4, < d84f6e77ebe3359394df32ecd97e0d76a25283dc; >= ed9eccbe8970f6eedc1b978…
Fixed in: Linux 868a1b68dcd9f2805bb86aa64862402f785d8c4a, Linux 3cd212e895ca2d58963fdc6422502b10dd3966bb

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-39684 being exploited?

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

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

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

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

Linux \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< 868a1b68dcd9f2805bb86aa64862402f785d8c4a; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< ff4a7c18799c7fe999fa56c5cf276e13866b8c1a; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< d84f6e77ebe3359394df32ecd97e0d76a25283dc; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< f3b0c9ec54736f3b8118f93a473d22e11ee65743; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< aecf0d557ddd95ce68193a5ee1dc4c87415ff08a; \>= ed9eccbe8970f6eedc1b978c157caf1251a896d4, \< 3cd212e895ca2d58963fdc6422502b10dd3966bb; Linux 2.6.29.

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

Yes. Fixed in Linux 868a1b68dcd9f2805bb86aa64862402f785d8c4a, Linux 3cd212e895ca2d58963fdc6422502b10dd3966bb. Upgrade Linux to 3cd212e895ca2d58963fdc6422502b10dd3966bb or later.

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

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/868a1b68dcd9f2805bb86aa64862402f785d8c4a>
- patch: <https://git.kernel.org/stable/c/ff4a7c18799c7fe999fa56c5cf276e13866b8c1a>
- patch: <https://git.kernel.org/stable/c/d84f6e77ebe3359394df32ecd97e0d76a25283dc>
- patch: <https://git.kernel.org/stable/c/f3b0c9ec54736f3b8118f93a473d22e11ee65743>
- patch: <https://git.kernel.org/stable/c/aecf0d557ddd95ce68193a5ee1dc4c87415ff08a>
- patch: <https://git.kernel.org/stable/c/3cd212e895ca2d58963fdc6422502b10dd3966bb>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-032379.html>

## 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-39684>

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