linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Martin George <martinus.gpy@gmail.com>
To: Hannes Reinecke <hare@suse.de>, linux-nvme@lists.infradead.org
Cc: hch@lst.de, kbusch@kernel.org, sagi@grimberg.me, hare@kernel.org,
	Martin George <marting@netapp.com>,
	Prashanth Adurthi <prashana@netapp.com>
Subject: Re: [PATCH] nvme-auth: update sc_c in host response
Date: Mon, 08 Sep 2025 20:39:38 +0530	[thread overview]
Message-ID: <9ac883bfce6ac295fb7204c6c5ffb8c8a35fea50.camel@gmail.com> (raw)
In-Reply-To: <30fc92e8-924a-4d52-b50f-9459ade044a0@suse.de>

On Mon, 2025-09-08 at 14:49 +0200, Hannes Reinecke wrote:
> On 9/8/25 13:26, Martin George wrote:
> > The sc_c field is currently not updated in the host response to the
> > controller challenge leading to failures while attempting secure
> > channel concatenation. Fix this by adding a new sc_c variable to
> > the
> > dhchap queue context structure which is appropriately set during
> > negotiate and then used in the host response.
> > 
> > Fixes: e88a7595b57f ("nvme-tcp: request secure channel
> > concatenation")
> > Signed-off-by: Martin George <marting@netapp.com>
> > Signed-off-by: Prashanth Adurthi <prashana@netapp.com>
> > ---
> >   drivers/nvme/host/auth.c | 6 +++++-
> >   1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
> > index 201fc8809a62..a7344faab2b2 100644
> > --- a/drivers/nvme/host/auth.c
> > +++ b/drivers/nvme/host/auth.c
> > @@ -36,6 +36,7 @@ struct nvme_dhchap_queue_context {
> >   	u8 status;
> >   	u8 dhgroup_id;
> >   	u8 hash_id;
> > +	u8 sc_c;
> >   	size_t hash_len;
> >   	u8 c1[64];
> >   	u8 c2[64];
> > @@ -154,6 +155,8 @@ static int
> > nvme_auth_set_dhchap_negotiate_data(struct nvme_ctrl *ctrl,
> >   	data->auth_protocol[0].dhchap.idlist[34] =
> > NVME_AUTH_DHGROUP_6144;
> >   	data->auth_protocol[0].dhchap.idlist[35] =
> > NVME_AUTH_DHGROUP_8192;
> >   
> > +	chap->sc_c = data->sc_c;
> > +
> >   	return size;
> >   }
> >   
> > @@ -488,7 +491,7 @@ static int
> > nvme_auth_dhchap_setup_host_response(struct nvme_ctrl *ctrl,
> >   	ret = crypto_shash_update(shash, buf, 2);
> >   	if (ret)
> >   		goto out;
> > -	memset(buf, 0, sizeof(buf));
> > +	memset(buf, chap->sc_c, sizeof(buf));
> 
> 'sc_c' is just a single byte, please do
> 
> *buf = chap->sc_c;
> 
> Otherwise both bytes in 'buf' are being set to 'sc_c'.
> 

Sure, will send a v2 of the patch with this change. Thanks.

-Martin
> 


      reply	other threads:[~2025-09-08 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08 11:26 [PATCH] nvme-auth: update sc_c in host response Martin George
2025-09-08 12:49 ` Hannes Reinecke
2025-09-08 15:09   ` Martin George [this message]

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=9ac883bfce6ac295fb7204c6c5ffb8c8a35fea50.camel@gmail.com \
    --to=martinus.gpy@gmail.com \
    --cc=hare@kernel.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=marting@netapp.com \
    --cc=prashana@netapp.com \
    --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;
as well as URLs for NNTP newsgroup(s).