linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] nvme: kbuild robot fixes
@ 2025-10-01 14:21 Hannes Reinecke
  2025-10-01 14:21 ` [PATCH 1/3] nvme-keyring: use correct format specifier Hannes Reinecke
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Hannes Reinecke @ 2025-10-01 14:21 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke

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(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3] nvme-keyring: use correct format specifier
  2025-10-01 14:21 [PATCH 0/3] nvme: kbuild robot fixes Hannes Reinecke
@ 2025-10-01 14:21 ` Hannes Reinecke
  2025-10-03  7:34   ` Christoph Hellwig
  2025-10-06 14:18   ` Keith Busch
  2025-10-01 14:21 ` [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup() Hannes Reinecke
  2025-10-01 14:22 ` [PATCH 3/3] nvme-auth: move declaration of nvme_auth_extract_key() Hannes Reinecke
  2 siblings, 2 replies; 10+ messages in thread
From: Hannes Reinecke @ 2025-10-01 14:21 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke,
	kernel test robot

Use correct format specifier for pr_debug.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509302151.WHyjRfcE-lkp@intel.com/

Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
 drivers/nvme/common/keyring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/common/keyring.c b/drivers/nvme/common/keyring.c
index a58c93c6d495..5fdfaf7abd30 100644
--- a/drivers/nvme/common/keyring.c
+++ b/drivers/nvme/common/keyring.c
@@ -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;
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup()
  2025-10-01 14:21 [PATCH 0/3] nvme: kbuild robot fixes Hannes Reinecke
  2025-10-01 14:21 ` [PATCH 1/3] nvme-keyring: use correct format specifier Hannes Reinecke
@ 2025-10-01 14:21 ` Hannes Reinecke
  2025-10-03  7:35   ` Christoph Hellwig
  2025-10-01 14:22 ` [PATCH 3/3] nvme-auth: move declaration of nvme_auth_extract_key() Hannes Reinecke
  2 siblings, 1 reply; 10+ messages in thread
From: Hannes Reinecke @ 2025-10-01 14:21 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke,
	kernel test robot

Spurious semicolon in the function stub nvme_dhchap_psk_lookup().

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509302259.Yku13u90-lkp@intel.com/
Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
 include/linux/nvme-keyring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/nvme-keyring.h b/include/linux/nvme-keyring.h
index d8baa71f061d..6115bf5cf346 100644
--- a/include/linux/nvme-keyring.h
+++ b/include/linux/nvme-keyring.h
@@ -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);
 }
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] nvme-auth: move declaration of nvme_auth_extract_key()
  2025-10-01 14:21 [PATCH 0/3] nvme: kbuild robot fixes Hannes Reinecke
  2025-10-01 14:21 ` [PATCH 1/3] nvme-keyring: use correct format specifier Hannes Reinecke
  2025-10-01 14:21 ` [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup() Hannes Reinecke
@ 2025-10-01 14:22 ` Hannes Reinecke
  2025-10-03  7:35   ` Christoph Hellwig
  2 siblings, 1 reply; 10+ messages in thread
From: Hannes Reinecke @ 2025-10-01 14:22 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke,
	kernel test robot

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

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509302359.TL1868ni-lkp@intel.com/
Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
 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(-)

diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index de24185dfbea..8dfd3db8761d 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -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,
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
index b73d9589e043..49d397e1b678 100644
--- a/drivers/nvme/target/nvmet.h
+++ b/drivers/nvme/target/nvmet.h
@@ -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);
diff --git a/include/linux/nvme-auth.h b/include/linux/nvme-auth.h
index a9ae1d60a5f9..79671dfaa0ac 100644
--- a/include/linux/nvme-auth.h
+++ b/include/linux/nvme-auth.h
@@ -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,
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] nvme-keyring: use correct format specifier
  2025-10-01 14:21 ` [PATCH 1/3] nvme-keyring: use correct format specifier Hannes Reinecke
@ 2025-10-03  7:34   ` Christoph Hellwig
  2025-10-06 14:18   ` Keith Busch
  1 sibling, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2025-10-03  7:34 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Christoph Hellwig, Keith Busch, Sagi Grimberg, linux-nvme,
	kernel test robot

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup()
  2025-10-01 14:21 ` [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup() Hannes Reinecke
@ 2025-10-03  7:35   ` Christoph Hellwig
  2025-10-03 12:41     ` Keith Busch
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2025-10-03  7:35 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Christoph Hellwig, Keith Busch, Sagi Grimberg, linux-nvme,
	kernel test robot

On Wed, Oct 01, 2025 at 04:21:59PM +0200, Hannes Reinecke wrote:
> Spurious semicolon in the function stub nvme_dhchap_psk_lookup().
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202509302259.Yku13u90-lkp@intel.com/
> Signed-off-by: Hannes Reinecke <hare@kernel.org>

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3] nvme-auth: move declaration of nvme_auth_extract_key()
  2025-10-01 14:22 ` [PATCH 3/3] nvme-auth: move declaration of nvme_auth_extract_key() Hannes Reinecke
@ 2025-10-03  7:35   ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2025-10-03  7:35 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Christoph Hellwig, Keith Busch, Sagi Grimberg, linux-nvme,
	kernel test robot

On Wed, Oct 01, 2025 at 04:22:00PM +0200, Hannes Reinecke wrote:
>  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);

Please use one-tab indent for declarations.

> +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.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup()
  2025-10-03  7:35   ` Christoph Hellwig
