CVE-2026-139782

comedi: addi_apci_3xxx: fix subdevice count underallocation

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

comedi: addi_apci_3xxx: fix subdevice count underallocation

In apci3xxx_auto_attach(), the number of subdevices is computed with

    n_subdevices = (board->ai_n_chan ? 0 : 1) + board->has_ao + ...

The ternary is inverted: when the board has analog input channels
(ai_n_chan != 0), it counts 0 instead of 1, so the AI subdevice that is
actually created is not accounted for. As a result
comedi_alloc_subdevices() allocates one entry too few, and the later
subdevice initialization (notably the TTL Digital I/O subdevice, which
is populated last) writes past the end of the allocated array, causing a
slab out-of-bounds write.

Flip the ternary to count 1 when ai_n_chan is non-zero and 0 otherwise,
matching the subdevice creation order in the function.

Analysis

AI-generated

Technical impact

The Linux kernel routine that calculates the number of subdevices for an APCI3xxx board underallocates the array when the board has analog input channels. Because the AI subdevice is omitted from the count, the subsequent subdevice initialization writes past the end of the allocated slab, creating a kernel out‑of‑bounds write. This memory corruption can be triggered by supplying a device with malformed configuration data, potentially leading to denial of service or privilege escalation if the corruption can be leveraged to execute code.

Affected Systems

Linux kernel. No specific kernel version information is available, so the vulnerability applies to any release version prior to the commit that corrected the subdevice count logic.

Risk and Exploitability

The CVSS score is not provided, but kernel memory corruption is typically treated as high severity. The EPSS score is unavailable and the vulnerability is not listed in the CISA KEV catalog, indicating no known public exploits. An attacker would need the ability to control the driver that interacts with the APCI3xxx hardware, so the attack vector is local but could impact the entire system if exploited.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a release that contains the comedi addi_apci_3xxx subdevice count fix.
  • If a newer kernel is not yet available, apply the upstream patch manually from the stable commit repository to rebuild the kernel or the affected module.
  • If neither of the above options is immediately feasible, disable or unload the comedi addi_apci_3xxx driver or disconnect the APCI3xxx hardware to avoid triggering the underallocation bug.

Generated by OpenCVE AI on December 1, 2026 at 01:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-119
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: comedi: addi_apci_3xxx: fix subdevice count underallocation In apci3xxx_auto_attach(), the number of subdevices is computed with     n_subdevices = (board->ai_n_chan ? 0 : 1) + board->has_ao + ... The ternary is inverted: when the board has analog input channels (ai_n_chan != 0), it counts 0 instead of 1, so the AI subdevice that is actually created is not accounted for. As a result comedi_alloc_subdevices() allocates one entry too few, and the later subdevice initialization (notably the TTL Digital I/O subdevice, which is populated last) writes past the end of the allocated array, causing a slab out-of-bounds write. Flip the ternary to count 1 when ai_n_chan is non-zero and 0 otherwise, matching the subdevice creation order in the function.
Title comedi: addi_apci_3xxx: fix subdevice count underallocation
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-119

    Improper Restriction of Operations within the Bounds of a Memory Buffer

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:37 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:20 PM
Modified
Nov 30, 2026, 2:20 PM