public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wilfred Mallawa <wilfred.opensource@gmail.com>
To: alistair23@gmail.com, kbusch@kernel.org, axboe@kernel.dk,
	hch@lst.de,  sagi@grimberg.me, hare@suse.de, kch@nvidia.com,
	linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org,
	Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [PATCH v3 2/4] nvmet-tcp: Don't free SQ on authentication success
Date: Tue, 18 Nov 2025 10:41:02 +1000	[thread overview]
Message-ID: <9d351634fd1324ed00830d7af1d0406dfffa261d.camel@gmail.com> (raw)
In-Reply-To: <20251114045850.1898865-3-alistair.francis@wdc.com>

On Fri, 2025-11-14 at 14:58 +1000, alistair23@gmail.com wrote:
> From: Alistair Francis <alistair.francis@wdc.com>
> 
> 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>
> ---
> v3:
>  - No change
> v2:
>  - Don't call nvmet_auth_sq_free() in nvmet_execute_auth_send()
> either
> 
>  drivers/nvme/target/fabrics-cmd-auth.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/nvme/target/fabrics-cmd-auth.c
> b/drivers/nvme/target/fabrics-cmd-auth.c
> index 2e828f7717ad..0cd722ebfa75 100644
> --- a/drivers/nvme/target/fabrics-cmd-auth.c
> +++ b/drivers/nvme/target/fabrics-cmd-auth.c
> @@ -397,9 +397,10 @@ void nvmet_execute_auth_send(struct nvmet_req
> *req)
>  		goto complete;
>  	}
>  	/* Final states, clear up variables */
> -	nvmet_auth_sq_free(req->sq);
> -	if (req->sq->dhchap_step ==
> NVME_AUTH_DHCHAP_MESSAGE_FAILURE2)
> +	if (req->sq->dhchap_step ==
> NVME_AUTH_DHCHAP_MESSAGE_FAILURE2) {
> +		nvmet_auth_sq_free(req->sq);
>  		nvmet_ctrl_fatal_error(ctrl);
> +	}
>  
>  complete:
>  	nvmet_req_complete(req, status);
> @@ -575,9 +576,7 @@ void nvmet_execute_auth_receive(struct nvmet_req
> *req)
>  	status = nvmet_copy_to_sgl(req, 0, d, al);
>  	kfree(d);
>  done:
> -	if (req->sq->dhchap_step ==
> NVME_AUTH_DHCHAP_MESSAGE_SUCCESS2)
> -		nvmet_auth_sq_free(req->sq);
> -	else if (req->sq->dhchap_step ==
> NVME_AUTH_DHCHAP_MESSAGE_FAILURE1) {
> +	if (req->sq->dhchap_step ==
> NVME_AUTH_DHCHAP_MESSAGE_FAILURE1) {
>  		nvmet_auth_sq_free(req->sq);
>  		nvmet_ctrl_fatal_error(ctrl);
>  	}
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>

Wilfred

  reply	other threads:[~2025-11-18  0:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14  4:58 [PATCH v3 0/4] Support PSK reauthentication (REPLACETLSPSK) alistair23
2025-11-14  4:58 ` [PATCH v3 1/4] nvmet-tcp: Don't error if TLS is enabed on a reset alistair23
2025-11-14  4:58 ` [PATCH v3 2/4] nvmet-tcp: Don't free SQ on authentication success alistair23
2025-11-18  0:41   ` Wilfred Mallawa [this message]
2025-11-14  4:58 ` [PATCH v3 3/4] nvme: Expose the tls_configured sysfs for secure concat connections alistair23
2025-11-14  7:00   ` Hannes Reinecke
2025-11-18  0:41   ` Wilfred Mallawa
2025-11-14  4:58 ` [PATCH v3 4/4] nvme: Allow reauth from sysfs alistair23
2025-11-14  7:15   ` Hannes Reinecke
2025-11-18  0:52     ` Alistair Francis
2025-11-18 11:50       ` Hannes Reinecke
2025-11-19  0:24         ` Alistair Francis
2025-11-19  7:45           ` Hannes Reinecke
2025-11-19 10:21             ` Alistair Francis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d351634fd1324ed00830d7af1d0406dfffa261d.camel@gmail.com \
    --to=wilfred.opensource@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=alistair23@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox