[PATCH] nvmet-fc: Tear down the association when the admin queue allocation fails

Keith Busch kbusch at kernel.org
Mon Oct 26 09:01:17 PDT 2026


On Mon, Oct 26, 2026 at 06:44:56PM +0800, Guixin Liu wrote:
> When the initial admin queue allocation fails after a new association
> was created, nvmet_fc_ls_create_association() only drops the
> association reference, which frees the association.  By then the
> association is already on the target port's assoc_list, though, and
> removal from that list only happens in nvmet_fc_delete_target_assoc(),
> which this error path never calls.  The freed association stays on the
> list, where later lookups and the port teardown can access it, and the
> target port reference taken at allocation time leaks.
> 
> A remote host can trigger this reliably with a Create Association LS
> requesting a queue too large to allocate.
> 
> Schedule the regular association teardown instead of dropping the
> reference directly.  The teardown removes the association from the
> list and releases the target port reference before the final reference
> drop frees it.

Thanks, applied to nvme-7.4.



More information about the Linux-nvme mailing list