Skip to content

Commit 1f97d9d

Browse files
committed
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
2 parents fcb70a5 + 61ceaf2 commit 1f97d9d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/vfio/pci/vfio_pci_dmabuf.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ struct vfio_pci_dma_buf {
2020
u8 revoked : 1;
2121
};
2222

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+
2333
static int vfio_pci_dma_buf_attach(struct dma_buf *dmabuf,
2434
struct dma_buf_attachment *attachment)
2535
{
@@ -76,6 +86,8 @@ static void vfio_pci_dma_buf_release(struct dma_buf *dmabuf)
7686
}
7787

7888
static const struct dma_buf_ops vfio_pci_dmabuf_ops = {
89+
.pin = vfio_pci_dma_buf_pin,
90+
.unpin = vfio_pci_dma_buf_unpin,
7991
.attach = vfio_pci_dma_buf_attach,
8092
.map_dma_buf = vfio_pci_dma_buf_map,
8193
.unmap_dma_buf = vfio_pci_dma_buf_unmap,

0 commit comments

Comments
 (0)