RE: [PATCH v5 1/3] vfio: Fix container device registration life cycle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Anthony DeRossi <ajderossi@xxxxxxxxx>
> Sent: Sunday, November 6, 2022 6:45 AM
> 
> In vfio_device_open(), vfio_container_device_register() is always called

vfio_device_container_register()

> when open_count == 1. On error, vfio_device_container_unregister() is
> only called when open_count == 1 and close_device is set. This leaks a
> registration for devices without a close_device implementation.
> 
> In vfio_device_fops_release(), vfio_device_container_unregister() is
> called unconditionally. This can cause a device to be unregistered
> multiple times.
> 
> Treating container device registration/unregistration uniformly (always
> when open_count == 1) fixes both issues.
> 
> Fixes: ce4b4657ff18 ("vfio: Replace the DMA unmapping notifier with a
> callback")
> Signed-off-by: Anthony DeRossi <ajderossi@xxxxxxxxx>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux