mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2]  Fix use-after-free bug when ports are removed
@ 2019-07-03 17:01 Logan Gunthorpe
  2019-07-03 17:01 ` [PATCH 1/2] nvmet-loop: Fix use-after-free bug when a port is removed Logan Gunthorpe
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Logan Gunthorpe @ 2019-07-03 17:01 UTC (permalink / raw)
  To: linux-kernel, linux-nvme, Christoph Hellwig, Sagi Grimberg
  Cc: Stephen Bates, Logan Gunthorpe

Hey,

NVME target ports can be removed while there are still active
controllers. Largely this is fine, except some admin commands
can access the req->port (for example, id-ctrl uses the port's
inline date size as part of it's response). This was found
while testing with KASAN.

Two patches follow which disconnect active controllers when the
ports are removed for loop and rdma. I'm not sure if fc has the
same issue and have no way to test this.

Alternatively, we could add reference counting to the struct port,
but I think this is a more involved change and could be done later
after we fix the bug quickly.

Thanks,

Logan

--

Logan Gunthorpe (2):
  nvmet-loop: Fix use-after-free bug when a port is removed
  nvmet-rdma: Fix use-after-free bug when a port is removed

 drivers/nvme/target/loop.c | 11 +++++++++++
 drivers/nvme/target/rdma.c | 16 ++++++++++++++++
 2 files changed, 27 insertions(+)

--
2.20.1

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

end of thread, other threads:[~2019-07-03 19:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-03 17:01 [PATCH 0/2] Fix use-after-free bug when ports are removed Logan Gunthorpe
2019-07-03 17:01 ` [PATCH 1/2] nvmet-loop: Fix use-after-free bug when a port is removed Logan Gunthorpe
2019-07-03 17:01 ` [PATCH 2/2] nvmet-rdma: " Logan Gunthorpe
2019-07-03 17:33 ` [PATCH 0/2] Fix use-after-free bug when ports are removed Sagi Grimberg
2019-07-03 18:13   ` Logan Gunthorpe
2019-07-03 19:20     ` Sagi Grimberg
2019-07-03 19:24       ` Logan Gunthorpe
2019-07-03 19:19 ` Logan Gunthorpe

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®