Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions drivers/nvme/target/fabrics-cmd-auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,13 @@ static int nvmet_auth_challenge(struct nvmet_req *req, void *d, int al)
int hash_len = nvme_auth_hmac_hash_len(ctrl->shash_id);
int data_size = sizeof(*d) + hash_len;

/*
* If replacing the keys then we have previous successful keys
* that might be leaked, so we need to free them here.
*/
if (req->sq->dhchap_c1)
nvmet_auth_sq_free(req->sq);

if (ctrl->dh_tfm)
data_size += ctrl->dh_keysize;
if (al < data_size) {
Expand Down