]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vfio/pci: Check BAR resources before exporting a DMABUF
authorMatt Evans <mattev@meta.com>
Mon, 11 May 2026 14:58:24 +0000 (07:58 -0700)
committerAlex Williamson <alex@shazbot.org>
Thu, 14 May 2026 17:39:03 +0000 (11:39 -0600)
commit702809dabdecca807bdd50cfdcc1c980feb2ba62
treedbbe83b2e8867cd6415020c4a7ab68960fb06a0f
parent05f2a68b407a6817fe141dd64972c6ab8725312d
vfio/pci: Check BAR resources before exporting a DMABUF

A DMABUF exports access to BAR resources and, although they are
requested at startup time, we need to ensure they really were reserved
before exporting.  Otherwise, it's possible to access unreserved
resources through the export.

Add a check to the DMABUF-creation path.

Fixes: 5d74781ebc86c ("vfio/pci: Add dma-buf export support for MMIO regions")
Signed-off-by: Matt Evans <mattev@meta.com>
Link: https://lore.kernel.org/r/20260511145829.2993601-3-mattev@meta.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
drivers/vfio/pci/vfio_pci_dmabuf.c