summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/tcp.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@kernel.org>2024-07-22 14:02:20 +0200
committerKeith Busch <kbusch@kernel.org>2024-08-22 22:25:07 +0200
commit5bc46b49c828a6dfaab80b71ecb63fe76a1096d2 (patch)
tree44332206668acf252198d641f849573cfb3cae0a /drivers/nvme/host/tcp.c
parentnvme-tcp: sanitize TLS key handling (diff)
downloadlinux-5bc46b49c828a6dfaab80b71ecb63fe76a1096d2.tar.xz
linux-5bc46b49c828a6dfaab80b71ecb63fe76a1096d2.zip
nvme-tcp: check for invalidated or revoked key
key_lookup() will always return a key, even if that key is revoked or invalidated. So check for invalid keys before continuing. Signed-off-by: Hannes Reinecke <hare@kernel.org> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme/host/tcp.c')
-rw-r--r--drivers/nvme/host/tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index b40e95bee849..89c44413c593 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1596,7 +1596,7 @@ static void nvme_tcp_tls_done(void *data, int status, key_serial_t pskid)
goto out_complete;
}
- tls_key = key_lookup(pskid);
+ tls_key = nvme_tls_key_lookup(pskid);
if (IS_ERR(tls_key)) {
dev_warn(ctrl->ctrl.device, "queue %d: Invalid key %x\n",
qid, pskid);