[PATCH] nvmet-fc: hold queue reference while freeing FCP IOD
Greg KH
gregkh at linuxfoundation.org
Wed Nov 25 05:48:57 PST 2026
On Wed, Nov 25, 2026 at 07:54:44PM +0800, Bin Luo wrote:
> nvmet_fc_free_fcp_iod() drops the FOD's lookup reference before it locks
> queue->qlock and accesses the queue lists. Association teardown may already
> have dropped the owner reference, so this put can free the queue before
> completion accesses it.
>
> Take a temporary queue reference before dropping the FOD reference. Hold it
> through queue/list accesses and deferred-work submission.
> Release it on both FOD-return and FOD-reuse paths. The deferred request's
> lookup reference stays with the recycled FOD.
>
> Fixes: 619c62dcc62b ("nvmet-fc: correct ref counting error when deferred rcv used")
>
> Tested: v7.4-rc1 KASAN_GENERIC x86_64 QEMU with a test-only owner-reference
> injection. Unfixed baseline reports UAF; both patched runs have no KASAN.
That's not a valid tag.
And no empty line between Fixes: and your signed-off-by.
thanks,
greg k-h
More information about the Linux-nvme
mailing list