]> www.infradead.org Git - users/willy/xarray.git/commitdiff
nvme-auth: auth success1 msg always includes resp
authorMark O'Donovan <shiftee@posteo.net>
Wed, 25 Oct 2023 10:51:23 +0000 (10:51 +0000)
committerKeith Busch <kbusch@kernel.org>
Mon, 6 Nov 2023 16:34:15 +0000 (08:34 -0800)
In cases where RVALID is false, the response is still transmitted,
but is cleared to zero.

Relevant extract from the spec:
Response R2, if valid (i.e., if the RVALID field is set to 01h),
cleared to 0h otherwise

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/auth.c
include/linux/nvme.h

index eaefebb2a799a20d6912b5a4a9b17558e418a46f..5885bb0d5a9a69e3f7bf57efc7949ad526f27dea 100644 (file)
@@ -339,10 +339,7 @@ static int nvme_auth_process_dhchap_success1(struct nvme_ctrl *ctrl,
                struct nvme_dhchap_queue_context *chap)
 {
        struct nvmf_auth_dhchap_success1_data *data = chap->buf;
-       size_t size = sizeof(*data);
-
-       if (chap->s2)
-               size += chap->hash_len;
+       size_t size = sizeof(*data) + chap->hash_len;
 
        if (size > CHAP_BUF_SIZE) {
                chap->status = NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD;
index a7ba74babad73a5d4d6924cd096e210923b2e5c8..44325c068b6a01eb81274fa65767dd9298d35643 100644 (file)
@@ -1732,7 +1732,7 @@ struct nvmf_auth_dhchap_success1_data {
        __u8            rsvd2;
        __u8            rvalid;
        __u8            rsvd3[7];
-       /* 'hl' bytes of response value if 'rvalid' is set */
+       /* 'hl' bytes of response value */
        __u8            rval[];
 };