Skip to content

Protect against iommu driver disconnect

Alex Williamson kvm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2vfio: Convert container->group_lock to rwsemdrivers/vfio/vfio.c+11 -100 replies
2/2vfio: Use down_reads to protect iommu disconnectsdrivers/vfio/vfio.c+46 -160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Protect against iommu driver disconnect

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(-)