{"id":"CVE-2025-40223","aliases":["CVE-2025-40223"],"related":[],"kind":"vulnerability","state":"published","title":"most: usb: Fix use-after-free in hdm_disconnect","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmost: usb: Fix use-after-free in hdm_disconnect\n\nhdm_disconnect() calls most_deregister_interface(), which eventually\nunregisters the MOST interface device with device_unregister(iface->dev).\nIf that drops the last reference, the device core may call release_mdev()\nimmediately while hdm_disconnect() is still executing.\n\nThe old code also freed several mdev-owned allocations in\nhdm_disconnect() and then performed additional put_device() calls.\nDepending on refcount order, this could lead to use-after-free or\ndouble-free when release_mdev() ran (or when unregister paths also\nperformed puts).\n\nFix by moving the frees of mdev-owned allocations into release_mdev(),\nso they happen exactly once when the device is truly released, and by\ndropping the extra put_device() calls in hdm_disconnect() that are\nredundant after device_unregister() and most_deregister_interface().\n\nThis addresses the KASAN slab-use-after-free reported by syzbot in\nhdm_disconnect(). See report and stack traces in the bug link below.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmost: usb: Fix use-after-free in hdm_disconnect\n\nhdm_disconnect() calls most_deregister_interface(), which eventually\nunregisters the MOST interface device with device_unregister(iface->dev).\nIf that drops the last reference, the device core may call release_mdev()\nimmediately while hdm_disconnect() is still executing.\n\nThe old code also freed several mdev-owned allocations in\nhdm_disconnect() and then performed additional put_device() calls.\nDepending on refcount order, this could lead to use-after-free or\ndouble-free when release_mdev() ran (or when unregister paths also\nperformed puts).\n\nFix by moving the frees of mdev-owned allocations into release_mdev(),\nso they happen exactly once when the device is truly released, and by\ndropping the extra put_device() calls in hdm_disconnect() that are\nredundant after device_unregister() and most_deregister_interface().\n\nThis addresses the KASAN slab-use-after-free reported by syzbot in\nhdm_disconnect(). See report and stack traces in the bug link below.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad:\n\nmost: usb: Corrección de uso después de liberación en hdm_disconnect\n\nhdm_disconnect() llama a most_deregister_interface(), que eventualmente anula el registro del dispositivo de interfaz MOST con device_unregister(iface -> dev). Si eso elimina la última referencia, el núcleo del dispositivo puede llamar a release_mdev() inmediatamente mientras hdm_disconnect() todavía se está ejecutando.\n\nEl código antiguo también liberaba varias asignaciones propiedad de mdev en hdm_disconnect() y luego realizaba llamadas put_device() adicionales. Dependiendo del orden del contador de referencias, esto podría llevar a un uso después de liberación o a una doble liberación cuando se ejecutaba release_mdev() (o cuando las rutas de anulación de registro también realizaban puts).\n\nSe corrige moviendo las liberaciones de asignaciones propiedad de mdev a release_mdev(), para que ocurran exactamente una vez cuando el dispositivo se libera verdaderamente, y eliminando las llamadas put_device() adicionales en hdm_disconnect() que son redundantes después de device_unregister() y most_deregister_interface().\n\nEsto aborda el uso después de liberación de slab de KASAN reportado por syzbot en hdm_disconnect(). Ver informe y rastreos de pila en el enlace del error a continuación.","source":"nvd"}],"published":"2025-12-04T15:31:15.158Z","modified":"2026-10-19T19:10:00.130Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"97a6f772f36b7f52bcfa56a581bbd2470cffe23d","fixed":"5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831","status":"affected"},{"type":"git","introduced":"97a6f772f36b7f52bcfa56a581bbd2470cffe23d","fixed":"578eb18cd111addec94c43f61cd4b4429e454809","status":"affected"},{"type":"git","introduced":"97a6f772f36b7f52bcfa56a581bbd2470cffe23d","fixed":"33daf469f5294b9d07c4fc98216cace9f4f34cc6","status":"affected"},{"type":"git","introduced":"97a6f772f36b7f52bcfa56a581bbd2470cffe23d","fixed":"72427dc6f87523995f4e6ae35a948bb2992cabce","status":"affected"},{"type":"git","introduced":"97a6f772f36b7f52bcfa56a581bbd2470cffe23d","fixed":"f93a84ffb884d761a9d4e869ba29c238711e81f1","status":"affected"},{"type":"git","introduced":"97a6f772f36b7f52bcfa56a581bbd2470cffe23d","fixed":"3a3b8e89c7201c5b3b76ac4a4069d1adde1477d6","status":"affected"},{"type":"git","introduced":"97a6f772f36b7f52bcfa56a581bbd2470cffe23d","fixed":"4b1270902609ef0d935ed2faa2ea6d122bd148f5","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.9","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.9","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/5b5c478f09b1b35e7fe6fc9a1786c9bf6030e831","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/578eb18cd111addec94c43f61cd4b4429e454809","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/33daf469f5294b9d07c4fc98216cace9f4f34cc6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/72427dc6f87523995f4e6ae35a948bb2992cabce","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f93a84ffb884d761a9d4e869ba29c238711e81f1","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3a3b8e89c7201c5b3b76ac4a4069d1adde1477d6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4b1270902609ef0d935ed2faa2ea6d122bd148f5","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-40223","url":"https://www.cve.org/CVERecord?id=CVE-2025-40223","licence":"CVE Terms of Use","modified":"2026-05-11T21:45:10.518Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-40223","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40223","licence":"Public domain","modified":"2026-10-19T19:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:08.263Z","epss":{"score":0.00285,"percentile":0.13591,"date":"2026-11-30T12:00:22.000Z"}}