Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvme-auth: Include SC_C in RVAL controller hash

Section 8.3.4.5.5 of the NVMe Base Specification 2.1 describes what is
included in the Response Value (RVAL) hash and SC_C should be included.
Currently we are hardcoding 0 instead of using the correct SC_C value.

Update the host and target code to use the SC_C when calculating the
RVAL instead of using 0.

Fixes: e88a7595b57f2 ("nvme-tcp: request secure channel concatenation")
Reviewed-by: Chris Leech <cleech@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>

authored by

Alistair Francis and committed by
Keith Busch
5d10069e 26bb12b9

+4 -2
+2 -1
drivers/nvme/host/auth.c
··· 535 535 put_unaligned_le16(chap->transaction, buf); 536 536 nvme_auth_hmac_update(&hmac, buf, 2); 537 537 538 - memset(buf, 0, 4); 538 + *buf = chap->sc_c; 539 539 nvme_auth_hmac_update(&hmac, buf, 1); 540 540 nvme_auth_hmac_update(&hmac, "Controller", 10); 541 541 nvme_auth_hmac_update(&hmac, ctrl->opts->subsysnqn, 542 542 strlen(ctrl->opts->subsysnqn)); 543 + memset(buf, 0, 4); 543 544 nvme_auth_hmac_update(&hmac, buf, 1); 544 545 nvme_auth_hmac_update(&hmac, ctrl->opts->host->nqn, 545 546 strlen(ctrl->opts->host->nqn));
+2 -1
drivers/nvme/target/auth.c
··· 399 399 put_unaligned_le16(req->sq->dhchap_tid, buf); 400 400 nvme_auth_hmac_update(&hmac, buf, 2); 401 401 402 - memset(buf, 0, 4); 402 + *buf = req->sq->sc_c; 403 403 nvme_auth_hmac_update(&hmac, buf, 1); 404 404 nvme_auth_hmac_update(&hmac, "Controller", 10); 405 405 nvme_auth_hmac_update(&hmac, ctrl->subsys->subsysnqn, 406 406 strlen(ctrl->subsys->subsysnqn)); 407 + memset(buf, 0, 4); 407 408 nvme_auth_hmac_update(&hmac, buf, 1); 408 409 nvme_auth_hmac_update(&hmac, ctrl->hostnqn, strlen(ctrl->hostnqn)); 409 410 nvme_auth_hmac_final(&hmac, response);