// https://syzkaller.appspot.com/bug?id=c99d4efc9242e53bd055011543dd487c83cb8e52 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include uint64_t r[5] = {0xffffffffffffffff, 0x0, 0x0, 0x0, 0x0}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x20000000, "/dev/iommu\000", 11); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x20000000ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[0] = res; *(uint32_t*)0x20000340 = 0xc; *(uint32_t*)0x20000344 = 0; res = syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x3b81, /*arg=*/0x20000340ul); if (res != -1) r[1] = *(uint32_t*)0x20000348; *(uint32_t*)0x20000200 = 0x48; *(uint32_t*)0x20000204 = 2; *(uint32_t*)0x20000208 = r[1]; *(uint32_t*)0x2000020c = 0; *(uint32_t*)0x2000021c = 0; res = syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x3ba0, /*arg=*/0x20000200ul); if (res != -1) r[2] = *(uint32_t*)0x20000218; *(uint32_t*)0x200000c0 = 0xc; *(uint32_t*)0x200000c4 = 0; res = syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x3b81, /*arg=*/0x200000c0ul); if (res != -1) r[3] = *(uint32_t*)0x200000c8; *(uint32_t*)0x200002c0 = 0x18; *(uint32_t*)0x200002c4 = 3; *(uint32_t*)0x200002c8 = r[2]; *(uint32_t*)0x200002cc = r[3]; *(uint32_t*)0x200002d4 = 0; *(uint32_t*)0x200002d8 = 0xdead; *(uint32_t*)0x200002dc = 4; *(uint64_t*)0x200002e0 = 0x20000280; *(uint32_t*)0x20000280 = 0xbadbeef; res = syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x3b89, /*arg=*/0x200002c0ul); if (res != -1) r[4] = *(uint32_t*)0x200002d0; *(uint32_t*)0x20000300 = 0x30; *(uint32_t*)0x20000304 = r[4]; *(uint32_t*)0x20000308 = 0; *(uint32_t*)0x2000030c = 0; *(uint64_t*)0x20000310 = 0; *(uint64_t*)0x20000318 = 0; *(uint64_t*)0x20000320 = 0x8000000000000000; *(uint64_t*)0x20000328 = 0; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x3b8c, /*arg=*/0x20000300ul); return 0; }