[PATCH v5 0/9] nvme-auth: switch to use the kernel keyring

Martin Belanger martin.nvme.dev at gmail.com
Mon Nov 23 04:59:56 PST 2026



On 11/23/26 07:14, Hannes Reinecke wrote:
> With this I have updated the dhchap arguments to 'nvme connect' and
> the configfs interface to either be the keydata (ie the original
> interface) _or_ a key description referring to a pre-populated dhchap
> key in the kernel keyring.

Hi Hannes,

How should nvme-cli determine whether the kernel accepts a key
description for DH-HMAC-CHAP?

I will add DH-HMAC-CHAP support to nvme-keysd. It will import the
secrets into the .nvme keyring, the same way it imports TLS PSKs
today, and nvme-cli will pass the key description to 'nvme connect'.
On an older kernel, nvme-keysd must not import the secrets, and
nvme-cli must pass the key data instead. So both need to know what
the kernel supports.

I see these options:

1. Check the kernel version. This does not cover backports.

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.

3. Something else. add_key() fails with ENODEV when the 'dhchap' key
   type does not exist, but this does not show that the connect
   options accept a description.

What do you prefer?

Martin



More information about the Linux-nvme mailing list