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.

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

In an attempt to fix REPLACETLSPSK we stopped freeing the secrets on
successful connections. This resulted in memory leaks in the kernel, so
let's revert the commit. A improved fix is being developed to just avoid
clearing the tls_key variable.

This reverts commit 2e6eb6b277f593b98f151ea8eff1beb558bbea3b.

Closes: https://lore.kernel.org/linux-nvme/CAHj4cs-u3MWQR4idywptMfjEYi4YwObWFx4KVib35dZ5HMBDdw@mail.gmail.com
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
f920ebd0 bddb911d

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