mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, a.hindborg@kernel.org,
	leitao@debian.org, kch@nvidia.com, sagi@grimberg.me, hch@lst.de,
	upstream+nvme@sigma-star.at, Richard Weinberger <richard@nod.at>
Subject: [PATCH 2/2] nvmet: Restrict in-band config files to root
Date: Sun, 20 Apr 2025 12:47:26 +0200	[thread overview]
Message-ID: <20250420104726.2963750-2-richard@nod.at> (raw)
In-Reply-To: <20250420104726.2963750-1-richard@nod.at>

There is no need to have key material world readable.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/nvme/target/configfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index e44ef69dffc2..7327543f161d 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -2128,7 +2128,7 @@ static ssize_t nvmet_host_dhchap_key_store(struct config_item *item,
 	return ret < 0 ? ret : count;
 }
 
-CONFIGFS_ATTR(nvmet_host_, dhchap_key);
+CONFIGFS_ATTR_PERM(nvmet_host_, dhchap_key, S_IRUSR | S_IWUSR);
 
 static ssize_t nvmet_host_dhchap_ctrl_key_show(struct config_item *item,
 		char *page)
@@ -2161,7 +2161,7 @@ static ssize_t nvmet_host_dhchap_ctrl_key_store(struct config_item *item,
 	return ret < 0 ? ret : count;
 }
 
-CONFIGFS_ATTR(nvmet_host_, dhchap_ctrl_key);
+CONFIGFS_ATTR_PERM(nvmet_host_, dhchap_ctrl_key, S_IRUSR | S_IWUSR);
 
 static ssize_t nvmet_host_dhchap_hash_show(struct config_item *item,
 		char *page)
@@ -2187,7 +2187,7 @@ static ssize_t nvmet_host_dhchap_hash_store(struct config_item *item,
 	return count;
 }
 
-CONFIGFS_ATTR(nvmet_host_, dhchap_hash);
+CONFIGFS_ATTR_PERM(nvmet_host_, dhchap_hash, S_IRUSR | S_IWUSR);
 
 static ssize_t nvmet_host_dhchap_dhgroup_show(struct config_item *item,
 		char *page)
@@ -2217,7 +2217,7 @@ static ssize_t nvmet_host_dhchap_dhgroup_store(struct config_item *item,
 	return count;
 }
 
-CONFIGFS_ATTR(nvmet_host_, dhchap_dhgroup);
+CONFIGFS_ATTR_PERM(nvmet_host_, dhchap_dhgroup, S_IRUSR | S_IWUSR);
 
 static struct configfs_attribute *nvmet_host_attrs[] = {
 	&nvmet_host_attr_dhchap_key,
-- 
2.48.1


  reply	other threads:[~2025-04-20 10:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-20 10:47 [PATCH 1/2] configfs: Add CONFIGFS_ATTR_PERM helper Richard Weinberger
2025-04-20 10:47 ` Richard Weinberger [this message]
2025-04-22  6:32   ` [PATCH 2/2] nvmet: Restrict in-band config files to root Chaitanya Kulkarni
2025-04-22  6:36     ` Richard Weinberger
2025-04-22 11:53   ` Sagi Grimberg
2025-04-22  6:27 ` [PATCH 1/2] configfs: Add CONFIGFS_ATTR_PERM helper Chaitanya Kulkarni
2025-04-22 11:53 ` Sagi Grimberg
2025-04-25  6:27 ` Andreas Hindborg

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=20250420104726.2963750-2-richard@nod.at \
    --to=richard@nod.at \
    --cc=a.hindborg@kernel.org \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=upstream+nvme@sigma-star.at \
    /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®