Re: [PATCH] nvme: auth: validate DHCHAP secret before stopping authentication

From: Hannes Reinecke

Date: Mon Sep 21 2026 - 09:57:43 EST


On 9/17/26 10:04 AM, Sreeraj S Kurup wrote:
The driver currently calls nvme_auth_stop() before checking if the new
secret key is valid. If a bad key is passed through sysfs, the key
parser fails and exits early.

Since nvme_auth_stop() was already called, the current authentication
session gets stopped. However, because the parser failed, the work
thread is never restarted. This leaves the NVMe controller stuck in a
stopped state until someone writes a valid key.

Are you sure?
All what 'nvme_auth_stop()' does is stopping a currently running
authentication. And if someone writes an invalid key it certainly
was his intention to _start_ authentication.
I find it kinda weird to allow an pre-existing authentication to
run while the admin indicates that he wants to start a new one.
So not really sure if this fixes anything.

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