# CVE-2025-38481: comedi: Fail COMEDI_INSNLIST ioctl if n_insns is too large

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 9% of CVEs (2026-12-01)
- Published: 2025-07-28T11:21:46.147Z
- Modified: 2026-06-17T09:16:57.047Z
- Assigned by: Linux

## Description

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

comedi: Fail COMEDI_INSNLIST ioctl if n_insns is too large

The handling of the `COMEDI_INSNLIST` ioctl allocates a kernel buffer to
hold the array of `struct comedi_insn`, getting the length from the
`n_insns` member of the `struct comedi_insnlist` supplied by the user.
The allocation will fail with a WARNING and a stack dump if it is too
large.

Avoid that by failing with an `-EINVAL` error if the supplied `n_insns`
value is unreasonable.

Define the limit on the `n_insns` value in the `MAX_INSNS` macro.  Set
this to the same value as `MAX_SAMPLES` (65536), which is the maximum
allowed sum of the values of the member `n` in the array of `struct
comedi_insn`, and sensible comedi instructions will have an `n` of at
least 1.

(As written by CVE List.)

## Affected

- Linux Linux: from ed9eccbe8970f6eedc1b978c157caf1251a896d4 before 454d732dfd0aef7d7aa950c409215ca06d717e93; from ed9eccbe8970f6eedc1b978c157caf1251a896d4 before c68257588e87f45530235701a42496b7e9e56adb; from ed9eccbe8970f6eedc1b978c157caf1251a896d4 before 69dc06b9514522de532e997a21d035cd29b0db44; from ed9eccbe8970f6eedc1b978c157caf1251a896d4 before d4c73ce13f5b5a0fe0319f1f352ff602f0ace8e3; from ed9eccbe8970f6eedc1b978c157caf1251a896d4 before c9d3d9667443caafa804cd07940aeaef8e53aa90; from ed9eccbe8970f6eedc1b978c157caf1251a896d4 before 992d600f284e719242a434166e86c1999649b71c; from ed9eccbe8970f6eedc1b978c157caf1251a896d4 before e3b8322cc8081d142ee4c1a43e1d702bdba1ed76; from ed9eccbe8970f6eedc1b978c157caf1251a896d4 before 08ae4b20f5e82101d77326ecab9089e110f224cc; 2.6.29 (not affected: before 2.6.29; from 5.4.297 up to 5.4.*; from 5.10.241 up to 5.10.*; from 5.15.190 up to 5.15.*; from 6.1.147 up to 6.1.*; from 6.6.100 up to 6.6.*; from 6.12.40 up to 6.12.*; from 6.15.8 up to 6.15.*; from 6.16 up to *)
- linux linux_kernel: from 2.6.29 before 5.4.297; from 5.5 before 5.10.241; from 5.11 before 5.15.190; from 5.16 before 6.1.147; from 6.2 before 6.6.100; from 6.7 before 6.12.40; from 6.13 before 6.15.8; 6.16
- debian debian_linux: 11.0

## References

- <https://git.kernel.org/stable/c/454d732dfd0aef7d7aa950c409215ca06d717e93> (patch)
- <https://git.kernel.org/stable/c/c68257588e87f45530235701a42496b7e9e56adb> (patch)
- <https://git.kernel.org/stable/c/69dc06b9514522de532e997a21d035cd29b0db44> (patch)
- <https://git.kernel.org/stable/c/d4c73ce13f5b5a0fe0319f1f352ff602f0ace8e3> (patch)
- <https://git.kernel.org/stable/c/c9d3d9667443caafa804cd07940aeaef8e53aa90> (patch)
- <https://git.kernel.org/stable/c/992d600f284e719242a434166e86c1999649b71c> (patch)
- <https://git.kernel.org/stable/c/e3b8322cc8081d142ee4c1a43e1d702bdba1ed76> (patch)
- <https://git.kernel.org/stable/c/08ae4b20f5e82101d77326ecab9089e110f224cc> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html> (third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html> (third-party-advisory)

## Sources

- CVE List: [CVE-2025-38481](https://www.cve.org/CVERecord?id=CVE-2025-38481), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2025-38481](https://nvd.nist.gov/vuln/detail/CVE-2025-38481), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-38481 · Whole record: https://cve.day/CVE-2025-38481.json · Rebuilt by cve.day 2026-11-25T22:59:01.803Z
