[PATCH v2 3/5] nvmet: complete the passthru request after applying command effects
Nilay Shroff
nilay at linux.ibm.com
Thu Dec 3 07:26:40 PST 2026
On 12/2/26 5:28 PM, Guixin Liu wrote:
> nvmet_passthru_execute_cmd_work() completes the target request before
> applying the command effects. With the loop transport the nvmet_req is
> embedded in the host request's pdu, and completing it lets the submitter
> free that request, so the subsequent nvme_passthru_end() read of
> req->cmd is a use-after-free. Completing early also drops the passthru
> reference that keeps the backend controller alive across
> nvme_passthru_end().
>
> Apply the effects before completing the target request. The backend
> request is still freed first, so it is idle before nvme_passthru_end()
> flushes scan_work and the reset deadlock does not return.
>
> Fixes: bc8fb906b0ff9 ("nvme: handle effects after freeing the request")
> Cc:stable at vger.kernel.org
> Signed-off-by: Guixin Liu<kanie at linux.alibaba.com>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>
More information about the Linux-nvme
mailing list