]> www.infradead.org Git - users/griffoul/linux.git/commitdiff
nvme-auth: update bi_directional flag
authorMartin George <martinus.gpy@gmail.com>
Mon, 15 Sep 2025 11:49:21 +0000 (17:19 +0530)
committerKeith Busch <kbusch@kernel.org>
Mon, 15 Sep 2025 15:26:30 +0000 (08:26 -0700)
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")
Signed-off-by: Martin George <marting@netapp.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/auth.c

index 201fc8809a628c5313f2b1a319122a5807183599..012fcfc79a73b11971f05c8a2fdbd7cae89e9fa2 100644 (file)
@@ -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) {