From 50b20e75ef04c31603a5b0cfe1f59c749f172724 Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Mon, 2 Oct 2023 11:38:04 +0800 Subject: sys/linux: add iommufd MOCK_DOMAIN_REPLACE and ACCESS_REPLACE_IOAS descriptions Added IOMMU_TEST_OP_MOCK_DOMAIN_REPLACE and IOMMU_TEST_OP_ACCESS_REPLACE_IOAS ioctl syscall descriptions and let syzkaller hit these ioctls easily and quickly. Signed-off-by: Pengfei Xu --- sys/linux/dev_iommu.txt | 18 ++++++++++++++++++ sys/linux/dev_iommu.txt.const | 2 ++ 2 files changed, 20 insertions(+) (limited to 'sys/linux') diff --git a/sys/linux/dev_iommu.txt b/sys/linux/dev_iommu.txt index 7abda765b..5a159a536 100644 --- a/sys/linux/dev_iommu.txt +++ b/sys/linux/dev_iommu.txt @@ -205,6 +205,8 @@ ioctl$IOMMU_TEST_OP_ACCESS_PAGES$syz(fd fd_iommufd, cmd const[IOMMU_TEST_CMD], a ioctl$IOMMU_TEST_OP_ACCESS_RW(fd fd_iommufd, cmd const[IOMMU_TEST_CMD], arg ptr[in, iommu_test_cmd$access_rw]) ioctl$IOMMU_TEST_OP_ACCESS_RW$syz(fd fd_iommufd, cmd const[IOMMU_TEST_CMD], arg ptr[in, iommu_test_cmd$access_rw$syz]) ioctl$IOMMU_TEST_OP_SET_TEMP_MEMORY_LIMIT(fd fd_iommufd, cmd const[IOMMU_TEST_CMD], arg ptr[in, iommu_test_cmd$memory_limit]) +ioctl$IOMMU_TEST_OP_MOCK_DOMAIN_REPLACE(fd fd_iommufd, cmd const[IOMMU_TEST_CMD], arg ptr[in, iommu_test_cmd$mock_domain_replace]) +ioctl$IOMMU_TEST_OP_ACCESS_REPLACE_IOAS(fd fd_iommufd, cmd const[IOMMU_TEST_CMD], arg ptr[in, iommu_test_cmd$access_replace_ioas]) ioctl$IOMMU_DESTROY$device(fd fd_iommufd, cmd const[IOMMU_DESTROY], arg ptr[in, iommu_destroy$device]) ioctl$IOMMU_DESTROY$hwpt(fd fd_iommufd, cmd const[IOMMU_DESTROY], arg ptr[in, iommu_destroy$hwpt]) @@ -324,6 +326,22 @@ iommu_test_cmd$memory_limit { limit int32 } [size[IOMMU_TEST_CMD_SIZE]] +iommu_test_cmd$mock_domain_replace { + size len[parent, int32] + op const[IOMMU_TEST_OP_MOCK_DOMAIN_REPLACE, int32] + id ioas_handle + __reserved const[0x0, int32] + pt_id int32 +} [size[IOMMU_TEST_CMD_SIZE]] + +iommu_test_cmd$access_replace_ioas { + size len[parent, int32] + op const[IOMMU_TEST_OP_ACCESS_REPLACE_IOAS, int32] + id fd_access + __reserved const[0x0, int32] + ioas_id int32 +} [size[IOMMU_TEST_CMD_SIZE]] + iommu_destroy$device { size len[parent, int32] id device_handle diff --git a/sys/linux/dev_iommu.txt.const b/sys/linux/dev_iommu.txt.const index 15b448d8c..1386e23d6 100644 --- a/sys/linux/dev_iommu.txt.const +++ b/sys/linux/dev_iommu.txt.const @@ -27,6 +27,8 @@ IOMMU_TEST_OP_MD_CHECK_MAP = 3 IOMMU_TEST_OP_MD_CHECK_REFS = 4 IOMMU_TEST_OP_MOCK_DOMAIN = 2 IOMMU_TEST_OP_SET_TEMP_MEMORY_LIMIT = 9 +IOMMU_TEST_OP_MOCK_DOMAIN_REPLACE = 10 +IOMMU_TEST_OP_ACCESS_REPLACE_IOAS = 11 IOMMU_VFIO_IOAS = 15240, mips64le:ppc64le:536886152 IOMMU_VFIO_IOAS_CLEAR = 2 IOMMU_VFIO_IOAS_GET = 0 -- cgit mrf-deployment