[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231218153105.12717-15-dwagner@suse.de>
Date: Mon, 18 Dec 2023 16:31:02 +0100
From: Daniel Wagner <dwagner@...e.de>
To: linux-nvme@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
Keith Busch <kbusch@...nel.org>,
James Smart <james.smart@...adcom.com>,
Hannes Reinecke <hare@...e.de>,
Daniel Wagner <dwagner@...e.de>
Subject: [PATCH v3 14/16] nvmet-fc: free hostport after release reference to tgtport
Give the ref back before destroying the hostport object to prevent a
potential UAF.
Signed-off-by: Daniel Wagner <dwagner@...e.de>
---
drivers/nvme/target/fc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 663c51c9fe53..23d8779dc221 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -986,8 +986,8 @@ nvmet_fc_hostport_free(struct kref *ref)
spin_unlock_irqrestore(&tgtport->lock, flags);
if (tgtport->ops->host_release && hostport->invalid)
tgtport->ops->host_release(hostport->hosthandle);
- kfree(hostport);
nvmet_fc_tgtport_put(tgtport);
+ kfree(hostport);
}
static void
--
2.43.0
Powered by blists - more mailing lists