From: Kanchan Joshi <joshi.k@samsung.com>
To: Keith Busch <kbusch@fb.com>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me,
Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH] nvme: restrict management ioctls to admin
Date: Fri, 9 Sep 2022 18:41:55 +0530 [thread overview]
Message-ID: <20220909131155.GA21234@test-zns> (raw)
In-Reply-To: <20220908213517.3085323-1-kbusch@fb.com>
[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]
On Thu, Sep 08, 2022 at 02:35:17PM -0700, Keith Busch wrote:
>From: Keith Busch <kbusch@kernel.org>
>
>The passthrough commands already have this restriction, but the other
>operations do not. Require the same capabilities for all users as all of
>these operations can be disruptive.
>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>---
> drivers/nvme/host/ioctl.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
>index 27614bee7380..d23978e993c6 100644
>--- a/drivers/nvme/host/ioctl.c
>+++ b/drivers/nvme/host/ioctl.c
>@@ -749,6 +749,9 @@ long nvme_dev_ioctl(struct file *file, unsigned int cmd,
> struct nvme_ctrl *ctrl = file->private_data;
> void __user *argp = (void __user *)arg;
>
>+ if (!capable(CAP_SYS_ADMIN))
>+ return -EACCES;
>+
I too came across this and wondered why this check is not present here.
Acked-by: Kanchan Joshi <joshi.k@samsung.com>
It's a different matter that I was looking at increasing the access
granularity (something like scsi whitelisting). Hope to have
conversations on a RFC soon.
>
>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2022-09-09 13:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220908214000epcas5p1a9bf63bc35632888248e094daacbcbde@epcas5p1.samsung.com>
2022-09-08 21:35 ` [PATCH] nvme: restrict management ioctls to admin Keith Busch
2022-09-09 13:11 ` Kanchan Joshi [this message]
2022-09-09 14:57 ` Jens Axboe
2022-09-09 15:11 ` Christoph Hellwig
2022-09-12 12:24 ` Sagi Grimberg
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=20220909131155.GA21234@test-zns \
--to=joshi.k@samsung.com \
--cc=hch@lst.de \
--cc=kbusch@fb.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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