summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorHannes Reinecke <hare@kernel.org>2024-07-22 15:02:20 +0300
committerKeith Busch <kbusch@kernel.org>2024-08-22 23:25:07 +0300
commit5bc46b49c828a6dfaab80b71ecb63fe76a1096d2 (patch)
tree44332206668acf252198d641f849573cfb3cae0a /include/linux
parent363895767fbfa05891b0b4d9e06ebde7a10c6a07 (diff)
downloadlinux-5bc46b49c828a6dfaab80b71ecb63fe76a1096d2.tar.xz
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 'include/linux')
-rw-r--r--include/linux/nvme-keyring.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/nvme-keyring.h b/include/linux/nvme-keyring.h
index e10333d78dbb..19d2b256180f 100644
--- a/include/linux/nvme-keyring.h
+++ b/include/linux/nvme-keyring.h
@@ -12,7 +12,7 @@ key_serial_t nvme_tls_psk_default(struct key *keyring,
const char *hostnqn, const char *subnqn);
key_serial_t nvme_keyring_id(void);
-
+struct key *nvme_tls_key_lookup(key_serial_t key_id);
#else
static inline key_serial_t nvme_tls_psk_default(struct key *keyring,
@@ -24,5 +24,9 @@ static inline key_serial_t nvme_keyring_id(void)
{
return 0;
}
+static inline struct key *nvme_tls_key_lookup(key_serial_t key_id)
+{
+ return ERR_PTR(-ENOTSUPP);
+}
#endif /* !CONFIG_NVME_KEYRING */
#endif /* _NVME_KEYRING_H */