linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/4] nvme-keyring: kbuild fixes
@ 2025-10-01 15:13 Hannes Reinecke
  2025-10-01 15:13 ` [PATCH 1/4] nvme-keyring: use correct format specifier Hannes Reinecke
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Hannes Reinecke @ 2025-10-01 15:13 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 (4):
  nvme-keyring: use correct format specifier
  nvme-keyring: typo in nvme_dhchap_psk_lookup()
  nvme-fabrics: make call to nvme_auth_extract_key() conditional
  nvme-keyring: fixup declaration of nvme_dhchap_psk_hash()

 drivers/nvme/common/keyring.c |  2 +-
 drivers/nvme/host/fabrics.c   | 10 ++++++++++
 include/linux/nvme-keyring.h  |  4 ++--
 3 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.43.0



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

* [PATCH 1/4] nvme-keyring: use correct format specifier
  2025-10-01 15:13 [PATCHv2 0/4] nvme-keyring: kbuild fixes Hannes Reinecke
@ 2025-10-01 15:13 ` Hannes Reinecke
  2025-10-01 15:13 ` [PATCH 2/4] nvme-keyring: typo in nvme_dhchap_psk_lookup() Hannes Reinecke
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Hannes Reinecke @ 2025-10-01 15:13 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..1de07e8a8f73 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 %zu\n", __func__, datalen);
 		prep->payload.data[0] = NULL;
 		prep->quotalen = 0;
 		return -EINVAL;
-- 
2.43.0



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

* [PATCH 2/4] nvme-keyring: typo in nvme_dhchap_psk_lookup()
  2025-10-01 15:13 [PATCHv2 0/4] nvme-keyring: kbuild fixes Hannes Reinecke
  2025-10-01 15:13 ` [PATCH 1/4] nvme-keyring: use correct format specifier Hannes Reinecke
@ 2025-10-01 15:13 ` Hannes Reinecke
  2025-10-01 15:13 ` [PATCH 3/4] nvme-fabrics: make call to nvme_auth_extract_key() conditional Hannes Reinecke
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Hannes Reinecke @ 2025-10-01 15:13 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] 6+ messages in thread

* [PATCH 3/4] nvme-fabrics: make call to nvme_auth_extract_key() conditional
  2025-10-01 15:13 [PATCHv2 0/4] nvme-keyring: kbuild fixes Hannes Reinecke
  2025-10-01 15:13 ` [PATCH 1/4] nvme-keyring: use correct format specifier Hannes Reinecke
  2025-10-01 15:13 ` [PATCH 2/4] nvme-keyring: typo in nvme_dhchap_psk_lookup() Hannes Reinecke
