{"id":"CVE-2025-39684","aliases":["CVE-2025-39684"],"related":[],"kind":"vulnerability","state":"published","title":"comedi: Fix use of uninitialized memory in do_insn_ioctl() and do_insnlist_ioctl()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncomedi: Fix use of uninitialized memory in do_insn_ioctl() and do_insnlist_ioctl()\n\nsyzbot reports a KMSAN kernel-infoleak in `do_insn_ioctl()`.  A kernel\nbuffer is allocated to hold `insn->n` samples (each of which is an\n`unsigned int`).  For some instruction types, `insn->n` samples are\ncopied back to user-space, unless an error code is being returned.  The\nproblem is that not all the instruction handlers that need to return\ndata to userspace fill in the whole `insn->n` samples, so that there is\nan information leak.  There is a similar syzbot report for\n`do_insnlist_ioctl()`, although it does not have a reproducer for it at\nthe time of writing.\n\nOne culprit is `insn_rw_emulate_bits()` which is used as the handler for\n`INSN_READ` or `INSN_WRITE` instructions for subdevices that do not have\na specific handler for that instruction, but do have an `INSN_BITS`\nhandler.  For `INSN_READ` it only fills in at most 1 sample, so if\n`insn->n` is greater than 1, the remaining `insn->n - 1` samples copied\nto userspace will be uninitialized kernel data.\n\nAnother culprit is `vm80xx_ai_insn_read()` in the \"vm80xx\" driver.  It\nnever returns an error, even if it fails to fill the buffer.\n\nFix it in `do_insn_ioctl()` and `do_insnlist_ioctl()` by making sure\nthat uninitialized parts of the allocated buffer are zeroed before\nhandling each instruction.\n\nThanks to Arnaud Lecomte for their fix to `do_insn_ioctl()`.  That fix\nreplaced the call to `kmalloc_array()` with `kcalloc()`, but it is not\nalways necessary to clear the whole buffer.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncomedi: Fix use of uninitialized memory in do_insn_ioctl() and do_insnlist_ioctl()\n\nsyzbot reports a KMSAN kernel-infoleak in `do_insn_ioctl()`.  A kernel\nbuffer is allocated to hold `insn->n` samples (each of which is an\n`unsigned int`).  For some instruction types, `insn->n` samples are\ncopied back to user-space, unless an error code is being returned.  The\nproblem is that not all the instruction handlers that need to return\ndata to userspace fill in the whole `insn->n` samples, so that there is\nan information leak.  There is a similar syzbot report for\n`do_insnlist_ioctl()`, although it does not have a reproducer for it at\nthe time of writing.\n\nOne culprit is `insn_rw_emulate_bits()` which is used as the handler for\n`INSN_READ` or `INSN_WRITE` instructions for subdevices that do not have\na specific handler for that instruction, but do have an `INSN_BITS`\nhandler.  For `INSN_READ` it only fills in at most 1 sample, so if\n`insn->n` is greater than 1, the remaining `insn->n - 1` samples copied\nto userspace will be uninitialized kernel data.\n\nAnother culprit is `vm80xx_ai_insn_read()` in the \"vm80xx\" driver.  It\nnever returns an error, even if it fails to fill the buffer.\n\nFix it in `do_insn_ioctl()` and `do_insnlist_ioctl()` by making sure\nthat uninitialized parts of the allocated buffer are zeroed before\nhandling each instruction.\n\nThanks to Arnaud Lecomte for their fix to `do_insn_ioctl()`.  That fix\nreplaced the call to `kmalloc_array()` with `kcalloc()`, but it is not\nalways necessary to clear the whole buffer.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ncomedi: Corrección del uso de memoria no inicializada en do_insn_ioctl() y do_insnlist_ioctl()\n\nsyzbot informa de una fuga de información del kernel (kernel-infoleak) de KMSAN en 'do_insn_ioctl()'. Se asigna un búfer del kernel para contener 'insn->n' muestras (cada una de las cuales es un 'unsigned int'). Para algunos tipos de instrucción, se copian 'insn->n' muestras de vuelta al espacio de usuario, a menos que se esté devolviendo un código de error. El problema es que no todos los gestores de instrucción que necesitan devolver datos al espacio de usuario rellenan la totalidad de las 'insn->n' muestras, de modo que hay una fuga de información. Hay un informe similar de syzbot para 'do_insnlist_ioctl()', aunque no tiene un reproductor para ello en el momento de escribir esto.\n\nUn culpable es 'insn_rw_emulate_bits()' que se utiliza como gestor para instrucciones 'INSN_READ' o 'INSN_WRITE' para subdispositivos que no tienen un gestor específico para esa instrucción, pero sí tienen un gestor 'INSN_BITS'. Para 'INSN_READ' solo rellena como máximo 1 muestra, así que si 'insn->n' es mayor que 1, las 'insn->n - 1' muestras restantes copiadas al espacio de usuario serán datos del kernel no inicializados.\n\nOtro culpable es 'vm80xx_ai_insn_read()' en el controlador 'vm80xx'. Nunca devuelve un error, incluso si falla al rellenar el búfer.\n\nSe corrige en 'do_insn_ioctl()' y 'do_insnlist_ioctl()' asegurándose de que las partes no inicializadas del búfer asignado se pongan a cero antes de manejar cada instrucción.\n\nGracias a Arnaud Lecomte por su corrección a 'do_insn_ioctl()'. Esa corrección reemplazó la llamada a 'kmalloc_array()' por 'kcalloc()', pero no siempre es necesario limpiar todo el búfer.","source":"nvd"}],"published":"2025-09-05T17:20:50.827Z","modified":"2026-10-19T21:10:00.160Z","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-908"],"affected":[{"ranges":[{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"868a1b68dcd9f2805bb86aa64862402f785d8c4a","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"ff4a7c18799c7fe999fa56c5cf276e13866b8c1a","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"d84f6e77ebe3359394df32ecd97e0d76a25283dc","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"f3b0c9ec54736f3b8118f93a473d22e11ee65743","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"aecf0d557ddd95ce68193a5ee1dc4c87415ff08a","status":"affected"},{"type":"git","introduced":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","fixed":"3cd212e895ca2d58963fdc6422502b10dd3966bb","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.15.190","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.149","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.103","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.44","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.16.4","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","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.29","fixed":"5.15.190"},{"status":"affected","introduced":"5.16","fixed":"6.1.149"},{"status":"affected","introduced":"6.2","fixed":"6.6.103"},{"status":"affected","introduced":"6.7","fixed":"6.12.44"},{"status":"affected","introduced":"6.13","fixed":"6.16.4"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/868a1b68dcd9f2805bb86aa64862402f785d8c4a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ff4a7c18799c7fe999fa56c5cf276e13866b8c1a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d84f6e77ebe3359394df32ecd97e0d76a25283dc","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f3b0c9ec54736f3b8118f93a473d22e11ee65743","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/aecf0d557ddd95ce68193a5ee1dc4c87415ff08a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3cd212e895ca2d58963fdc6422502b10dd3966bb","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39684","url":"https://www.cve.org/CVERecord?id=CVE-2025-39684","licence":"CVE Terms of Use","modified":"2026-05-12T12:06:11.333Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39684","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39684","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:04.261Z","epss":{"score":0.00198,"percentile":0.10115,"date":"2026-12-01T12:00:22.000Z"}}