{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2"
            },
            {
              "fixed": "02a58681b48caf417edfdc100d1e7e28c0e66b97"
            },
            {
              "fixed": "2aea3d551ef6b7f1354aab0ccba5d6a189e87e10"
            },
            {
              "fixed": "40c86b6d61895bbbd83c774e362e0d2b6b584728"
            },
            {
              "fixed": "e4a9298361c79fe7c809d61c9a546ddd0cdba566"
            },
            {
              "fixed": "e4ce30e393f264def20791662865d092cd616776"
            },
            {
              "fixed": "6b5f7c695dbbba72b9a5991c084f09454b63bcb8"
            },
            {
              "fixed": "0d903b068e85848347f8641c0e51c45636ee4f60"
            },
            {
              "fixed": "3de5aa458dede472a253266d02902bd95af8e849"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "5.10.275"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.11.0"
            },
            {
              "fixed": "5.15.226"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.16.0"
            },
            {
              "fixed": "6.1.193"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.2.0"
            },
            {
              "fixed": "6.6.163"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.7.0"
            },
            {
              "fixed": "6.12.119"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.13.0"
            },
            {
              "fixed": "6.18.65"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "7.3.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139782.json"
  },
  "details": "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-\u003eai_n_chan ? 0 : 1) + board-\u003ehas_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.",
  "id": "CVE-2026-139782",
  "modified": "2026-11-30T14:45:31.534220829Z",
  "published": "2026-11-30T13:37:57.259Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/02a58681b48caf417edfdc100d1e7e28c0e66b97"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/0d903b068e85848347f8641c0e51c45636ee4f60"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/2aea3d551ef6b7f1354aab0ccba5d6a189e87e10"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/3de5aa458dede472a253266d02902bd95af8e849"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/40c86b6d61895bbbd83c774e362e0d2b6b584728"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/6b5f7c695dbbba72b9a5991c084f09454b63bcb8"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/e4a9298361c79fe7c809d61c9a546ddd0cdba566"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/e4ce30e393f264def20791662865d092cd616776"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139782.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-139782"
    }
  ],
  "schema_version": "1.9.2",
  "summary": "comedi: addi_apci_3xxx: fix subdevice count underallocation"
}