Skip to contentSkip to conversation

nvme-auth: update bi_directional flag

PATCH Applied Martin George 3 participants 3 messages Sep 15, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-auth: update bi_directional flag

While setting chap->s2 to zero as part of secure channel concatenation, the host missed out to disable the bi_directional flag to indicate that controller authentication is not requested. Fix the same.

Fixes e88a7595b57f ("nvme-tcp: request secure channel concatenation")
---
 drivers/nvme/host/auth.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/auth.c +3 -2
index 201fc8809a62..012fcfc79a73 100644
@@ -331,9 +331,10 @@ static int nvme_auth_set_dhchap_reply_data(struct nvme_ctrl *ctrl,
 	} else {
 		memset(chap->c2, 0, chap->hash_len);
 	}
-	if (ctrl->opts->concat)
+	if (ctrl->opts->concat) {
 		chap->s2 = 0;
-	else
+		chap->bi_directional = false;
+	} else
 		chap->s2 = nvme_auth_get_seqnum();
 	data->seqnum = cpu_to_le32(chap->s2);
 	if (chap->host_key_len) {
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Martin George

While setting chap->s2 to zero as part of secure channel concatenation, the host missed out to disable the bi_directional flag to indicate that controller authentication is not requested. Fix the same.

Fixes e88a7595b57f ("nvme-tcp: request secure channel concatenation")
---
  drivers/nvme/host/auth.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/auth.c +0 -0
index 201fc8809a62..012fcfc79a73 100644
@@ -331,9 +331,10 @@ static int nvme_auth_set_dhchap_reply_data(struct nvme_ctrl *ctrl,
  	} else {
  		memset(chap->c2, 0, chap->hash_len);

drivers/nvme/host/auth.c static int nvme_auth_set_dhchap_reply_data(struct nvme_ctrl *ctrl, · line 340

Quoted 10 lines
drivers/nvme/host/auth.c +3 -2
  	}
-	if (ctrl->opts->concat)
+	if (ctrl->opts->concat) {
  		chap->s2 = 0;
-	else
+		chap->bi_directional = false;
+	} else
  		chap->s2 = nvme_auth_get_seqnum();
  	data->seqnum = cpu_to_le32(chap->s2);
  	if (chap->host_key_len) {

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
maintainer Applied
#2 lore raw
In reply to Martin George
Quoted 4 lines · Martin George

While setting chap->s2 to zero as part of secure channel concatenation, the host missed out to disable the bi_directional flag to indicate that controller authentication is not requested. Fix the same.

Thanks, applied to nvme-6.18.