vfio/pci: Fix double free in dma-buf feature
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
vfio/pci: Fix double free in dma-buf feature
The error path through vfio_pci_core_feature_dma_buf() ignores its own advice to only use dma_buf_put() after dma_buf_export(), instead falling through the entire unwind chain. In the unlikely event that we encounter file descriptor exhaustion, this can result in an unbalanced refcount on the vfio device and double free of allocated objects.
Avoid this by moving the "put" directly into the error path and return the errno rather than entering the unwind chain.
From the CVE record · Linux
The Linux kernel's vfio/pci dma-buf feature has an error path that can unbalance a device reference count and double-free allocated objects if file descriptors are exhausted. The input does not specify the access, authentication, or user-interaction conditions needed to trigger this path.
Engineers running the Linux kernel should check whether their kernel includes the affected vfio/pci dma-buf code; affected versions are not specified.