Re: [PATCH] zloop: fix double-free and use-after-free in zloop_ctl_add()
From: Bilal Hashim
Date: Tue Dec 01 2026 - 13:56:37 EST
Please disregard v1.
On closer verification, disk_release() only invokes fops->free_disk()
when GD_ADDED is set (at the end of add_disk_final()). Therefore, on
blk_revalidate_disk_zones() or add_disk() failure, put_disk() does not
call zloop_free_disk(), the fall-through cleanup in zloop_ctl_add() is
required, and jumping to out in v1 would leak resources.
The pr_info() read use-after-free after transitioning zlo->state to
Zlo_live is still real. I will send a clean v2 in a new thread that
only moves the pr_info() calls before setting Zlo_live.
Sorry for the noise.
Best regards,
Bilal