mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Sreeraj S Kurup <sreekuttan2156239@gmail.com>,
	linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, kbusch@kernel.org, axboe@kernel.dk,
	hch@lst.de, sagi@grimberg.me
Subject: Re: [PATCH] nvme: auth: validate DHCHAP secret before stopping authentication
Date: Thu, 8 Oct 2026 09:07:17 +0200	[thread overview]
Message-ID: <0632ec1e-dcd3-42f9-bd0c-a809a6f6db09@suse.de> (raw)
In-Reply-To: <20261003125115.2523-1-sreekuttan2156239@gmail.com>

On 10/3/26 2:51 PM, Sreeraj S Kurup wrote:
> Hi Hannes,
> 
> Yes, I agree that stopping the currently running authentication when the admin
> requests a new one is intentional.
> 
> The issue I was pointing out is slightly different: if the new key is invalid,
 > we never actually get to the point where the new authentication can be
 > started again. "nvme_auth_stop()" has already stopped the existing
 > authentication, and the parser returns an error before the restart
 > path is reached.>
> So the question is whether writing an invalid replacement key should
 > leave the previous authentication stopped, or whether the key should
 > first be parsed/validated and only then replace the existing
 > authentication state.>
> If the intended semantics are that an invalid key write should not
 > disturb an already running authentication, then moving the validation
 > before "nvme_auth_stop()" would make the operation effectively
 > transactional:>
> validate new key
>      -> error: leave existing authentication unchanged
>      -> success: stop old authentication and start with new key
> 
> If, however, the intended semantics are that any attempted replacement
 > stops the existing authentication even when the replacement is
 > invalid, then I agree that the current behaviour is intentional and
 > the patch doesn't fix a bug.>
Hmm. Actually, I'm not sure. Both sides have something going for it.
Stopping the transaction first follows the perceived will of the admin
to start a new authentication. And that will is arguably independent
on the question as to whether the new key is valid.
But at the same time one cannot start a new authentication if the key
is invalid.

So I don't know. Let me think.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich

  reply	other threads:[~2026-10-08  7:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17  8:04 Sreeraj S Kurup
2026-09-21 13:49 ` Hannes Reinecke
2026-10-03 12:51   ` Sreeraj S Kurup
2026-10-08  7:07     ` Hannes Reinecke [this message]
2026-10-03 13:09   ` Sreeraj S Kurup

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=0632ec1e-dcd3-42f9-bd0c-a809a6f6db09@suse.de \
    --to=hare@suse.de \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=sreekuttan2156239@gmail.com \
    /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

all inboxes | Powered by JetHome®