From: Greg KH <gregkh@linuxfoundation.org>
To: Martin Belanger <martin.nvme.dev@gmail.com>
Cc: linux-nvme@lists.infradead.org, kbusch@kernel.org,
sagi@grimberg.me, hch@lst.de, axboe@kernel.dk, hare@suse.de,
linux-kernel@vger.kernel.org, security@kernel.org,
stable@vger.kernel.org, Daniel Wagner <wagi@kernel.org>
Subject: Re: [PATCH] nvme: make the DH-HMAC-CHAP secret attributes readable by root only
Date: Wed, 14 Oct 2026 06:46:44 +0200 [thread overview]
Message-ID: <2026101434-wrist-playing-51b3@gregkh> (raw)
In-Reply-To: <20261013173241.1713708-1-martin.nvme.dev@gmail.com>
On Tue, Oct 13, 2026 at 01:32:41PM -0400, Martin Belanger wrote:
> 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.
>
> Change the mode to 0600. Writing the attributes was already limited to
> root and is not changed.
>
> Fixes: f50fff73d620 ("nvme: implement In-Band authentication")
> Cc: stable@vger.kernel.org
> Cc: Daniel Wagner <wagi@kernel.org>
> Assisted-by: LLM
> Signed-off-by: Martin Belanger <martin.nvme.dev@gmail.com>
> ---
> drivers/nvme/host/sysfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
> index e1e3dcfd084b..e0cb34545b97 100644
> --- a/drivers/nvme/host/sysfs.c
> +++ b/drivers/nvme/host/sysfs.c
> @@ -864,7 +864,7 @@ static ssize_t nvme_ctrl_dhchap_secret_store(struct device *dev,
> return count;
> }
>
> -static DEVICE_ATTR(dhchap_secret, S_IRUGO | S_IWUSR,
> +static DEVICE_ATTR(dhchap_secret, 0600,
> nvme_ctrl_dhchap_secret_show, nvme_ctrl_dhchap_secret_store);
DEVICE_ATTR_ADMIN_RW() perhaps?
And no need to cc: security@k.o for public patches.
thanks,
greg k-h
prev parent reply other threads:[~2026-10-14 4:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 17:32 Martin Belanger
2026-10-14 4:46 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026101434-wrist-playing-51b3@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=axboe@kernel.dk \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=martin.nvme.dev@gmail.com \
--cc=sagi@grimberg.me \
--cc=security@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wagi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®