Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'vfio-v6.19-rc8' of https://github.com/awilliam/linux-vfio

Pull VFIO fix from Alex Williamson:

- Fix a gap in the initial VFIO DMABUF implementation where it's
required to explicitly implement a failing pin callback to prevent
pinned importers that cannot properly support move_notify.
(Leon Romanovsky)

* tag 'vfio-v6.19-rc8' of https://github.com/awilliam/linux-vfio:
vfio: Prevent from pinned DMABUF importers to attach to VFIO DMABUF

+12
+12
drivers/vfio/pci/vfio_pci_dmabuf.c
··· 20 20 u8 revoked : 1; 21 21 }; 22 22 23 + static int vfio_pci_dma_buf_pin(struct dma_buf_attachment *attachment) 24 + { 25 + return -EOPNOTSUPP; 26 + } 27 + 28 + static void vfio_pci_dma_buf_unpin(struct dma_buf_attachment *attachment) 29 + { 30 + /* Do nothing */ 31 + } 32 + 23 33 static int vfio_pci_dma_buf_attach(struct dma_buf *dmabuf, 24 34 struct dma_buf_attachment *attachment) 25 35 { ··· 86 76 } 87 77 88 78 static const struct dma_buf_ops vfio_pci_dmabuf_ops = { 79 + .pin = vfio_pci_dma_buf_pin, 80 + .unpin = vfio_pci_dma_buf_unpin, 89 81 .attach = vfio_pci_dma_buf_attach, 90 82 .map_dma_buf = vfio_pci_dma_buf_map, 91 83 .unmap_dma_buf = vfio_pci_dma_buf_unmap,