From: Maurizio Lombardi <mlombard@redhat.com>
To: linux-nvme@lists.infradead.org
Cc: hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com
Subject: [PATCH V3 0/3] Fix a race condition when performing a controller reset
Date: Tue, 16 Nov 2021 16:49:17 +0100 [thread overview]
Message-ID: <20211116154920.87279-1-mlombard@redhat.com> (raw)
Memory leaks and kernel panics involving the nvmet driver
have been observed when an initiator executes a reset_controller
operation while doing I/O.
The problem is due to a race condition between io_work
and release_queue, the latter may end up destroying the
commands while io_work is still running, causing use-after-free
and memory leaks.
V3:
- rename nvmet_tcp_free_iovec() to nvmet_tcp_free_cmd_buffers()
V2:
- Use "queue->rcv_state" to prevent the race condition, as suggested
by Sagi Grimberg.
- Dropped the changes to nvmet_tcp_queue_response() because they are
no longer necessary.
- Fix the memory leaks in a separate patch (PATCH 3/3).
Maurizio Lombardi (3):
nvmet-tcp: fix a race condition between release_queue and io_work
nvmet-tcp: add an helper to free the cmd buffers
nvmet-tcp: fix memory leak when performing a controller reset
drivers/nvme/target/tcp.c | 37 ++++++++++++++++++++++++++-----------
1 file changed, 26 insertions(+), 11 deletions(-)
--
2.27.0
next reply other threads:[~2021-11-16 15:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 15:49 Maurizio Lombardi [this message]
2021-11-16 15:49 ` [PATCH V3 1/3] nvmet-tcp: fix a race condition between release_queue and io_work Maurizio Lombardi
2021-11-16 17:25 ` John Meneghini
2021-11-16 15:49 ` [PATCH V3 2/3] nvmet-tcp: add an helper to free the cmd buffers Maurizio Lombardi
2021-11-16 16:23 ` Sagi Grimberg
2021-11-16 17:25 ` John Meneghini
2021-11-16 15:49 ` [PATCH V3 3/3] nvmet-tcp: fix memory leak when performing a controller reset Maurizio Lombardi
2021-11-16 17:26 ` John Meneghini
2021-11-16 20:26 ` [PATCH V3 0/3] Fix a race condition " Keith Busch
2021-11-19 17:11 ` Christoph Hellwig
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=20211116154920.87279-1-mlombard@redhat.com \
--to=mlombard@redhat.com \
--cc=chaitanya.kulkarni@wdc.com \
--cc=hch@lst.de \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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