{"id":"CVE-2026-22995","aliases":["CVE-2026-22995"],"related":[],"kind":"vulnerability","state":"published","title":"ublk: fix use-after-free in ublk_partition_scan_work","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nublk: fix use-after-free in ublk_partition_scan_work\n\nA race condition exists between the async partition scan work and device\nteardown that can lead to a use-after-free of ub->ub_disk:\n\n1. ublk_ctrl_start_dev() schedules partition_scan_work after add_disk()\n2. ublk_stop_dev() calls ublk_stop_dev_unlocked() which does:\n   - del_gendisk(ub->ub_disk)\n   - ublk_detach_disk() sets ub->ub_disk = NULL\n   - put_disk() which may free the disk\n3. The worker ublk_partition_scan_work() then dereferences ub->ub_disk\n   leading to UAF\n\nFix this by using ublk_get_disk()/ublk_put_disk() in the worker to hold\na reference to the disk during the partition scan. The spinlock in\nublk_get_disk() synchronizes with ublk_detach_disk() ensuring the worker\neither gets a valid reference or sees NULL and exits early.\n\nAlso change flush_work() to cancel_work_sync() to avoid running the\npartition scan work unnecessarily when the disk is already detached.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nublk: fix use-after-free in ublk_partition_scan_work\n\nA race condition exists between the async partition scan work and device\nteardown that can lead to a use-after-free of ub->ub_disk:\n\n1. ublk_ctrl_start_dev() schedules partition_scan_work after add_disk()\n2. ublk_stop_dev() calls ublk_stop_dev_unlocked() which does:\n   - del_gendisk(ub->ub_disk)\n   - ublk_detach_disk() sets ub->ub_disk = NULL\n   - put_disk() which may free the disk\n3. The worker ublk_partition_scan_work() then dereferences ub->ub_disk\n   leading to UAF\n\nFix this by using ublk_get_disk()/ublk_put_disk() in the worker to hold\na reference to the disk during the partition scan. The spinlock in\nublk_get_disk() synchronizes with ublk_detach_disk() ensuring the worker\neither gets a valid reference or sees NULL and exits early.\n\nAlso change flush_work() to cancel_work_sync() to avoid running the\npartition scan work unnecessarily when the disk is already detached.","source":"cvelist"},{"lang":"es","text":"Se ha resuelto la siguiente vulnerabilidad en el kernel de Linux:\n\nublk: corrige uso después de liberación en ublk_partition_scan_work\n\nExiste una condición de carrera entre el trabajo de escaneo de particiones asíncrono y el desmontaje del dispositivo que puede llevar a un uso después de liberación de ub-&gt;ub_disk:\n\n1. ublk_ctrl_start_dev() programa partition_scan_work después de add_disk()\n2. ublk_stop_dev() llama a ublk_stop_dev_unlocked() que hace:\n   - del_gendisk(ub-&gt;ub_disk)\n   - ublk_detach_disk() establece ub-&gt;ub_disk = NULL\n   - put_disk() que puede liberar el disco\n3. El worker ublk_partition_scan_work() entonces desreferencia ub-&gt;ub_disk llevando a UAF\n\nCorrige esto usando ublk_get_disk()/ublk_put_disk() en el worker para mantener una referencia al disco durante el escaneo de particiones. El spinlock en ublk_get_disk() se sincroniza con ublk_detach_disk() asegurando que el worker o bien obtiene una referencia válida o ve NULL y sale temprano.\n\nTambién cambia flush_work() a cancel_work_sync() para evitar ejecutar innecesariamente el trabajo de escaneo de particiones cuando el disco ya está desmontado.","source":"nvd"}],"published":"2026-01-23T15:24:15.684Z","modified":"2026-06-17T10:20:40.373Z","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-416"],"affected":[{"ranges":[{"type":"git","introduced":"63dfbcd59b4b823eac4441efff10b1c303c8f49f","fixed":"72e28774e9644c2bdbb4920842fbf77103a15a85","status":"affected"},{"type":"git","introduced":"7fc4da6a304bdcd3de14fc946dc2c19437a9cc5a","fixed":"f0d385f6689f37a2828c686fb279121df006b4cb","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"6.18.4","fixed":"6.18.6","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.18.4","fixed":"6.18.6"},{"status":"affected","version":"6.19"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/72e28774e9644c2bdbb4920842fbf77103a15a85","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f0d385f6689f37a2828c686fb279121df006b4cb","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22995","url":"https://www.cve.org/CVERecord?id=CVE-2026-22995","licence":"CVE Terms of Use","modified":"2026-05-11T21:57:58.095Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22995","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22995","licence":"Public domain","modified":"2026-06-17T10:20:40.373Z"}],"updatedAt":"2026-11-25T22:59:13.146Z","epss":{"score":0.00134,"percentile":0.03098,"date":"2026-12-01T12:00:22.000Z"}}