public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: "linan (AK)" <linan122@huawei.com>, "kbusch@fb.com" <kbusch@fb.com>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"yi.zhang@huawei.com" <yi.zhang@huawei.com>,
	"chengzhihao1@huawei.com" <chengzhihao1@huawei.com>
Subject: Re: question about CVE-2022-3169
Date: Fri, 11 Nov 2022 01:37:55 +0000	[thread overview]
Message-ID: <b583ecf6-950f-b681-054d-3a4ebaee7e73@nvidia.com> (raw)
In-Reply-To: <144969fe-3764-d5eb-587a-79c4fd195076@huawei.com>

Lian,

On 11/10/22 02:23, linan (AK) wrote:
> Hi,
> 1e866afd4bcd("nvme: ensure subsystem reset is single threaded")
> fixed CVE-2022-3169.
> 
> IIUC, ERROR path I got in this CVE:
>             CPU1                                CPU2
> nvme_dev_ioctl                            nvme_dev_ioctl
>    nvme_reset_ctrl_sync                      nvme_reset_subsystem
>        reset_work
>          nvme_reset_work
>            nvme_setup_io_queues
>              nvme_remap_bar(dev, size)
>                if (size <= dev->bar_mapped_size)
>                  return 0;
>                iounmap
>                                                reg_write32   //error
>                ioremap
> 
> In nvme_remap_bar(), the premise of ioremap is "size > 
> dev->bar_mapped_size".
>    size = NVME_REG_DBS + ((nr_io_queues + 1) * 8 * dev->db_stride);
>      1)nr_io_queue = dev->nr_allocated_queues - 1, Onece set to
> "nvme_max_io_queues(dev) + 1" during probe time, it could not change.
>      2)db_stride is doorbell stride, it didn't change during my test
> Therefore, I cant find a way to make iounmap happen.
> 
> Could you tell me how you trigger the ERROR?
> 
> Thanks,
> Nan.
> 

Do you have a script to reproduce this ?

-ck


  parent reply	other threads:[~2022-11-11  1:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 10:23 question about CVE-2022-3169 linan (AK)
2022-11-10 16:17 ` Keith Busch
2022-11-11  1:37 ` Chaitanya Kulkarni [this message]
2022-11-24  9:21   ` linan (AK)

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=b583ecf6-950f-b681-054d-3a4ebaee7e73@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=chengzhihao1@huawei.com \
    --cc=kbusch@fb.com \
    --cc=linan122@huawei.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=yi.zhang@huawei.com \
    /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