All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
To: Ovidiu Panait <ovidiu.panait@windriver.com>
Cc: Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>,
	stable@vger.kernel.org
Subject: Re: [PATCH 5.10 1/2] nvme: restrict management ioctls to admin
Date: Thu, 24 Nov 2022 19:50:33 +0530	[thread overview]
Message-ID: <0cc14849-dcfa-d59c-6738-9f4080d32153@oracle.com> (raw)
In-Reply-To: <20221122102245.3397604-1-ovidiu.panait@windriver.com>


Hi Ovidiu,

On 22/11/22 3:52 pm, Ovidiu Panait wrote:
> From: Keith Busch <kbusch@kernel.org>
> 
> commit 23e085b2dead13b51fe86d27069895b740f749c0 upstream.
> 
> 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, which include resets and rescans, can be disruptive.
> 
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
> ---
> These backports are for CVE-2022-3169.
> 
>   drivers/nvme/host/core.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 3f106771d15b..d9c78fe85cb3 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3330,11 +3330,17 @@ static long nvme_dev_ioctl(struct file *file, unsigned int cmd,
>   	case NVME_IOCTL_IO_CMD:
>   		return nvme_dev_user_cmd(ctrl, argp);
>   	case NVME_IOCTL_RESET:
> +		if (!capable(CAP_SYS_ADMIN))
> +			return -EACCES;
>   		dev_warn(ctrl->device, "resetting controller\n");
>   		return nvme_reset_ctrl_sync(ctrl);
>   	case NVME_IOCTL_SUBSYS_RESET:
> +		if (!capable(CAP_SYS_ADMIN))
> +			return -EACCES;
>   		return nvme_reset_subsystem(ctrl);
>   	case NVME_IOCTL_RESCAN:
> +		if (!capable(CAP_SYS_ADMIN))
> +			return -EACCES;
>   		nvme_queue_scan(ctrl);
>   		return 0;
>   	default:

Should we apply this patch(1/2) to other stable releases as well, i.e. 
5.4, 4.19, 4.14 ?

This first patch applies cleanly there as well(5.4,4.19,4.14).

Thanks,
Harshit

      parent reply	other threads:[~2022-11-24 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 10:22 [PATCH 5.10 1/2] nvme: restrict management ioctls to admin Ovidiu Panait
2022-11-22 10:22 ` [PATCH 5.10 2/2] nvme: ensure subsystem reset is single threaded Ovidiu Panait
2022-11-24 14:20 ` Harshit Mogalapalli [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=0cc14849-dcfa-d59c-6738-9f4080d32153@oracle.com \
    --to=harshit.m.mogalapalli@oracle.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=ovidiu.panait@windriver.com \
    --cc=stable@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.