From: Keith Busch <kbusch@kernel.org>
To: Maurizio Lombardi <mlombard@redhat.com>
Cc: hare@suse.de, hch@lst.de, dwagner@suse.de,
linux-nvme@lists.infradead.org, mlombard@arkamax.eu
Subject: Re: [PATCH] nvmet: fix max_qid race between configfs and controller allocation
Date: Mon, 10 Aug 2026 08:30:25 -0600 [thread overview]
Message-ID: <annggXmP2yS47QN4@kbusch-mbp> (raw)
In-Reply-To: <20260810133301.52537-1-mlombard@redhat.com>
On Mon, Aug 10, 2026 at 03:33:01PM +0200, Maurizio Lombardi wrote:
> Fix this by protecting the queue allocations and list insertion in
> nvmet_alloc_ctrl() with down_read(&nvmet_config_sem). Because
> nvmet_subsys_attr_qid_max_store() acquires down_write(&nvmet_config_sem)
> to modify the attribute, this safely prevents the configfs writer from
> modifying max_qid during controller creation.
I think there's still a race in nvmet_check_cqid() such that a command
can access an out-of-bounds index if the target side changes
subsys->max_qid to a larger value and the host sends a command with a
larger cqid than the array was initially allocated. Should the max_qid
be copied from the subystem to the controller that allocated the queue
array?
next prev parent reply other threads:[~2026-08-10 14:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 13:33 [PATCH] nvmet: fix max_qid race between configfs and controller allocation Maurizio Lombardi
2026-08-10 14:30 ` Keith Busch [this message]
2026-08-10 14:51 ` Maurizio Lombardi
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=annggXmP2yS47QN4@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=dwagner@suse.de \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-nvme@lists.infradead.org \
--cc=mlombard@arkamax.eu \
--cc=mlombard@redhat.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