// https://syzkaller.appspot.com/bug?id=f4b325a46a8cca45faae92a30416f6c51bdb7aa2 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_userfaultfd #define __NR_userfaultfd 323 #endif uint64_t r[1] = {0xffffffffffffffff}; 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)) { } syscall(__NR_madvise, /*addr=*/0x20000000ul, /*len=*/0x800000ul, /*advice=MADV_HUGEPAGE*/ 0xeul); res = syscall(__NR_userfaultfd, /*flags=UFFD_USER_MODE_ONLY*/ 1ul); if (res != -1) r[0] = res; *(uint64_t*)0x200000c0 = 0xaa; *(uint64_t*)0x200000c8 = 0; *(uint64_t*)0x200000d0 = 0; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0xc018aa3f, /*arg=*/0x200000c0ul); *(uint64_t*)0x20000080 = 0x20c15000; *(uint64_t*)0x20000088 = 0x20508000; *(uint64_t*)0x20000090 = 0x1000; *(uint64_t*)0x20000098 = 0; *(uint64_t*)0x200000a0 = 0; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0xc028aa05, /*arg=*/0x20000080ul); return 0; }