{"id":"CVE-2025-39870","aliases":["CVE-2025-39870"],"related":[],"kind":"vulnerability","state":"published","title":"dmaengine: idxd: Fix double free in idxd_setup_wqs()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ndmaengine: idxd: Fix double free in idxd_setup_wqs()\n\nThe clean up in idxd_setup_wqs() has had a couple bugs because the error\nhandling is a bit subtle.  It's simpler to just re-write it in a cleaner\nway.  The issues here are:\n\n1) If \"idxd->max_wqs\" is <= 0 then we call put_device(conf_dev) when\n   \"conf_dev\" hasn't been initialized.\n2) If kzalloc_node() fails then again \"conf_dev\" is invalid.  It's\n   either uninitialized or it points to the \"conf_dev\" from the\n   previous iteration so it leads to a double free.\n\nIt's better to free partial loop iterations within the loop and then\nthe unwinding at the end can handle whole loop iterations.  I also\nrenamed the labels to describe what the goto does and not where the goto\nwas located.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ndmaengine: idxd: Fix double free in idxd_setup_wqs()\n\nThe clean up in idxd_setup_wqs() has had a couple bugs because the error\nhandling is a bit subtle.  It's simpler to just re-write it in a cleaner\nway.  The issues here are:\n\n1) If \"idxd->max_wqs\" is <= 0 then we call put_device(conf_dev) when\n   \"conf_dev\" hasn't been initialized.\n2) If kzalloc_node() fails then again \"conf_dev\" is invalid.  It's\n   either uninitialized or it points to the \"conf_dev\" from the\n   previous iteration so it leads to a double free.\n\nIt's better to free partial loop iterations within the loop and then\nthe unwinding at the end can handle whole loop iterations.  I also\nrenamed the labels to describe what the goto does and not where the goto\nwas located.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ndmaengine: idxd: Corrección de doble liberación en idxd_setup_wqs()\n\nLa limpieza en idxd_setup_wqs() ha tenido un par de errores porque el manejo de errores es un poco sutil. Es más simple simplemente reescribirlo de una manera más limpia. Los problemas aquí son:\n\n1) Si 'idxd->max_wqs' es menor o igual que 0, entonces llamamos a put_device(conf_dev) cuando 'conf_dev' no ha sido inicializado.\n2) Si kzalloc_node() falla, entonces nuevamente 'conf_dev' es inválido. Está sin inicializar o apunta al 'conf_dev' de la iteración anterior, lo que lleva a una doble liberación.\n\nEs mejor liberar iteraciones parciales del bucle dentro del bucle y luego el desenrollado al final puede manejar iteraciones completas del bucle. También renombré las etiquetas para describir lo que hace el goto y no dónde estaba ubicado el goto.","source":"nvd"}],"published":"2025-09-23T06:00:44.369Z","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:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-415"],"affected":[{"ranges":[{"type":"git","introduced":"d584acdf54f409cb7eae1359ae6c12aaabedeed8","fixed":"25e6146c2812487a88f619d5ff6efbdcd5b2bc31","status":"affected"},{"type":"git","introduced":"47846211998a9ffb0fcc08092eb95ac783d2b11a","fixed":"df82c7901513fd0fc738052a8e6a330d92cc8ec9","status":"affected"},{"type":"git","introduced":"5fcd392dae6d6aba7dc64ffdbb838ff191315da3","fixed":"ec5430d090d0b6ace8fefa290fc37e88930017d2","status":"affected"},{"type":"git","introduced":"3fd2f4bc010cdfbc07dd21018dc65bd9370eb7a4","fixed":"9f0e225635475b2285b966271d5e82cba74295b1","status":"affected"},{"type":"git","introduced":"3fd2f4bc010cdfbc07dd21018dc65bd9370eb7a4","fixed":"39aaa337449e71a41d4813be0226a722827ba606","status":"affected"},{"type":"git","version":"ed2c66000aa64c0d2621864831f0d04c820a1441","status":"affected"},{"type":"semver","introduced":"6.1.140","fixed":"6.1.153","status":"affected"},{"type":"semver","introduced":"6.6.92","fixed":"6.6.107","status":"affected"},{"type":"semver","introduced":"6.12.30","fixed":"6.12.48","status":"affected"},{"type":"semver","introduced":"6.14.8","fixed":"6.15","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.15","status":"unaffected"},{"type":"semver","introduced":"6.1.153","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.107","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.48","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.16.8","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":"6.1.140","fixed":"6.1.153"},{"status":"affected","introduced":"6.6.92","fixed":"6.6.107"},{"status":"affected","introduced":"6.12.30","fixed":"6.12.48"},{"status":"affected","introduced":"6.14.8","fixed":"6.15"},{"status":"affected","introduced":"6.15.1","fixed":"6.16.8"},{"status":"affected","version":"6.15"},{"status":"affected","version":"6.15"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"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/25e6146c2812487a88f619d5ff6efbdcd5b2bc31","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/df82c7901513fd0fc738052a8e6a330d92cc8ec9","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ec5430d090d0b6ace8fefa290fc37e88930017d2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9f0e225635475b2285b966271d5e82cba74295b1","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/39aaa337449e71a41d4813be0226a722827ba606","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["mailing-list","third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39870","url":"https://www.cve.org/CVERecord?id=CVE-2025-39870","licence":"CVE Terms of Use","modified":"2026-05-23T16:00:52.713Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39870","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39870","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:05.029Z","epss":{"score":0.00251,"percentile":0.09944,"date":"2026-11-30T12:00:22.000Z"}}