]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:47:42 +0000 (16:47 +0100)
commitac13be4b063a55acecbb4a6a516dea6a6b1ecf40
treeddbb0ac359c26a15f4607904fafefa29b83ffc11
parentf384e988dd252d0f8464dc594b7cc28dc30280be
vfio/type1: exclude mdevs from VFIO_UPDATE_VADDR

BugLink: https://bugs.launchpad.net/bugs/2011425
commit ef3a3f6a294ba65fd906a291553935881796f8a5 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/vfio/vfio_iommu_type1.c
include/uapi/linux/vfio.h