@ 2025-10-03 12:41     ` Keith Busch
  2025-10-03 13:12       ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Keith Busch @ 2025-10-03 12:41 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Hannes Reinecke, Sagi Grimberg, linux-nvme, kernel test robot

On Fri, Oct 03, 2025 at 09:35:06AM +0200, Christoph Hellwig wrote:
> On Wed, Oct 01, 2025 at 04:21:59PM +0200, Hannes Reinecke wrote:
> > Spurious semicolon in the function stub nvme_dhchap_psk_lookup().
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202509302259.Yku13u90-lkp@intel.com/
> > Signed-off-by: Hannes Reinecke <hare@kernel.org>
> 
> 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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup()
  2025-10-03 12:41     ` Keith Busch
@ 2025-10-03 13:12       ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2025-10-03 13:12 UTC (permalink / raw)
  To: Keith Busch
  Cc: Christoph Hellwig, Hannes Reinecke, Sagi Grimberg, linux-nvme,
	kernel test robot

On Fri, Oct 03, 2025 at 02:41:55PM +0200, Keith Busch wrote:
> On Fri, Oct 03, 2025 at 09:35:06AM +0200, Christoph Hellwig wrote:
> > On Wed, Oct 01, 2025 at 04:21:59PM +0200, Hannes Reinecke wrote:
> > > Spurious semicolon in the function stub nvme_dhchap_psk_lookup().
> > > 
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Closes: https://lore.kernel.org/oe-kbuild-all/202509302259.Yku13u90-lkp@intel.com/
> > > Signed-off-by: Hannes Reinecke <hare@kernel.org>
> > 
> > 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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] nvme-keyring: use correct format specifier
  2025-10-01 14:21 ` [PATCH 1/3] nvme-keyring: use correct format specifier Hannes Reinecke
  2025-10-03  7:34   ` Christoph Hellwig
@ 2025-10-06 14:18   ` Keith Busch
  1 sibling, 0 replies; 10+ messages in thread
From: Keith Busch @ 2025-10-06 14:18 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Christoph Hellwig, Sagi Grimberg, linux-nvme, kernel test robot

On Wed, Oct 01, 2025 at 04:21:58PM +0200, Hannes Reinecke wrote:
> @@ -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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-10-06 14:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-01 14:21 [PATCH 0/3] nvme: kbuild robot fixes Hannes Reinecke
2025-10-01 14:21 ` [PATCH 1/3] nvme-keyring: use correct format specifier Hannes Reinecke
2025-10-03  7:34   ` Christoph Hellwig
2025-10-06 14:18   ` Keith Busch
2025-10-01 14:21 ` [PATCH 2/3] nvme-keyring: typo in nvme_dhchap_psk_lookup() Hannes Reinecke
2025-10-03  7:35   ` Christoph Hellwig
2025-10-03 12:41     ` Keith Busch
2025-10-03 13:12       ` Christoph Hellwig
2025-10-01 14:22 ` [PATCH 3/3] nvme-auth: move declaration of nvme_auth_extract_key() Hannes Reinecke
2025-10-03  7:35   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).