virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] vhost-scsi: Fix crashes and management op hangs
@ 2023-03-21  2:06 Mike Christie
  2023-03-21  2:06 ` [PATCH v2 1/7] vhost-scsi: Fix vhost_scsi struct use after free Mike Christie
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Mike Christie @ 2023-03-21  2:06 UTC (permalink / raw)
  To: target-devel, linux-scsi, stefanha, jasowang, mst, sgarzare,
	virtualization

The following patches were made over Linus tree. The patches fix 3
issues:

1. If a user performs LIO LUN unmapping before the endpoint has been
cleared then we can end up trying to free a bogus tmf struct if the
TMF is still exucuting when we do the unmap.
2. If vhost_scsi_setup_vq_cmds fails we can leave the tpg->vhost_scsi
pointer set and we can end up trying to access a freed struct.
3. Management operations like LUN mapping/unmapping and device addition
hang for 30 seconds or up to N minutes depending on the device.

The problem is that we use a global mutex to protect the list of tpgs
and for accessing the tpg, and to make sure they are flushed. We then
hold that mutex during a lot of management operations. So if you
are just trying to add another device, it will have to wait on another
device if we are in the middle of clearing it's endpoint and it's
waiting on hung IO.

This patchset fixes up the ordering of how we flush IO and release
refcounts and how often the global mutex is used so we don't need to
always hold it

v2:
1. Added fix for possible use after free and merge with a locking
cleanup patch.
2. Added fix for LIO LUN unmap during TMF execution bug.
3. Fixed bug where we needed to hold the tpg mutex instead of the
vhost_scsi_mutex when calling vhost_scsi_do_plug.


_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

end of thread, other threads:[~2023-03-21 17:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-21  2:06 [PATCH v2 0/7] vhost-scsi: Fix crashes and management op hangs Mike Christie
2023-03-21  2:06 ` [PATCH v2 1/7] vhost-scsi: Fix vhost_scsi struct use after free Mike Christie
2023-03-21  2:06 ` [PATCH v2 2/7] vhost-scsi: Fix crash during LUN unmapping Mike Christie
2023-03-21  2:06 ` [PATCH v2 3/7] vhost-scsi: Delay releasing our refcount on the tpg Mike Christie
2023-03-21  2:06 ` [PATCH v2 4/7] vhost-scsi: Drop device mutex use in vhost_scsi_do_plug Mike Christie
2023-03-21  2:06 ` [PATCH v2 5/7] vhost-scsi: Check for a cleared backend before queueing an event Mike Christie
2023-03-21  2:06 ` [PATCH v2 6/7] vhost-scsi: Drop vhost_scsi_mutex use in port callouts Mike Christie
2023-03-21  2:06 ` [PATCH v2 7/7] vhost-scsi: Reduce vhost_scsi_mutex use Mike Christie
2023-03-21  2:29 ` [PATCH v2 0/7] vhost-scsi: Fix crashes and management op hangs michael.christie
2023-03-21  7:12   ` Michael S. Tsirkin
2023-03-21 17:25     ` Mike Christie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).