mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Belanger <martin.nvme.dev@gmail.com>
To: 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>,
	Hannes Reinecke <hare@suse.de>,
	Chaitanya Kulkarni <kch@nvidia.com>
Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 0/9] nvme-auth: switch to use the kernel keyring
Date: Mon, 23 Nov 2026 10:32:16 -0500	[thread overview]
Message-ID: <463a55e8-c2ef-4d83-94ff-7599c7d931e6@gmail.com> (raw)
In-Reply-To: <5aa50b65-c502-4b87-8f09-23a456e2ca6a@gmail.com>



On 11/23/26 07:59, Martin Belanger wrote:
> How should nvme-cli determine whether the kernel accepts a key
> description for DH-HMAC-CHAP?
[...]
> 2. Use a separate option for the key description, for example
>    dhchap_key=%s and dhchap_ctrl_key=%s. nvme-cli would then detect
>    support through /dev/nvme-fabrics, as it does for the other
>    options. It also avoids having one string that can mean either a
>    description or key data.

Hi Hannes,

A follow-up with test results. I added DH-HMAC-CHAP support to
nvme-keysd and tested it with v5 in a VM, with nvmet over TCP and keys
in both directions. Import, connect by key description, a wrong key,
and a key replacement all work.

For detection, nvme-keysd now uses add_key(): it fails with ENODEV
when the 'dhchap' key type does not exist. On an older kernel, the
connect fails with "Invalid DH-CHAP secret <name>", which is clear
enough. So nvme-cli does not need a new option for this. A separate
option would still avoid the ambiguity between a description and key
data, but that is your decision.

One finding: add_key() with the exact secret length, without a
trailing NUL, fails at random with EPERM. nvme_dhchap_psk_preparse()
treats the payload as a C string and reads past it (the bug Sashiko
reported), and base64_decode() returns -1. User space passes the
length without a NUL, keyctl(1) too. Could v6 parse exactly
prep->datalen bytes? For now nvme-keysd passes the NUL.

Martin


  reply	other threads:[~2026-11-23 15:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 12:14 Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 1/9] nvme-auth: modify nvme_auth_transform_key() to return status Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 2/9] nvme-keyring: add 'dhchap' key type Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 3/9] nvme-auth: switch to use 'struct key' Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 4/9] nvme: parse dhchap keys during option parsing Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 5/9] nvmet-auth: parse dhchap key from configfs attribute Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 6/9] nvme: allow to pass in key description as dhchap secret Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 7/9] nvme-auth: wait for authentication to finish when changing keys Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 8/9] nvme-fabrics: allow to pass in keyring by name Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 9/9] nvmet: add configfs attribute 'dhchap_keyring' Hannes Reinecke
2026-11-23 12:59 ` [PATCH v5 0/9] nvme-auth: switch to use the kernel keyring Martin Belanger
2026-11-23 15:32   ` Martin Belanger [this message]
2026-11-23 15:41     ` Hannes Reinecke
2026-11-23 15:39   ` Hannes Reinecke

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=463a55e8-c2ef-4d83-94ff-7599c7d931e6@gmail.com \
    --to=martin.nvme.dev@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=hare@kernel.org \
    --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

all inboxes | Powered by JetHome®