[PATCH v7 13/14] nvme-auth: link pre-provisioned keys into .nvme keyring

Hannes Reinecke hare at suse.de
Fri Nov 27 01:39:27 PST 2026


On 11/26/26 5:49 PM, Martin Belanger wrote:
> 
> 
> On 11/26/26 09:30, sashiko-bot at kernel.org wrote:
>> [Severity: High]
>> Does nvme_keyring_unlink() remove a pre-provisioned key that originally
>> lived in the .nvme keyring or is shared across multiple controllers?
> 
> Hi Hannes,
> 
> I can confirm this one with a test. nvme-keysd adds the dhchap keys to
> the .nvme keyring. After the first disconnect, or a failed connect,
> the keys are gone from the keyring, and the next connect fails.
> 
> I think the kernel should not add keys to a keyring or remove them.
> A pre-provisioned key is either in the keyring or it is not. If it is
> not, the connect fails, and it is up to the user or the key manager to
> fix that. While a controller uses the key, the reference it holds
> (ctrl->host_key) keeps the key alive. So I do not think
> nvme_keyring_link() and nvme_keyring_unlink() are needed for
> pre-provisioned keys.
> 
> Otherwise the design works for nvme-keysd: each authentication reads
> the key again, so a key the key manager updates in place reaches the
> next authentication.
> 
Yeah, linking keys was a bad idea. I'll remove it from the next round.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare at suse.de                                +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



More information about the Linux-nvme mailing list