{"id":"CVE-2026-31749","aliases":["CVE-2026-31749"],"related":[],"kind":"vulnerability","state":"published","title":"comedi: ni_atmio16d: Fix invalid clean-up after failed attach","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncomedi: ni_atmio16d: Fix invalid clean-up after failed attach\n\nIf the driver's COMEDI \"attach\" handler function (`atmio16d_attach()`)\nreturns an error, the COMEDI core will call the driver's \"detach\"\nhandler function (`atmio16d_detach()`) to clean up.  This calls\n`reset_atmio16d()` unconditionally, but depending on where the error\noccurred in the attach handler, the device may not have been\nsufficiently initialized to call `reset_atmio16d()`.  It uses\n`dev->iobase` as the I/O port base address and `dev->private` as the\npointer to the COMEDI device's private data structure.  `dev->iobase`\nmay still be set to its initial value of 0, which would result in\nundesired writes to low I/O port addresses.  `dev->private` may still be\n`NULL`, which would result in null pointer dereferences.\n\nFix `atmio16d_detach()` by checking that `dev->private` is valid\n(non-null) before calling `reset_atmio16d()`.  This implies that\n`dev->iobase` was set correctly since that is set up before\n`dev->private`.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncomedi: ni_atmio16d: Fix invalid clean-up after failed attach\n\nIf the driver's COMEDI \"attach\" handler function (`atmio16d_attach()`)\nreturns an error, the COMEDI core will call the driver's \"detach\"\nhandler function (`atmio16d_detach()`) to clean up.  This calls\n`reset_atmio16d()` unconditionally, but depending on where the error\noccurred in the attach handler, the device may not have been\nsufficiently initialized to call `reset_atmio16d()`.  It uses\n`dev->iobase` as the I/O port base address and `dev->private` as the\npointer to the COMEDI device's private data structure.  `dev->iobase`\nmay still be set to its initial value of 0, which would result in\nundesired writes to low I/O port addresses.  `dev->private` may still be\n`NULL`, which would result in null pointer dereferences.\n\nFix `atmio16d_detach()` by checking that `dev->private` is valid\n(non-null) before calling `reset_atmio16d()`.  This implies that\n`dev->iobase` was set correctly since that is set up before\n`dev->private`.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ncomedi: ni_atmio16d: Corrección de limpieza inválida después de un ’attach’ fallido\n\nSi la función gestora ’attach’ de COMEDI del controlador (’atmio16d_attach()’) devuelve un error, el núcleo de COMEDI llamará a la función gestora ’detach’ del controlador (’atmio16d_detach()’) para realizar la limpieza. Esto llama a ’reset_atmio16d()’ incondicionalmente, pero dependiendo de dónde ocurrió el error en el gestor de ’attach’, el dispositivo podría no haber sido inicializado suficientemente para llamar a ’reset_atmio16d()’. Utiliza ’dev  ->  iobase’ como la dirección base del puerto de E/S y ’dev  ->  private’ como el puntero a la estructura de datos privada del dispositivo COMEDI. ’dev  ->  iobase’ podría seguir establecido a su valor inicial de 0, lo que resultaría en escrituras no deseadas a direcciones de puerto de E/S bajas. ’dev  ->  private’ podría seguir siendo ’NULL’, lo que resultaría en desreferencias de puntero nulo.\n\nCorrige ’atmio16d_detach()’ comprobando que ’dev  ->  private’ es válido (no nulo) antes de llamar a ’reset_atmio16d()’. Esto implica que ’dev  ->  iobase’ se configuró correctamente ya que eso se configura antes que ’dev  ->  private’.","source":"nvd"}],"published":"2026-05-01T14:14:42.227Z","modified":"2026-11-11T21:10:00.200Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"2323b276308a5da5774b778f39c7fd94b2a3022a","fixed":"a01dd339ea6ac58b0967a50085622a6017351140","status":"affected"},{"type":"git","introduced":"2323b276308a5da5774b778f39c7fd94b2a3022a","fixed":"933a2d6a95f9bfb203e562c9be1dd990c735535c","status":"affected"},{"type":"git","introduced":"2323b276308a5da5774b778f39c7fd94b2a3022a","fixed":"5d8d88c8c0eec230de8f1f60e0920a4337939a88","status":"affected"},{"type":"git","introduced":"2323b276308a5da5774b778f39c7fd94b2a3022a","fixed":"f517646e008fe99ca1800601cd011b110f8684ae","status":"affected"},{"type":"git","introduced":"2323b276308a5da5774b778f39c7fd94b2a3022a","fixed":"3848ae00b1642e2c98ff8cbfd2d3b38c6f53b5c3","status":"affected"},{"type":"git","introduced":"2323b276308a5da5774b778f39c7fd94b2a3022a","fixed":"43c68a2c7cc35b7c2a83c285cb4ad3d472b8caa2","status":"affected"},{"type":"git","introduced":"2323b276308a5da5774b778f39c7fd94b2a3022a","fixed":"d07d97ca4f7fac467cdcf4a012690853958b7e89","status":"affected"},{"type":"git","introduced":"2323b276308a5da5774b778f39c7fd94b2a3022a","fixed":"101ab946b79ad83b36d5cfd47de587492a80acf0","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.30","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.30","status":"unaffected"},{"type":"semver","introduced":"5.10.253","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.203","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.168","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.134","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.81","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.22","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.12","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"2.6.30","fixed":"5.10.253"},{"status":"affected","introduced":"5.11","fixed":"5.15.203"},{"status":"affected","introduced":"5.16","fixed":"6.1.168"},{"status":"affected","introduced":"6.2","fixed":"6.6.134"},{"status":"affected","introduced":"6.7","fixed":"6.12.81"},{"status":"affected","introduced":"6.13","fixed":"6.18.22"},{"status":"affected","introduced":"6.19","fixed":"6.19.12"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/a01dd339ea6ac58b0967a50085622a6017351140","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/933a2d6a95f9bfb203e562c9be1dd990c735535c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5d8d88c8c0eec230de8f1f60e0920a4337939a88","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f517646e008fe99ca1800601cd011b110f8684ae","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3848ae00b1642e2c98ff8cbfd2d3b38c6f53b5c3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/43c68a2c7cc35b7c2a83c285cb4ad3d472b8caa2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d07d97ca4f7fac467cdcf4a012690853958b7e89","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/101ab946b79ad83b36d5cfd47de587492a80acf0","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31749","url":"https://www.cve.org/CVERecord?id=CVE-2026-31749","licence":"CVE Terms of Use","modified":"2026-05-11T22:15:02.951Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31749","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31749","licence":"Public domain","modified":"2026-11-11T21:10:00.200Z"}],"updatedAt":"2026-11-25T22:59:20.368Z","epss":{"score":0.00127,"percentile":0.0259,"date":"2026-12-01T12:00:22.000Z"}}