{"id":"CVE-2026-139782","aliases":["CVE-2026-139782"],"related":[],"kind":"vulnerability","state":"published","title":"comedi: addi_apci_3xxx: fix subdevice count underallocation","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncomedi: addi_apci_3xxx: fix subdevice count underallocation\n\nIn apci3xxx_auto_attach(), the number of subdevices is computed with\n\n    n_subdevices = (board->ai_n_chan ? 0 : 1) + board->has_ao + ...\n\nThe ternary is inverted: when the board has analog input channels\n(ai_n_chan != 0), it counts 0 instead of 1, so the AI subdevice that is\nactually created is not accounted for. As a result\ncomedi_alloc_subdevices() allocates one entry too few, and the later\nsubdevice initialization (notably the TTL Digital I/O subdevice, which\nis populated last) writes past the end of the allocated array, causing a\nslab out-of-bounds write.\n\nFlip the ternary to count 1 when ai_n_chan is non-zero and 0 otherwise,\nmatching the subdevice creation order in the function.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncomedi: addi_apci_3xxx: fix subdevice count underallocation\n\nIn apci3xxx_auto_attach(), the number of subdevices is computed with\n\n    n_subdevices = (board->ai_n_chan ? 0 : 1) + board->has_ao + ...\n\nThe ternary is inverted: when the board has analog input channels\n(ai_n_chan != 0), it counts 0 instead of 1, so the AI subdevice that is\nactually created is not accounted for. As a result\ncomedi_alloc_subdevices() allocates one entry too few, and the later\nsubdevice initialization (notably the TTL Digital I/O subdevice, which\nis populated last) writes past the end of the allocated array, causing a\nslab out-of-bounds write.\n\nFlip the ternary to count 1 when ai_n_chan is non-zero and 0 otherwise,\nmatching the subdevice creation order in the function.","source":"cvelist"}],"published":"2026-11-30T13:37:57.259Z","modified":"2026-11-30T14:20:11.500Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"02a58681b48caf417edfdc100d1e7e28c0e66b97","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"2aea3d551ef6b7f1354aab0ccba5d6a189e87e10","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"40c86b6d61895bbbd83c774e362e0d2b6b584728","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"e4a9298361c79fe7c809d61c9a546ddd0cdba566","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"e4ce30e393f264def20791662865d092cd616776","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"6b5f7c695dbbba72b9a5991c084f09454b63bcb8","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"0d903b068e85848347f8641c0e51c45636ee4f60","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"3de5aa458dede472a253266d02902bd95af8e849","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.10.275","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.15.226","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.1.193","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.6.163","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.12.119","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.18.65","status":"affected"},{"type":"semver","introduced":"0","fixed":"7.3.6","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.119","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.65","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.6","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/02a58681b48caf417edfdc100d1e7e28c0e66b97","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2aea3d551ef6b7f1354aab0ccba5d6a189e87e10","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/40c86b6d61895bbbd83c774e362e0d2b6b584728","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e4a9298361c79fe7c809d61c9a546ddd0cdba566","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e4ce30e393f264def20791662865d092cd616776","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6b5f7c695dbbba72b9a5991c084f09454b63bcb8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0d903b068e85848347f8641c0e51c45636ee4f60","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3de5aa458dede472a253266d02902bd95af8e849","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139782","url":"https://www.cve.org/CVERecord?id=CVE-2026-139782","licence":"CVE Terms of Use","modified":"2026-11-30T13:37:57.259Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139782","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139782","licence":"Public domain","modified":"2026-11-30T14:20:11.500Z"}],"updatedAt":"2026-11-30T14:33:42.654Z","epss":{"score":0.00345,"percentile":0.30024,"date":"2026-12-01T12:00:22.000Z"}}