From: Jarkko Sakkinen <jarkko@kernel.org>
To: Hannes Reinecke <hare@kernel.org>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Hannes Reinecke <hare@suse.de>,
Chaitanya Kulkarni <kch@nvidia.com>,
Eric Biggers <ebiggers@kernel.org>,
David Howells <dhowells@redhat.com>,
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>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
keyrings@vger.kernel.org, linux-doc@vger.kernel.org,
linux-hardening@vger.kernel.org,
Martin Belanger <martin.nvme.dev@gmail.com>
Subject: Re: [PATCH v7 00/14] nvme-auth: switch to use the kernel keyring
Date: Thu, 26 Nov 2026 18:00:03 +0200 [thread overview]
Message-ID: <awhXg41rBQL982qk@kernel.org> (raw)
In-Reply-To: <20261126-dhchap-keyring-v4-v7-0-ee438ffea527@kernel.org>
On Thu, Nov 26, 2026 at 03:12:18PM +0100, Hannes Reinecke wrote:
> Hey all,
>
> the current NVMe authentication code is using a hand-crafted key
> structure; idea was to have the initial implementation with a minimal
> set of dependencies.
> (And me not having a good grasp on how to use the kernel keyring :-)
> That had the drawback that keys always had to be specified on the
> nvme-cli commandline, which is far from ideal from a security standpoint.
>
> So this patchset switches the authentication code over to use
> 'struct key' to hold DH-HMAC-CHAP secrets. User-facing interfaces
> (namely argument to 'nvme connect') remain the same, but the key data
> is converted into keys which are stored as a new key type 'dhchap' with
> a random UUID as description in the .nvme keyring.
>
> With this I have updated the dhchap arguments to 'nvme connect' and
> the configfs interface to either be the keydata (ie the original
> interface), a key description, _or_ a key serial referring to a
> pre-populated dhchap key in the kernel keyring. This allows for external
> provisioning of keys and avoids the security risk from having to specify
> the key data on the kernel commandline.
>
> The entire patchset can be found at
> git://git.kernel.org/pub/scm/linux/kernel/git/hare/nvme.git
> branch dhchap-keyring.v6
>
> As usual, comments and reviews are welcome.
>
> Signed-off-by: Hannes Reinecke <hare@kernel.org>
> ---
> Changes in v7:
> - Fixup next round of issues from sashiko
> - Modify to use key_serial_t instead of 'struct key' to pass key references
> - Include suggestions from Martin Belanger
> - Link to v6: https://lore.kernel.org/r/20261123-dhchap-keyring-v4-v6-0-5082a49715ab@kernel.org
>
> Changes in v6:
> - Fixup next round of issues from sashiko
> - Fixup kbuild robot issues
> - Link to v5: https://lore.kernel.org/r/20261123-dhchap-keyring-v4-v5-0-81eefb4c0724@kernel.org
>
> Changes in v5:
> - Fixup issues found by sashiko
> - Link to v4: https://lore.kernel.org/r/20261120-dhchap-keyring-v4-v4-0-5f8c7d9926ee@kernel.org
>
> ---
> Hannes Reinecke (14):
> nvme-auth: modify nvme_auth_transform_key() to return status
> nvme-keyring: add 'dhchap' key type
> nvme-keyring: drop nvme_tls_psk_revoked()
> Documentation/security/keys: fixup function name
> nvme-keyring: link addtional keyring into .nvme keyring
> nvme-auth: switch to use 'struct key'
> nvme: parse dhchap keys during option parsing
> nvmet-auth: parse dhchap key from configfs attribute
> nvme: allow to pass in key description as dhchap secret
> nvme-auth: allow to specify the key by key serial
> nvme-auth: wait for authentication to finish when changing keys
> nvme-fabrics: allow to pass in keyring by name
> nvme-auth: link pre-provisioned keys into .nvme keyring
> nvme-auth: allow to update pre-provisioned keys
>
> Documentation/ABI/stable/sysfs-nvme | 10 +
> Documentation/security/keys/core.rst | 2 +-
> drivers/nvme/common/Kconfig | 2 +
> drivers/nvme/common/auth.c | 232 ++++++++++------------
> drivers/nvme/common/keyring.c | 370 ++++++++++++++++++++++++++++++++---
> drivers/nvme/host/Kconfig | 1 -
> drivers/nvme/host/auth.c | 176 ++++++++++++-----
> drivers/nvme/host/fabrics.c | 169 ++++++++++++----
> drivers/nvme/host/fabrics.h | 12 +-
> drivers/nvme/host/nvme.h | 6 +-
> drivers/nvme/host/sysfs.c | 300 ++++++++++++++++++++++------
> drivers/nvme/host/tcp.c | 5 +-
> drivers/nvme/target/Kconfig | 1 -
> drivers/nvme/target/auth.c | 250 +++++++++++++++--------
> drivers/nvme/target/configfs.c | 84 ++++++--
> drivers/nvme/target/nvmet.h | 15 +-
> include/linux/nvme-auth.h | 17 +-
> include/linux/nvme-keyring.h | 47 ++++-
> 18 files changed, 1257 insertions(+), 442 deletions(-)
> ---
> base-commit: 68099cf27253a8c89d703a282d3d811446d9453b
> change-id: 20261120-dhchap-keyring-v4-09f0bac1d8c5
>
> Best regards,
> --
> Hannes Reinecke <hare@kernel.org>
>
Without looking into detail to the changes, it'd be best if key type
semantics would align with [1]. See the preparation patches for other
subsystems.
I'll send updated patch set after v7.5 merge window. The only reason
I'm not moving forward sooner is to gather as many bug fixes as
possible for the "previous world", which LLM bots kindly provide.
Otherwise, this needs to be refactored very soon after the patch set is
merged.
[1] https://lore.kernel.org/keyrings/20261112040242.247168-1-jarkko@kernel.org/
Br, Jarkko
next prev parent reply other threads:[~2026-11-26 16:00 UTC|newest]
Thread overview: 28+ 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 14:12 ` [PATCH v7 06/14] nvme-auth: switch to use 'struct key' Hannes Reinecke
2026-11-26 14:33 ` sashiko-bot
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-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-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-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-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-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 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-26 16:00 ` Jarkko Sakkinen [this message]
2026-11-26 16:03 ` [PATCH v7 00/14] nvme-auth: switch to use the kernel keyring 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=awhXg41rBQL982qk@kernel.org \
--to=jarkko@kernel.org \
--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=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=martin.nvme.dev@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox