{"id":"CVE-2024-56764","state":"PUBLISHED","title":"ublk: detach gendisk from ublk device if add_disk() fails","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nublk: detach gendisk from ublk device if add_disk() fails\n\nInside ublk_abort_requests(), gendisk is grabbed for aborting all\ninflight requests. And ublk_abort_requests() is called when exiting\nthe uring context or handling timeout.\n\nIf add_disk() fails, the gendisk may have been freed when calling\nublk_abort_requests(), so use-after-free can be caused when getting\ndisk's reference in ublk_abort_requests().\n\nFixes the bug by detaching gendisk from ublk device if add_disk() fails.","publishedAt":"2025-01-06T16:20:43.256Z","updatedAt":"2026-08-05T11:46:24.574Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bd23f6c2c2d00518e2f27f2d25cef795de9bee56","status":"affected","lessThan":"7d680f2f76a3417fdfc3946da7471e81464f7b41","versionType":"git"},{"version":"bd23f6c2c2d00518e2f27f2d25cef795de9bee56","status":"affected","lessThan":"75cd4005da5492129917a4a4ee45e81660556104","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/ublk_drv.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.7","versionType":"semver"},{"version":"6.12.8","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/ublk_drv.c"]}],"references":["https://git.kernel.org/stable/c/7d680f2f76a3417fdfc3946da7471e81464f7b41","https://git.kernel.org/stable/c/75cd4005da5492129917a4a4ee45e81660556104"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:08:12.933Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/56xxx/CVE-2024-56764.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-56764","state":"PUBLISHED","datePublished":"2025-01-06T16:20:43.256Z","dateUpdated":"2026-08-05T11:46:24.574Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T11:26:39.762Z"},"containers":{"cna":{"title":"ublk: detach gendisk from ublk device if add_disk() fails","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nublk: detach gendisk from ublk device if add_disk() fails\n\nInside ublk_abort_requests(), gendisk is grabbed for aborting all\ninflight requests. And ublk_abort_requests() is called when exiting\nthe uring context or handling timeout.\n\nIf add_disk() fails, the gendisk may have been freed when calling\nublk_abort_requests(), so use-after-free can be caused when getting\ndisk's reference in ublk_abort_requests().\n\nFixes the bug by detaching gendisk from ublk device if add_disk() fails."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bd23f6c2c2d00518e2f27f2d25cef795de9bee56","status":"affected","lessThan":"7d680f2f76a3417fdfc3946da7471e81464f7b41","versionType":"git"},{"version":"bd23f6c2c2d00518e2f27f2d25cef795de9bee56","status":"affected","lessThan":"75cd4005da5492129917a4a4ee45e81660556104","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/ublk_drv.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.7","versionType":"semver"},{"version":"6.12.8","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/ublk_drv.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/7d680f2f76a3417fdfc3946da7471e81464f7b41"},{"url":"https://git.kernel.org/stable/c/75cd4005da5492129917a4a4ee45e81660556104"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerability is reached through an io_uring passthrough control command on the local /dev/ublk-control device; no network vector exists.\nAC:L - After add_disk() fails, ub->ub_disk is a persistent dangling pointer (not a narrow race window), and the attacker deterministically triggers the abort path by exiting the io_uring daemon they control.\nPR:L - ublk explicitly supports UBLK_F_UNPRIVILEGED_DEV, allowing a non-CAP_SYS_ADMIN user to create and start a user-owned ublk device, so an unprivileged local user can reach ublk_ctrl_start_dev().\nUI:N - The attacker performs all steps (create device, run daemon, start dev, exit daemon) with no victim interaction required.\nS:U - The use-after-free is confined to the kernel's own memory and privilege domain with no crossing of a security boundary.\nC:H - The UAF on the freed gendisk can be reallocated and sprayed by the attacker, enabling disclosure of controlled/adjacent kernel memory contents.\nI:H - The UAF writes into freed memory (get_device refcount) and dereferences disk->queue, giving heap-spray-based write/control-flow primitives.\nA:H - Dereferencing and modifying the freed gendisk reliably causes kernel memory corruption and oops/panic."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:46:24.574Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.7","versionEndExcluding":"6.12.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.7","versionEndExcluding":"6.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-56764","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-02-11T15:41:19.788451Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-02-11T15:45:20.712Z"}}]}}}