In the Linux kernel, the following vulnerability has been resolved:
iommu/vt-d: Use device rbtree in iopf reporting path
The existing I/O page fault handler currently locates the PCI device by calling pcigetdomainbusandslot(). This function searches the list of all PCI devices until the desired device is found. To improve lookup efficiency, replace it with devicerbtree_find() to search the device within the probed device rbtree.
The I/O page fault is initiated by the device, which does not have any synchronization mechanism with the software to ensure that the device stays in the probed device tree. Theoretically, a device could be released by the IOMMU subsystem after devicerbtreefind() and before iopfgetdevfaultparam(), which would cause a use-after-free problem.
Add a mutex to synchronize the I/O page fault reporting path and the IOMMU release device path. This lock doesn't introduce any performance overhead, as the conflict between I/O page fault reporting and device releasing is very rare.