All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Weiping Zhang <zhangweiping@didiglobal.com>
Cc: hch@infradead.org, axboe@kernel.dk, sagi@grimberg.me,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH 1/2] nvme: make sure write/poll_queues less or equal then cpu count
Date: Thu, 9 Apr 2020 10:22:50 -0700	[thread overview]
Message-ID: <20200409172250.GA1889561@dhcp-10-100-145-180.wdl.wdc.com> (raw)
In-Reply-To: <134d9a5fbcf54c1efb8ffa33a5439cd48094925c.1586447291.git.zhangweiping@didiglobal.com>

On Thu, Apr 09, 2020 at 11:57:35PM +0800, Weiping Zhang wrote:
> Check module parameter write/poll_queues before use, if user
> change them to larger than system cpu count, it will trigger a
> warning.
> 
> Reproduce:
> 
> echo $((`nproc`+1)) > /sys/module/nvme/parameters/write_queues
> echo 1 > /sys/block/nvme0n1/device/reset_controller

I don't think it is safe to allow these parameters to be runtime writeable
with the current code: the driver allocates space for queues during probe,
so you may end up with out of bounds access if you increase the number
of queues the driver creates after that.

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2020-04-09 17:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 15:57 [PATCH 0/2] verify module parameter write_queues and poll_queues Weiping Zhang
2020-04-09 15:57 ` [PATCH 1/2] nvme: make sure write/poll_queues less or equal then cpu count Weiping Zhang
2020-04-09 17:22   ` Keith Busch [this message]
2020-04-10  9:56     ` weiping zhang
2020-04-09 15:57 ` [PATCH 2/2] nvme: no need check write/poll_queues in nvme_init Weiping Zhang

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=20200409172250.GA1889561@dhcp-10-100-145-180.wdl.wdc.com \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=zhangweiping@didiglobal.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 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.