linux/drivers/vfio
Alex Williamson 49550787a9 vfio-mdev: Fix remove race
Using the mtty mdev sample driver we can generate a remove race by
starting one shell that continuously creates mtty devices and several
other shells all attempting to remove devices, in my case four remove
shells.  The fault occurs in mdev_remove_sysfs_files() where the
passed type arg is NULL, which suggests we've received a struct device
in mdev_device_remove() but it's in some sort of teardown state.  The
solution here is to make use of the accidentally unused list_head on
the mdev_device such that the mdev core keeps a list of all the mdev
devices.  This allows us to validate that we have a valid mdev before
we start removal, remove it from the list to prevent others from
working on it, and if the vendor driver refuses to remove, we can
re-add it to the list.

Cc: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2016-12-30 08:13:33 -07:00
..
mdev vfio-mdev: Fix remove race 2016-12-30 08:13:33 -07:00
pci pci-v4.10-changes 2016-12-15 12:46:48 -08:00
platform vfio_platform: Updated to use vfio_set_irqs_validate_and_prepare() 2016-11-17 08:33:20 -07:00
Kconfig vfio: Mediated device Core driver 2016-11-17 08:24:48 -07:00
Makefile vfio: Mediated device Core driver 2016-11-17 08:24:48 -07:00
vfio_iommu_spapr_tce.c powerpc/mm/iommu, vfio/spapr: Put pages on VFIO container shutdown 2016-12-02 14:38:34 +11:00
vfio_iommu_type1.c vfio/type1: Restore mapping performance with mdev support 2016-12-30 08:13:31 -07:00
vfio_spapr_eeh.c drivers/vfio: Support EEH error injection 2015-05-12 20:33:35 +10:00
vfio.c vfio: support notifier chain in vfio_group 2016-12-01 10:40:05 -07:00
virqfd.c vfio: Split virqfd into a separate module for vfio bus drivers 2015-03-17 08:33:38 -06:00