From: Martin Belanger <martin.nvme.dev@gmail.com>
To: Hannes Reinecke <hare@suse.de>, Hannes Reinecke <hare@kernel.org>,
Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>,
Eric Biggers <ebiggers@kernel.org>,
David Howells <dhowells@redhat.com>,
Jarkko Sakkinen <jarkko@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>, Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
keyrings@vger.kernel.org, linux-doc@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH v7 09/14] nvme: allow to pass in key description as dhchap secret
Date: Tue, 1 Dec 2026 06:27:59 -0500 [thread overview]
Message-ID: <92bd7230-87cf-42e6-91ba-05e62bd6f2e5@gmail.com> (raw)
In-Reply-To: <2900913f-d7b2-418f-9a1d-4c7c5c8879a6@suse.de>
On 12/1/26 05:21, Hannes Reinecke wrote:
> We have been there before with the TLS keys, and found that using
> serial numbers to identify keys is really a bad idea if you want
> to store it in a configuration file.
Agreed, and I did not mean that. A serial cannot go into a
configuration file. It changes each time a key is added to the
keyring. The configuration holds the key description.
> And there's an additional attribute dhchap_key and dhchap_ctrl_key
> which will display the key serial.
You are right, v7 already has them, and I missed them. libnvme can
use the presence of this attribute to detect keyring support. That
is all it needs. For everything else, the description that
dhchap_secret shows for a pre-provisioned key is enough, because
the kernel accepts it on connect.
On the names: I would still prefer kxchap_key and kxchap_ctrl_key.
These attributes are new ABI. Base 2.4 renamed DH-HMAC-CHAP to
KX-HMAC-CHAP because the key exchange is no longer only
Diffie-Hellman (ML-KEM). The same key is used with any of these
key exchanges. Also, nvmet configfs already has a dhchap_key
attribute, and there it holds the secret. A host attribute with
the same name that shows a serial would be confusing. The
existing attributes keep their names.
> To honour you original request of not allowing to rotate
> pre-provisioned keys we could return -EBUSY (-EINVAL?)
> when someone writes to dhchap_secret / dhchap_ctrl_secret
> of a pre-provisioned key, and allow writes to dhchap_key /
> dhchap_ctrl_key for pre-provisioned keys.
My request was a little different. A pre-provisioned key should be
rotated in the keyring: keyctl update changes the payload, the
serial stays the same, and the next authentication uses the new
key. I would like that to be the only way to change such a key.
So I would prefer kxchap_key and kxchap_ctrl_key to stay
read-only, as in v7. A write can be added later if someone needs
it. Once it is released, it cannot be removed.
Returning -EBUSY on a write to dhchap_secret for a pre-provisioned
key is fine with me. libnvme only reads that attribute.
Martin
next prev parent reply other threads:[~2026-12-01 11:28 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 14:12 [PATCH v7 00/14] nvme-auth: switch to use the kernel keyring Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 01/14] nvme-auth: modify nvme_auth_transform_key() to return status Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 02/14] nvme-keyring: add 'dhchap' key type Hannes Reinecke
2026-11-26 14:32 ` sashiko-bot
2026-11-26 15:08 ` Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 03/14] nvme-keyring: drop nvme_tls_psk_revoked() Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 04/14] Documentation/security/keys: fixup function name Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring Hannes Reinecke
2026-11-26 14:24 ` sashiko-bot
2026-11-26 19:49 ` kernel test robot
2026-11-26 20:22 ` kernel test robot
2026-11-26 14:12 ` [PATCH v7 06/14] nvme-auth: switch to use 'struct key' Hannes Reinecke
2026-11-26 14:33 ` sashiko-bot
2026-11-27 7:23 ` Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 07/14] nvme: parse dhchap keys during option parsing Hannes Reinecke
2026-11-26 14:29 ` sashiko-bot
2026-11-27 7:32 ` Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 08/14] nvmet-auth: parse dhchap key from configfs attribute Hannes Reinecke
2026-11-26 14:30 ` sashiko-bot
2026-11-27 7:34 ` Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 09/14] nvme: allow to pass in key description as dhchap secret Hannes Reinecke
2026-11-26 14:27 ` sashiko-bot
2026-11-27 7:40 ` Hannes Reinecke
2026-11-27 14:35 ` Martin Belanger
2026-12-01 10:21 ` Hannes Reinecke
2026-12-01 11:27 ` Martin Belanger [this message]
2026-11-26 14:12 ` [PATCH v7 10/14] nvme-auth: allow to specify the key by key serial Hannes Reinecke
2026-11-26 14:26 ` sashiko-bot
2026-11-27 9:13 ` Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 11/14] nvme-auth: wait for authentication to finish when changing keys Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 12/14] nvme-fabrics: allow to pass in keyring by name Hannes Reinecke
2026-11-26 14:31 ` sashiko-bot
2026-11-27 10:14 ` Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 13/14] nvme-auth: link pre-provisioned keys into .nvme keyring Hannes Reinecke
2026-11-26 14:30 ` sashiko-bot
2026-11-26 16:49 ` Martin Belanger
2026-11-27 9:39 ` Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 14/14] nvme-auth: allow to update pre-provisioned keys Hannes Reinecke
2026-11-26 14:31 ` sashiko-bot
2026-11-27 10:48 ` Hannes Reinecke
2026-11-26 21:15 ` kernel test robot
2026-11-26 16:00 ` [PATCH v7 00/14] nvme-auth: switch to use the kernel keyring Jarkko Sakkinen
2026-11-26 16:03 ` Jarkko Sakkinen
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=92bd7230-87cf-42e6-91ba-05e62bd6f2e5@gmail.com \
--to=martin.nvme.dev@gmail.com \
--cc=axboe@kernel.dk \
--cc=corbet@lwn.net \
--cc=dhowells@redhat.com \
--cc=ebiggers@kernel.org \
--cc=gustavoars@kernel.org \
--cc=hare@kernel.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jarkko@kernel.org \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=kees@kernel.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=rdunlap@infradead.org \
--cc=sagi@grimberg.me \
--cc=skhan@linuxfoundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.