linux-IllusionX/tools/testing
Jason Gunthorpe 996dc53ac2 iommufd: Do not allow creating areas without READ or WRITE
This results in passing 0 or just IOMMU_CACHE to iommu_map(). Most of
the page table formats don't like this:

  amdv1 - -EINVAL
  armv7s - returns 0, doesn't update mapped
  arm-lpae - returns 0 doesn't update mapped
  dart - returns 0, doesn't update mapped
  VT-D - returns -EINVAL

Unfortunately the three formats that return 0 cause serious problems:

 - Returning ret = but not uppdating mapped from domain->map_pages()
   causes an infinite loop in __iommu_map()

 - Not writing ioptes means that VFIO/iommufd have no way to recover them
   and we will have memory leaks and worse during unmap

Since almost nothing can support this, and it is a useless thing to do,
block it early in iommufd.

Cc: stable@kernel.org
Fixes: aad37e71d5 ("iommufd: IOCTLs for the io_pagetable")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/1-v1-1211e1294c27+4b1-iommu_no_prot_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2024-08-26 09:16:13 +02:00
..
crypto/chacha20-s390
cxl CXL for v6.11 merge window 2024-07-28 09:33:28 -07:00
fault-injection
ktest ktest: force $buildonly = 1 for 'make_warnings_file' test type 2024-03-15 12:36:19 -04:00
kunit RISC-V SoC Kconfig Updates for v6.10 2024-05-07 11:02:56 +02:00
memblock memblock tests: add memblock_overlaps_region_checks 2024-06-05 10:22:22 +03:00
nvdimm testing: nvdimm: Add MODULE_DESCRIPTION() macros 2024-06-17 18:43:08 -05:00
radix-tree bitmap-6.11-rc1 2024-07-26 09:50:36 -07:00
scatterlist
selftests iommufd: Do not allow creating areas without READ or WRITE 2024-08-26 09:16:13 +02:00
vsock test/vsock: add install target 2024-07-13 15:17:35 -07:00