Re: [PATCH v2] nvme: make the DH-HMAC-CHAP secret attributes readable by root only

From: Keith Busch

Date: Wed Oct 14 2026 - 11:26:39 EST


On Wed, Oct 14, 2026 at 08:02:57AM -0400, Martin Belanger via B4 Relay wrote:
> From: Martin Belanger <martin.nvme.dev@xxxxxxxxx>
>
> The dhchap_secret and dhchap_ctrl_secret sysfs attributes have mode
> 0644. Their show functions return the secret, so any local user can
> read the DH-HMAC-CHAP secrets of a connected controller.
>
> Define them with DEVICE_ATTR_ADMIN_RW(), which sets mode 0600. The
> macro takes the show and store functions from the attribute name, so
> rename them. Writing the attributes was already limited to root and is
> not changed.

Thanks, applied to nvme-6.4.