]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
nvme-pci: Fix abort command id
authorKeith Busch <kbusch@kernel.org>
Thu, 7 Oct 2021 06:50:31 +0000 (23:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:45:03 +0000 (11:45 +0200)
commit 85f74acf097a63a07f5a7c215db6883e5c35e3ff upstream.

The request tag is no longer the only component of the command id.

Fixes: e7006de6c2380 ("nvme: code command_id with a genctr for use-after-free validation")
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/host/pci.c

index d79abb88a0c627d3f72f94a613116435effbbc38..1b85349f57af0f278f10874c4149a4ff50254af5 100644 (file)
@@ -1342,7 +1342,7 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
 
        memset(&cmd, 0, sizeof(cmd));
        cmd.abort.opcode = nvme_admin_abort_cmd;
-       cmd.abort.cid = req->tag;
+       cmd.abort.cid = nvme_cid(req);
        cmd.abort.sqid = cpu_to_le16(nvmeq->qid);
 
        dev_warn(nvmeq->dev->ctrl.device,