vfio/type1: exclude mdevs from VFIO_UPDATE_VADDR
authorSteve Sistare <steven.sistare@oracle.com>
Tue, 31 Jan 2023 16:58:03 +0000 (08:58 -0800)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 9 Feb 2023 18:39:14 +0000 (11:39 -0700)
commitef3a3f6a294ba65fd906a291553935881796f8a5
treed6b30055cb984403a0b05847271bba9d7dbfb045
parent168a9c91fe0a1180959b6394f4566de7080244b6
vfio/type1: exclude mdevs from VFIO_UPDATE_VADDR

Disable the VFIO_UPDATE_VADDR capability if mediated devices are present.
Their kernel threads could be blocked indefinitely by a misbehaving
userland while trying to pin/unpin pages while vaddrs are being updated.

Do not allow groups to be added to the container while vaddr's are invalid,
so we never need to block user threads from pinning, and can delete the
vaddr-waiting code in a subsequent patch.

Fixes: c3cbab24db38 ("vfio/type1: implement interfaces to update vaddr")
Cc: stable@vger.kernel.org
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/1675184289-267876-2-git-send-email-steven.sistare@oracle.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_iommu_type1.c
include/uapi/linux/vfio.h