Skip to contentSkip to conversation

nvme: kbuild robot fixes

PATCH Superseded Hannes Reinecke 3 participants 10 messages Oct 1, 2025 – Oct 6, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover nvme: kbuild robot fixes

Hi all,

the kbuild robot uncovered some issues when having authentication disabled. This patchset will correct them.

As usual, comments and reviews are welcome.

Hannes Reinecke (3):
nvme-keyring: use correct format specifier
nvme-keyring: typo in nvme_dhchap_psk_lookup()
nvme-auth: move declaration of nvme_auth_extract_key()

 drivers/nvme/common/keyring.c | 2 +-
 drivers/nvme/host/nvme.h      | 9 +++++++++
 drivers/nvme/target/nvmet.h   | 9 +++++++++
 include/linux/nvme-auth.h     | 2 --
 include/linux/nvme-keyring.h  | 2 +-
 5 files changed, 20 insertions(+), 4 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/3 nvme-keyring: use correct format specifier

Use correct format specifier for pr_debug.

---
 drivers/nvme/common/keyring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/common/keyring.c +1 -1
index a58c93c6d495..5fdfaf7abd30 100644
@@ -340,7 +340,7 @@ static int nvme_dhchap_psk_preparse(struct key_preparsed_payload *prep)
 		keylen = 70;
 		break;
 	default:
-		pr_debug("%s: Invalid data length %lu\n", __func__, datalen);
+		pr_debug("%s: Invalid data length %u\n", __func__, datalen);
 		prep->payload.data[0] = NULL;
 		prep->quotalen = 0;
 		return -EINVAL;
Signature · 1 line
2.43.0
maintainer
#3 lore raw

Re: [PATCH 1/3] nvme-keyring: use correct format specifier

In reply to Hannes Reinecke

drivers/nvme/common/keyring.c static int nvme_dhchap_psk_preparse(struct key_preparsed_payload *prep) · line 343

Quoted 6 lines · Hannes Reinecke
drivers/nvme/common/keyring.c +1 -1
@@ -340,7 +340,7 @@ static int nvme_dhchap_psk_preparse(struct key_preparsed_payload *prep)
 		keylen = 70;
 		break;
 	default:
-		pr_debug("%s: Invalid data length %lu\n", __func__, datalen);
+		pr_debug("%s: Invalid data length %u\n", __func__, datalen);

It's still the wrong specifier. size_t should use %zu. I folded that in, pushed out to nvme-6.19.

#4 lore raw

PATCH 2/3 nvme-keyring: typo in nvme_dhchap_psk_lookup()

In reply to Hannes Reinecke

Spurious semicolon in the function stub nvme_dhchap_psk_lookup().

---
 include/linux/nvme-keyring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nvme-keyring.h +1 -1
index d8baa71f061d..6115bf5cf346 100644
@@ -50,7 +50,7 @@ static inline struct key *nvme_dhchap_psk_refresh(struct key *keyring,
 	return ERR_PTR(-ENOTSUPP);
 }
 static inline struct key *nvme_dhchap_psk_lookup(struct key *keyring,
-		const char *hostnqn, const char *subnqn, u8 hmac);
+		const char *hostnqn, const char *subnqn, u8 hmac)
 {
 	return ERR_PTR(-ENOTSUPP);
 }
Signature · 1 line
2.43.0
maintainer
#6 lore raw

