]> git.baikalelectronics.ru Git - kernel.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:32 +0000 (09:34 +0100)
commita93c0954c7066ea2b0e157d451a854f0067c8242
tree59f129d11c1d2680c8ffa5bb00059dd132d8035f
parent24244db528e909acce43a81eff7dec2877d7b44b
vfio/type1: exclude mdevs from VFIO_UPDATE_VADDR

commit e1d819e4868c8c3a30ee6335ab8d8e57a12ac048 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: b75273f0cb80 ("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>
drivers/vfio/vfio_iommu_type1.c
include/uapi/linux/vfio.h