mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Protect against iommu driver disconnect
@ 2013-04-25 22:24 Alex Williamson
  2013-04-25 22:24 ` [PATCH 1/2] vfio: Convert container->group_lock to rwsem Alex Williamson
  2013-04-25 22:24 ` [PATCH 2/2] vfio: Use down_reads to protect iommu disconnects Alex Williamson
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Williamson @ 2013-04-25 22:24 UTC (permalink / raw)
  To: alex.williamson; +Cc: linux-kernel, kvm, mst

Michael Tsirkin pointed out that file operations on /dev/vfio/vfio
dereference iommu_driver and iommu_data without a lock.  If releasing
a group or unsetting the container occurs concurrently, we could race.
We currently use a mutex when setting this association, so we can
convert to a rwsem keeping the existing mutex critical sections as
down_writes and add down_reads where these are used.  Thanks,

Alex

---

Alex Williamson (2):
      vfio: Convert container->group_lock to rwsem
      vfio: Use down_reads to protect iommu disconnects


 drivers/vfio/vfio.c |   83 +++++++++++++++++++++++++++++++++++----------------
 1 file changed, 57 insertions(+), 26 deletions(-)

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

end of thread, other threads:[~2013-04-25 22:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-25 22:24 [PATCH 0/2] Protect against iommu driver disconnect Alex Williamson
2013-04-25 22:24 ` [PATCH 1/2] vfio: Convert container->group_lock to rwsem Alex Williamson
2013-04-25 22:24 ` [PATCH 2/2] vfio: Use down_reads to protect iommu disconnects Alex Williamson

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®