nvme: blank out authentication fabrics options if not configured
PATCH v2 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.
--- drivers/nvme/host/fabrics.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/fabrics.c +2 -0
@@ -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
Quoted 7 lines · Hannes Reinecke
If the config option
NVME_HOST_AUTHis 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]>Fixes f50fff73d620 ("nvme: implement In-Band authentication")Signed-off-by Hannes Reinecke <[email protected]>
Quoted 7 lines · Hannes Reinecke
If the config option
NVME_HOST_AUTHis 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]>Fixes f50fff73d620 ("nvme: implement In-Band authentication")Signed-off-by Hannes Reinecke <[email protected]>
Thanks Hannes. I prepared a patch on blktests side [1] which refers the fabrics options. Using these changes on kernel side and blktests side, I confirmed blktests can detect if NVMe authentication is enabled or not.
[1] https://github.com/kawasaki/blktests/commit/81110ce8056f16716d09774e6f237ea0393579e1
Quoted 3 lines · Hannes Reinecke
If the config option
NVME_HOST_AUTHis not selected we should not accept the corresponding fabrics options. This allows userspace to detect if NVMe authentication has been enabled for the kernel.
Looks good:
Keith Busch
maintainerQuoted 7 lines · Hannes Reinecke
If the config option
NVME_HOST_AUTHis 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]>Fixes f50fff73d620 ("nvme: implement In-Band authentication")Signed-off-by Hannes Reinecke <[email protected]>
Applied for nvme-6.7, thanks!