@ 2025-10-01 15:13 ` Hannes Reinecke
  2025-10-01 15:13 ` [PATCH 4/4] nvme-keyring: fixup declaration of nvme_dhchap_psk_hash() Hannes Reinecke
  2025-10-01 15:32 ` [PATCHv2 0/4] nvme-keyring: kbuild fixes Chris Leech
  4 siblings, 0 replies; 6+ messages in thread
From: Hannes Reinecke @ 2025-10-01 15:13 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke,
	kernel test robot

nvme_auth_extract_key() is only available if the authentication
code is compiled in, so make it condititional on the config option.

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/fabrics.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 3d4d6d8e88c4..67b2ad5ae0fd 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -1106,6 +1106,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 	}
 
 	if (host_secret) {
+#ifdef CONFIG_NVME_HOST_AUTH
 		pr_debug("lookup host identity '%s'\n", host_secret);
 		key = nvme_auth_extract_key(opts->keyring, host_secret,
 					    strlen(host_secret),
@@ -1116,8 +1117,13 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 		}
 		pr_debug("using dhchap key %08x\n", key_serial(key));
 		opts->dhchap_key = key;
+#else
+		ret = -EINVAL;
+		goto out;
+#endif
 	}
 	if (ctrl_secret) {
+#ifdef CONFIG_NVME_HOST_AUTH
 		if (!opts->dhchap_key) {
 			ret = -EINVAL;
 			goto out;
@@ -1132,6 +1138,10 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 		}
 		pr_debug("using dhchap ctrl key %08x\n", key_serial(key));
 		opts->dhchap_ctrl_key = key;
+#else
+		ret = -EINVAL;
+		goto out;
+#endif
 	}
 
 	if (opts->concat) {
-- 
2.43.0



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

* [PATCH 4/4] nvme-keyring: fixup declaration of nvme_dhchap_psk_hash()
  2025-10-01 15:13 [PATCHv2 0/4] nvme-keyring: kbuild fixes Hannes Reinecke
                   ` (2 preceding siblings ...)
  2025-10-01 15:13 ` [PATCH 3/4] nvme-fabrics: make call to nvme_auth_extract_key() conditional Hannes Reinecke
@ 2025-10-01 15:13 ` Hannes Reinecke
  2025-10-01 15:32 ` [PATCHv2 0/4] nvme-keyring: kbuild fixes Chris Leech
  4 siblings, 0 replies; 6+ messages in thread
From: Hannes Reinecke @ 2025-10-01 15:13 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke

Fixup stub declaration of nvme_dhchap_psk_hash() to avoid kbuild
warnings.

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 6115bf5cf346..4bdac22b3cbb 100644
--- a/include/linux/nvme-keyring.h
+++ b/include/linux/nvme-keyring.h
@@ -54,7 +54,7 @@ static inline struct key *nvme_dhchap_psk_lookup(struct key *keyring,
 {
 	return ERR_PTR(-ENOTSUPP);
 }
-u8 nvme_dhchap_psk_hash(struct key *key)
+static inline u8 nvme_dhchap_psk_hash(struct key *key)
 {
 	return 0;
 }
-- 
2.43.0



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

* Re: [PATCHv2 0/4] nvme-keyring: kbuild fixes
  2025-10-01 15:13 [PATCHv2 0/4] nvme-keyring: kbuild fixes Hannes Reinecke
                   ` (3 preceding siblings ...)
  2025-10-01 15:13 ` [PATCH 4/4] nvme-keyring: fixup declaration of nvme_dhchap_psk_hash() Hannes Reinecke
@ 2025-10-01 15:32 ` Chris Leech
  4 siblings, 0 replies; 6+ messages in thread
From: Chris Leech @ 2025-10-01 15:32 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: Christoph Hellwig, Keith Busch, Sagi Grimberg, linux-nvme

On Wed, Oct 01, 2025 at 05:13:47PM +0200, Hannes Reinecke wrote:
> Hi all,
> 
> the kbuild robot uncovered some issues when having authentication
> disabled. This patchset will correct them.
> 
> As usual, comments and reviews are welcome.

Ack, fixes the build issues.

Reviewed-by: Chris Leech <cleech@redhat.com>

> 
> Hannes Reinecke (4):
>   nvme-keyring: use correct format specifier
>   nvme-keyring: typo in nvme_dhchap_psk_lookup()
>   nvme-fabrics: make call to nvme_auth_extract_key() conditional
>   nvme-keyring: fixup declaration of nvme_dhchap_psk_hash()
> 
>  drivers/nvme/common/keyring.c |  2 +-
>  drivers/nvme/host/fabrics.c   | 10 ++++++++++
>  include/linux/nvme-keyring.h  |  4 ++--
>  3 files changed, 13 insertions(+), 3 deletions(-)
> 
> -- 
> 2.43.0
> 
> 



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

end of thread, other threads:[~2025-10-01 15:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-01 15:13 [PATCHv2 0/4] nvme-keyring: kbuild fixes Hannes Reinecke
2025-10-01 15:13 ` [PATCH 1/4] nvme-keyring: use correct format specifier Hannes Reinecke
2025-10-01 15:13 ` [PATCH 2/4] nvme-keyring: typo in nvme_dhchap_psk_lookup() Hannes Reinecke
2025-10-01 15:13 ` [PATCH 3/4] nvme-fabrics: make call to nvme_auth_extract_key() conditional Hannes Reinecke
2025-10-01 15:13 ` [PATCH 4/4] nvme-keyring: fixup declaration of nvme_dhchap_psk_hash() Hannes Reinecke
2025-10-01 15:32 ` [PATCHv2 0/4] nvme-keyring: kbuild fixes Chris Leech

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