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.

nvmet-tcp: Don't free SQ on authentication success

Curently after the host sends a REPLACETLSPSK we free the TLS keys as
part of calling nvmet_auth_sq_free() on success. This means when the
host sends a follow up REPLACETLSPSK we return CONCAT_MISMATCH as the
check for !nvmet_queue_tls_keyid(req->sq) fails.

This patch ensures we don't free the TLS key on success as we might need
it again in the future.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>

authored by

Alistair Francis and committed by
Keith Busch
2e6eb6b2 ecf4d2d8

+4 -5
+4 -5
drivers/nvme/target/fabrics-cmd-auth.c
··· 395 395 goto complete; 396 396 } 397 397 /* Final states, clear up variables */ 398 - nvmet_auth_sq_free(req->sq); 399 - if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_FAILURE2) 398 + if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_FAILURE2) { 399 + nvmet_auth_sq_free(req->sq); 400 400 nvmet_ctrl_fatal_error(ctrl); 401 + } 401 402 402 403 complete: 403 404 nvmet_req_complete(req, status); ··· 574 573 status = nvmet_copy_to_sgl(req, 0, d, al); 575 574 kfree(d); 576 575 done: 577 - if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_SUCCESS2) 578 - nvmet_auth_sq_free(req->sq); 579 - else if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_FAILURE1) { 576 + if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_FAILURE1) { 580 577 nvmet_auth_sq_free(req->sq); 581 578 nvmet_ctrl_fatal_error(ctrl); 582 579 }