Linux Kernel comedi addi_apci_3xxx OOB Write via Subdevice Count Bug
CVE-2026-139782 Published on November 30, 2026
comedi: addi_apci_3xxx: fix subdevice count underallocation
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.
Products Associated with CVE-2026-139782
Want to know whenever a new CVE is published for Linux Kernel? stack.watch will email you.
Affected Versions
Linux:- Version 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and below 02a58681b48caf417edfdc100d1e7e28c0e66b97 is affected.
- Version 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and below 2aea3d551ef6b7f1354aab0ccba5d6a189e87e10 is affected.
- Version 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and below 40c86b6d61895bbbd83c774e362e0d2b6b584728 is affected.
- Version 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and below e4a9298361c79fe7c809d61c9a546ddd0cdba566 is affected.
- Version 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and below e4ce30e393f264def20791662865d092cd616776 is affected.
- Version 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and below 6b5f7c695dbbba72b9a5991c084f09454b63bcb8 is affected.
- Version 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and below 0d903b068e85848347f8641c0e51c45636ee4f60 is affected.
- Version 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and below 3de5aa458dede472a253266d02902bd95af8e849 is affected.
- Before 5.10.275 is affected.
- Before 5.15.226 is affected.
- Before 6.1.193 is affected.
- Before 6.6.163 is affected.
- Before 6.12.119 is affected.
- Before 6.18.65 is affected.
- Before 7.3.6 is affected.
- Version 5.10.275, <= 5.10.* is unaffected.
- Version 5.15.226, <= 5.15.* is unaffected.
- Version 6.1.193, <= 6.1.* is unaffected.
- Version 6.6.163, <= 6.6.* is unaffected.
- Version 6.12.119, <= 6.12.* is unaffected.
- Version 6.18.65, <= 6.18.* is unaffected.
- Version 7.3.6, <= 7.3.* is unaffected.
- Version 7.4-rc1, <= * is unaffected.