Re: [PATCH v7 09/14] nvme: allow to pass in key description as dhchap secret
From: Hannes Reinecke
Date: Wed Dec 02 2026 - 07:59:03 EST
On 12/1/26 12:27 PM, Martin Belanger wrote:
True; but I'd rather defer the naming change to a different
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.
patchset. Lumping it together with this one will get too
confusing.
Okay, we can do that.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 stayOkay.
read-only, as in v7. A write can be added later if someone needs
it. Once it is released, it cannot be removed.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@xxxxxxx +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