Re: [PATCH v6 0/9] nvme-auth: switch to use the kernel keyring
From: Hannes Reinecke
Date: Wed Nov 25 2026 - 02:26:42 EST
Hey all,
On 11/24/26 11:13 PM, Martin Belanger wrote:
Ah. So essentially you are saying I should drop the patch 'nvme:
On 11/24/26 16:32, Eric Biggers wrote:
Even if you actually need runtime key rotation without touching
configfs/sysfs (why, when nvme-keysd could just write those files
itself?), this series doesn't actually implement that.
Correct, v6 does not implement it. That is what I am asking for.
Writing sysfs from nvme-keysd would give two mechanisms for the same
key: the keyring for the connect, and sysfs for every change after
that. One mechanism is enough.
It would also make nvme-keysd controller-aware. Today nvme-keysd adds
a key to the keyring and does not know which controllers use it. This
is by design. To write sysfs, it would have to track every controller
and know which key each one uses, also for controllers created later.
A lookup by description at each authentication avoids this. It is
also how NVMe/TCP TLS PSKs already work.
With a lookup at each authentication, the sysfs and configfs
attributes no longer need to carry secrets. For a key from the
keyring, they can hold the key description: a read returns it, and a
write sets the description used at the next authentication. The
secret then stays in the keyring, and changing it needs no write to
sysfs. Raw secrets given on connect keep the current behavior.
parse dhchap keys during option parsing' and keep the
secret/key description in struct nvmf_ctrl_options?
Sure one could do that; but again the main push behind this
patchset was to precisely _not_ to have to store them in
any structure, but rather work with the keystore and only
access the key data once they are actually needed.
And the other problem with your approach is that DH-CHAP
key don't actually have 'names'; they are just binary blobs.
If we want to refer to them by name we first would need to
agree on what the name actually _is_.
What we could do is to store the key serial in struct
nvmf_ctrl_options; that would allow keysd to provision
the keys and rotate them via 'keyctl update' (or whatever
it's doing internally). And would get away from the
business of having to come up with a name for the key.
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