{"id":"CVE-2025-40106","aliases":["CVE-2025-40106"],"related":[],"kind":"vulnerability","state":"published","title":"comedi: fix divide-by-zero in comedi_buf_munge()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncomedi: fix divide-by-zero in comedi_buf_munge()\n\nThe comedi_buf_munge() function performs a modulo operation\n`async->munge_chan %= async->cmd.chanlist_len` without first\nchecking if chanlist_len is zero. If a user program submits a command with\nchanlist_len set to zero, this causes a divide-by-zero error when the device\nprocesses data in the interrupt handler path.\n\nAdd a check for zero chanlist_len at the beginning of the\nfunction, similar to the existing checks for !map and\nCMDF_RAWDATA flag. When chanlist_len is zero, update\nmunge_count and return early, indicating the data was\nhandled without munging.\n\nThis prevents potential kernel panics from malformed user commands.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncomedi: fix divide-by-zero in comedi_buf_munge()\n\nThe comedi_buf_munge() function performs a modulo operation\n`async->munge_chan %= async->cmd.chanlist_len` without first\nchecking if chanlist_len is zero. If a user program submits a command with\nchanlist_len set to zero, this causes a divide-by-zero error when the device\nprocesses data in the interrupt handler path.\n\nAdd a check for zero chanlist_len at the beginning of the\nfunction, similar to the existing checks for !map and\nCMDF_RAWDATA flag. When chanlist_len is zero, update\nmunge_count and return early, indicating the data was\nhandled without munging.\n\nThis prevents potential kernel panics from malformed user commands.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ncomedi: corrección de división por cero en comedi_buf_munge()\n\nLa función comedi_buf_munge() realiza una operación de módulo 'async->munge_chan %= async->cmd.chanlist_len' sin comprobar primero si chanlist_len es cero. Si un programa de usuario envía un comando con chanlist_len establecido en cero, esto causa un error de división por cero cuando el dispositivo procesa datos en la ruta del gestor de interrupciones.\n\nAñadir una comprobación para chanlist_len cero al principio de la función, similar a las comprobaciones existentes para !map y el flag CMDF_RAWDATA. Cuando chanlist_len es cero, actualizar munge_count y retornar anticipadamente, indicando que los datos fueron gestionados sin munging.\n\nEsto previene posibles pánicos del kernel de comandos de usuario malformados.","source":"nvd"}],"published":"2025-10-31T09:41:46.740Z","modified":"2026-10-19T21:10:00.160Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"4ffea48c69cb2b96a281cb7e5e42d706996631db","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"8f3e4cd9be4b47246ea73ce5e3e0fa2f57f0d10c","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"2670932f2465793fea1ef073e40883e8390fa4d9","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"6db19822512396be1a3e1e20c16c97270285ba1a","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"d4854eff25efb06d0d84c13e7129bbdba4125f8c","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"a4bb5d1bc2f238461bcbe5303eb500466690bb2c","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"55520f65fd447e04099a2c44185453c18ea73b7e","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"87b318ba81dda2ee7b603f4f6c55e78ec3e95974","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.29","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.29","status":"unaffected"},{"type":"semver","introduced":"5.4.301","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.246","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.196","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.158","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.115","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.56","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.17.6","lastAffected":"6.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.18","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/4ffea48c69cb2b96a281cb7e5e42d706996631db","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8f3e4cd9be4b47246ea73ce5e3e0fa2f57f0d10c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2670932f2465793fea1ef073e40883e8390fa4d9","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6db19822512396be1a3e1e20c16c97270285ba1a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d4854eff25efb06d0d84c13e7129bbdba4125f8c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a4bb5d1bc2f238461bcbe5303eb500466690bb2c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/55520f65fd447e04099a2c44185453c18ea73b7e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/87b318ba81dda2ee7b603f4f6c55e78ec3e95974","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-40106","url":"https://www.cve.org/CVERecord?id=CVE-2025-40106","licence":"CVE Terms of Use","modified":"2026-05-11T21:42:37.892Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-40106","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40106","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:07.079Z","epss":{"score":0.0021,"percentile":0.11785,"date":"2026-12-01T12:00:22.000Z"}}