All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/3] Fix a race condition when performing a controller reset
@ 2021-11-15 16:31 Maurizio Lombardi
  2021-11-15 16:31 ` [PATCH V2 1/3] nvmet-tcp: add an helper to free the iovec Maurizio Lombardi
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Maurizio Lombardi @ 2021-11-15 16:31 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, sagi, chaitanya.kulkarni

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.

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: add an helper to free the iovec
  nvmet-tcp: fix a race condition between release_queue and io_work
  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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-11-16 10:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 16:31 [PATCH V2 0/3] Fix a race condition when performing a controller reset Maurizio Lombardi
2021-11-15 16:31 ` [PATCH V2 1/3] nvmet-tcp: add an helper to free the iovec Maurizio Lombardi
2021-11-16  9:00   ` Sagi Grimberg
2021-11-16  9:05     ` Maurizio Lombardi
2021-11-15 16:31 ` [PATCH V2 2/3] nvmet-tcp: fix a race condition between release_queue and io_work Maurizio Lombardi
2021-11-16  8:57   ` Sagi Grimberg
2021-11-15 16:31 ` [PATCH V2 3/3] nvmet-tcp: fix memory leak when performing a controller reset Maurizio Lombardi
2021-11-16  9:07   ` Sagi Grimberg
2021-11-16  9:22     ` Maurizio Lombardi
2021-11-16 10:11       ` Sagi Grimberg

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.