From: Nilay Shroff <nilay@linux.ibm.com>
To: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>,
linux-nvme@lists.infradead.org
Cc: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me,
hare@kernel.org, wagi@kernel.org, kanie@linux.alibaba.com,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl()
Date: Fri, 30 Oct 2026 23:13:37 +0530 [thread overview]
Message-ID: <9574eb9f-050c-4148-a785-11782ada856c@linux.ibm.com> (raw)
In-Reply-To: <20261030170151.49844-1-christian.aurichzm@gmail.com>
On 10/30/26 10:31 PM, Christian Aurich Zanettini Martins wrote:
> nvme_tcp_free_ctrl() reads ctrl->ctrl.opts to know how many queue
> mutexes to destroy. When creating the controller fails,
> nvmf_create_ctrl() frees opts as soon as nvme_tcp_create_ctrl()
> returns, but a concurrent open of the character device can hold the
> last reference to the controller. With CONFIG_DEBUG_KOBJECT_RELEASE,
> which delays the release, every failed connect reads freed memory:
>
> BUG: KASAN: slab-use-after-free in nvme_tcp_free_ctrl+0x38b/0x430
> Read of size 4 at addr ffff888005b93740 by task kworker/2:1/51
>
> Keep the size of the queue array in the controller and use it instead.
>
> Fixes: 2eeeaa9c1ff0 ("nvme-tcp: Validate the queue state under the queue lock in the address attribute")
> Cc:stable@vger.kernel.org
> Signed-off-by: Christian Aurich Zanettini Martins<christian.aurichzm@gmail.com>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
prev parent reply other threads:[~2026-10-30 17:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 17:01 Christian Aurich Zanettini Martins
2026-10-30 17:43 ` Nilay Shroff [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=9574eb9f-050c-4148-a785-11782ada856c@linux.ibm.com \
--to=nilay@linux.ibm.com \
--cc=axboe@kernel.dk \
--cc=christian.aurichzm@gmail.com \
--cc=hare@kernel.org \
--cc=hch@lst.de \
--cc=kanie@linux.alibaba.com \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=stable@vger.kernel.org \
--cc=wagi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®