Database/Kernel, userspace & hypervisor
Linux kernel (drivers/vfio/pci): When a tenant closes its passed-through PCI device, vfio disables the function before
Impact
When a tenant closes its passed-through PCI device, vfio disables the function before it revokes the dma-buf exports over that device's BARs. In the window between the two, the BAR pages stay mapped while the underlying resources are released back to the kernel, so the departing tenant - or anyone it handed the dma-buf fd to - keeps read/write access to MMIO that a different driver, and potentially another tenant's device, now owns.
Who can reach it
A tenant holding /dev/vfio/<group> exports a dma-buf over its device BARs, keeps or passes that fd, then closes the device fd. Entirely reachable from inside the container with only the passthrough device node; requires a kernel with vfio-pci dma-buf export support and that feature in use.
What to do
Update to a stable kernel carrying commits 4f1000a3 / d9770870. Interim: do not enable or permit the vfio-pci dma-buf export feature for tenant-held devices, and do not allow dma-buf fds to be passed out of the tenant's namespace.
References
This entry is curated: imported from vendor advisories with machine assistance, not yet individually verified. Confirm against your vendor's advisory before acting, and report anything wrong.