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

Keith Busch kbusch at kernel.org
Wed Oct 14 07:27:55 PDT 2026


On Wed, Oct 14, 2026 at 08:02:57AM -0400, Martin Belanger via B4 Relay wrote:
> From: Martin Belanger <martin.nvme.dev at gmail.com>
> 
> 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.



More information about the Linux-nvme mailing list