{"id":"CVE-2025-38620","summary":"zloop: fix KASAN use-after-free of tag set","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nzloop: fix KASAN use-after-free of tag set\n\nWhen a zoned loop device, or zloop device, is removed, KASAN enabled\nkernel reports \"BUG KASAN use-after-free\" in blk_mq_free_tag_set(). The\nBUG happens because zloop_ctl_remove() calls put_disk(), which invokes\nzloop_free_disk(). The zloop_free_disk() frees the memory allocated for\nthe zlo pointer. However, after the memory is freed, zloop_ctl_remove()\ncalls blk_mq_free_tag_set(&zlo-\u003etag_set), which accesses the freed zlo.\nHence the KASAN use-after-free.\n\n zloop_ctl_remove()\n  put_disk(zlo-\u003edisk)\n   put_device()\n    kobject_put()\n     ...\n      zloop_free_disk()\n        kvfree(zlo)\n  blk_mq_free_tag_set(&zlo-\u003etag_set)\n\nTo avoid the BUG, move the call to blk_mq_free_tag_set(&zlo-\u003etag_set)\nfrom zloop_ctl_remove() into zloop_free_disk(). This ensures that\nthe tag_set is freed before the call to kvfree(zlo).","modified":"2026-04-02T12:48:03.098053Z","published":"2025-08-22T16:00:24.445Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38620.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/765761851d89c772f482494d452e266795460278"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c7c87046b41a9ef28ee7ac476c369da5b5228bc5"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38620.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38620"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"eb0570c7df23c2f32fe899fcdaf8fca9a5ecd51e"},{"fixed":"c7c87046b41a9ef28ee7ac476c369da5b5228bc5"},{"fixed":"765761851d89c772f482494d452e266795460278"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38620.json"}}],"schema_version":"1.7.5"}