Skip to contentSkip to conversation

nvme: blank out authentication fabrics options if not configured

PATCH Superseded Hannes Reinecke 1 participant 1 message Nov 16, 2023 NVMe

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: blank out authentication fabrics options if not configured

If the config option NVME_HOST_AUTH is not selected we should not accept the corresponding fabrics options. This allows userspace to detect if NVMe authentication has been enabled for the kernel.

Cc Shin'ichiro Kawasaki <[email protected]>
---
 drivers/nvme/host/fabrics.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/host/fabrics.c +2 -0
index 4673ead69c5f..aa88606a44c4 100644
@@ -667,8 +667,10 @@ static const match_table_t opt_tokens = {
 #endif
 	{ NVMF_OPT_FAIL_FAST_TMO,	"fast_io_fail_tmo=%d"	},
 	{ NVMF_OPT_DISCOVERY,		"discovery"		},
+#ifdef CONFIG_NVME_HOST_AUTH
 	{ NVMF_OPT_DHCHAP_SECRET,	"dhchap_secret=%s"	},
 	{ NVMF_OPT_DHCHAP_CTRL_SECRET,	"dhchap_ctrl_secret=%s"	},
+#endif
 #ifdef CONFIG_NVME_TCP_TLS
 	{ NVMF_OPT_TLS,			"tls"			},
 #endif
Signature · 1 line
2.35.3