Re: [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup()

Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Hannes Reinecke

Spurious semicolon in the function stub nvme_dhchap_psk_lookup().

Looks good. But maybe we should just drop the series and pick up a resend with the fixes folded in?

Yes, I was totally planning to squash and force push, but I'm considering moving this to the -6.19 branch rather than the current window.

#7 lore raw

Re: [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup()

Quoted 8 lines · Keith Busch
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Hannes Reinecke

Spurious semicolon in the function stub nvme_dhchap_psk_lookup().

Quoted 6 lines
Quoted 2 lines

Looks good. But maybe we should just drop the series and pick up a resend with the fixes folded in?

Yes, I was totally planning to squash and force push, but I'm considering moving this to the -6.19 branch rather than the current window.

Yeah, the 6.18 merge window is over.

#8 lore raw

PATCH 3/3 nvme-auth: move declaration of nvme_auth_extract_key()

In reply to Hannes Reinecke

nvme_auth_extract_key() is used outside of the authentication code, so we need to provide a stub function if it's not available.

---
 drivers/nvme/host/nvme.h    | 9 +++++++++
 drivers/nvme/target/nvmet.h | 9 +++++++++
 include/linux/nvme-auth.h   | 2 --
 3 files changed, 18 insertions(+), 2 deletions(-)
drivers/nvme/host/nvme.h +9 -0
index de24185dfbea..8dfd3db8761d 100644
@@ -1179,6 +1179,8 @@ int nvme_auth_negotiate(struct nvme_ctrl *ctrl, int qid);
 int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid);
 void nvme_auth_free(struct nvme_ctrl *ctrl);
 void nvme_auth_revoke_tls_key(struct nvme_ctrl *ctrl);
+struct key *nvme_auth_extract_key(struct key *keyring, const u8 *secret,
+				  size_t secret_len, bool *generated);
 #else
 static inline int nvme_auth_init_ctrl(struct nvme_ctrl *ctrl)
 {
@@ -1202,6 +1204,13 @@ static inline int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid)
 }
 static inline void nvme_auth_free(struct nvme_ctrl *ctrl) {};
 static inline void nvme_auth_revoke_tls_key(struct nvme_ctrl *ctrl) {};
+static inline struct key *nvme_auth_extract_key(struct key *keyring,
+						const u8 *secret,
+						size_t secret_len,
+						bool *generated)
+{
+	return ERR_PTR(-ENOKEY);
+}
 #endif
 
 u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
drivers/nvme/target/nvmet.h +9 -0
index b73d9589e043..49d397e1b678 100644
@@ -895,6 +895,8 @@ void nvmet_execute_auth_receive(struct nvmet_req *req);
 void nvmet_auth_revoke_key(struct nvmet_host *host, bool set_ctrl);
 int nvmet_auth_set_key(struct nvmet_host *host, const char *secret,
 		       bool set_ctrl);
+struct key *nvme_auth_extract_key(struct key *keyring, const u8 *secret,
+				  size_t secret_len, bool *generated);
 int nvmet_auth_set_host_hash(struct nvmet_host *host, const char *hash);
 u8 nvmet_setup_auth(struct nvmet_ctrl *ctrl, struct nvmet_sq *sq);
 void nvmet_auth_sq_init(struct nvmet_sq *sq);
@@ -937,6 +939,13 @@ static inline bool nvmet_has_auth(struct nvmet_ctrl *ctrl,
 }
 static inline const char *nvmet_dhchap_dhgroup_name(u8 dhgid) { return NULL; }
 static inline void nvmet_auth_insert_psk(struct nvmet_sq *sq) {};
+static inline struct key *nvme_auth_extract_key(struct key *keyring,
+						const u8 *secret,
+						size_t secret_len,
+						bool *generated)
+{
+	return ERR_PTR(-ENOKEY);
+}
 #endif
 
 int nvmet_pr_init_ns(struct nvmet_ns *ns);
include/linux/nvme-auth.h +0 -2
index a9ae1d60a5f9..79671dfaa0ac 100644
@@ -18,8 +18,6 @@ const char *nvme_auth_digest_name(u8 hmac_id);
 size_t nvme_auth_hmac_hash_len(u8 hmac_id);
 u8 nvme_auth_hmac_id(const char *hmac_name);
 
-struct key *nvme_auth_extract_key(struct key *keyring, const u8 *secret, size_t secret_len,
-				  bool *generated);
 int nvme_auth_transform_key(struct key *key, char *nqn,
 			    u8 **transformed_secret);
 int nvme_auth_augmented_challenge(u8 hmac_id, u8 *skey, size_t skey_len,
Signature · 1 line
2.43.0
#9 lore raw

Re: [PATCH 3/3] nvme-auth: move declaration of nvme_auth_extract_key()

Review

Quoted 3 lines · Hannes Reinecke

void nvme_auth_revoke_tls_key(struct nvme_ctrl *ctrl);

(quoted diff) +2 -0
+struct key *nvme_auth_extract_key(struct key *keyring, const u8 *secret,
+				  size_t secret_len, bool *generated);

Please use one-tab indent for declarations.

drivers/nvme/host/nvme.h static inline int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid) · line 1211

Quoted 5 lines
drivers/nvme/host/nvme.h +5 -0
+static inline struct key *nvme_auth_extract_key(struct key *keyring,
+						const u8 *secret,
+						size_t secret_len,
+						bool *generated)
+{

And two-tab for definitions.