VFIO PCI does a security check as part of hot reset to prove that the user has permission to manipulate all the devices that will be impacted by the reset. Use a new API vfio_file_has_dev() to perform this security check against the struct file directly and remove the vfio_group from VFIO PCI. Since VFIO PCI was the last user of vfio_group_get_external_user() and vfio_group_put_external_user() remove it as well.
Showing the changes to include (1 of 3 files). Show all
Unified · Split
| @@ -138,11 +138,10 @@ int vfio_mig_get_next_state(struct vfio_device *device, · 137 unmodified lines | ||
| 138 | 138 | /* |
| 139 | 139 | * External user API |
| 140 | 140 | */ |
| 141 | −extern struct vfio_group *vfio_group_get_external_user(struct file *filep); | |
| 142 | −extern void vfio_group_put_external_user(struct vfio_group *group); | |
| 143 | 141 | extern struct iommu_group *vfio_file_iommu_group(struct file *file); |
| 144 | 142 | extern bool vfio_file_enforced_coherent(struct file *file); |
| 145 | 143 | extern void vfio_file_set_kvm(struct file *file, struct kvm *kvm); |
| 144 | +extern bool vfio_file_has_dev(struct file *file, struct vfio_device *device); | |
| 146 | 145 | |
| 147 | 146 | #define VFIO_PIN_PAGES_MAX_ENTRIES (PAGE_SIZE/sizeof(unsigned long)) |
| 148 | 147 | |