* [PATCH] nvme-tcp: fix link failure for TCP auth
@ 2024-09-09 20:21 Arnd Bergmann
2024-09-10 7:56 ` Sagi Grimberg
2024-09-10 14:43 ` Keith Busch
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2024-09-09 20:21 UTC (permalink / raw)
To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
Hannes Reinecke
Cc: Arnd Bergmann, Kanchan Joshi, Shin'ichiro Kawasaki,
linux-nvme, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The nvme fabric driver calls the nvme_tls_key_lookup() function from
nvmf_parse_key() when the keyring is enabled, but this is broken in a
configuration with CONFIG_NVME_FABRICS=y and CONFIG_NVME_TCP=m because
this leads to the function definition being in a loadable module:
x86_64-linux-ld: vmlinux.o: in function `nvmf_parse_key':
fabrics.c:(.text+0xb1bdec): undefined reference to `nvme_tls_key_lookup'
Move the 'select' up to CONFIG_NVME_FABRICS itself to force this
part to be built-in as well if needed.
Fixes: 5bc46b49c828 ("nvme-tcp: check for invalidated or revoked key")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
It may alternatively be possible to rework the code so the
keyring is only referenced when CONFIG_NVME_HOST_AUTH is also
set, but this version is simpler and leaves the code unchanged.
---
drivers/nvme/host/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig
index 883aaab2d83e..486afe598184 100644
--- a/drivers/nvme/host/Kconfig
+++ b/drivers/nvme/host/Kconfig
@@ -41,6 +41,7 @@ config NVME_HWMON
config NVME_FABRICS
select NVME_CORE
+ select NVME_KEYRING if NVME_TCP_TLS
tristate
config NVME_RDMA
@@ -94,7 +95,6 @@ config NVME_TCP
config NVME_TCP_TLS
bool "NVMe over Fabrics TCP TLS encryption support"
depends on NVME_TCP
- select NVME_KEYRING
select NET_HANDSHAKE
select KEYS
help
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme-tcp: fix link failure for TCP auth
2024-09-09 20:21 [PATCH] nvme-tcp: fix link failure for TCP auth Arnd Bergmann
@ 2024-09-10 7:56 ` Sagi Grimberg
2024-09-10 14:43 ` Keith Busch
1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2024-09-10 7:56 UTC (permalink / raw)
To: Arnd Bergmann, Keith Busch, Jens Axboe, Christoph Hellwig,
Hannes Reinecke
Cc: Arnd Bergmann, Kanchan Joshi, Shin'ichiro Kawasaki,
linux-nvme, linux-kernel
Looks good to me,
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme-tcp: fix link failure for TCP auth
2024-09-09 20:21 [PATCH] nvme-tcp: fix link failure for TCP auth Arnd Bergmann
2024-09-10 7:56 ` Sagi Grimberg
@ 2024-09-10 14:43 ` Keith Busch
1 sibling, 0 replies; 3+ messages in thread
From: Keith Busch @ 2024-09-10 14:43 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Jens Axboe, Christoph Hellwig, Sagi Grimberg, Hannes Reinecke,
Arnd Bergmann, Kanchan Joshi, Shin'ichiro Kawasaki,
linux-nvme, linux-kernel
On Mon, Sep 09, 2024 at 08:21:09PM +0000, Arnd Bergmann wrote:
> The nvme fabric driver calls the nvme_tls_key_lookup() function from
> nvmf_parse_key() when the keyring is enabled, but this is broken in a
> configuration with CONFIG_NVME_FABRICS=y and CONFIG_NVME_TCP=m because
> this leads to the function definition being in a loadable module:
>
> x86_64-linux-ld: vmlinux.o: in function `nvmf_parse_key':
> fabrics.c:(.text+0xb1bdec): undefined reference to `nvme_tls_key_lookup'
>
> Move the 'select' up to CONFIG_NVME_FABRICS itself to force this
> part to be built-in as well if needed.
Thanks, applied to nvme-6.12.
I even try to test for these odd module vs built-in scenarios, but I
missed this one. :(
> It may alternatively be possible to rework the code so the
> keyring is only referenced when CONFIG_NVME_HOST_AUTH is also
> set, but this version is simpler and leaves the code unchanged.
That sounds like a cleaner solution longer term, but I agree your patch
is the simpler way to handle the breakage.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-10 14:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-09 20:21 [PATCH] nvme-tcp: fix link failure for TCP auth Arnd Bergmann
2024-09-10 7:56 ` Sagi Grimberg
2024-09-10 14:43 ` Keith Busch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox