nvme-keyring: kbuild fixes
v2 cover nvme-keyring: kbuild 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 (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(-)
Signature · 1 line
2.43.0
PATCH v2 1/4 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
@@ -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 ;
Signature · 1 line
2.43.0
PATCH v2 2/4 nvme-keyring: typo in nvme_dhchap_psk_lookup()
In reply to Hannes ReineckeSpurious 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
@@ -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
PATCH v2 3/4 nvme-fabrics: make call to nvme_auth_extract_key() conditional
In reply to Hannes Reineckenvme_auth_extract_key() is only available if the authentication code is compiled in, so make it condititional on the config option.
--- drivers/nvme/host/fabrics.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/nvme/host/fabrics.c +10 -0
@@ -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) {
Signature · 1 line
2.43.0
PATCH v2 4/4 nvme-keyring: fixup declaration of nvme_dhchap_psk_hash()
In reply to Hannes ReineckeFixup stub declaration of nvme_dhchap_psk_hash() to avoid kbuild warnings.
--- include/linux/nvme-keyring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nvme-keyring.h +1 -1
@@ -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 ; }
Signature · 1 line
2.43.0
Quoted 6 lines · 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.
Ack, fixes the build issues.
Quoted 16 lines
Hannes Reinecke (4):
nvme-keyring: use correct format specifier
nvme-keyring: typo innvme_dhchap_psk_lookup()
nvme-fabrics: make call tonvme_auth_extract_key()conditional
nvme-keyring: fixup declaration ofnvme_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(-)Signature · 1 line
2.43.0