// https://syzkaller.appspot.com/bug?id=8fd658522e73345eeed8b37392ba68c207cc1f4e // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #define USLEEP_FORKED_CHILD (3 * 50 * 1000) static long handle_clone_ret(long ret) { if (ret != 0) { return ret; } usleep(USLEEP_FORKED_CHILD); syscall(__NR_exit, 0); while (1) { } } static long syz_clone(volatile long flags, volatile long stack, volatile long stack_len, volatile long ptid, volatile long ctid, volatile long tls) { long sp = (stack + stack_len) & ~15; long ret = (long)syscall(__NR_clone, flags & ~CLONE_VM, sp, ptid, ctid, tls); return handle_clone_ret(ret); } uint64_t r[1] = {0x0}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); intptr_t res = 0; res = -1; res = syz_clone(/*flags=*/0, /*stack=*/0, /*stack_len=*/0, /*parentid=*/0, /*childtid=*/0, /*tls=*/0); if (res != -1) r[0] = res; syscall(__NR_ptrace, /*req=*/0x4206ul, /*pid=*/r[0], /*ignored=*/0ul, /*flags=*/0ul); syscall(__NR_timer_create, /*id=*/0ul, /*ev=*/0ul, /*timerid=*/0x200001c0ul); *(uint64_t*)0x20000100 = 0; *(uint64_t*)0x20000108 = 0x989680; *(uint64_t*)0x20000110 = 0; *(uint64_t*)0x20000118 = 9; syscall(__NR_timer_settime, /*timerid=*/0, /*flags=*/0ul, /*new=*/0x20000100ul, /*old=*/0ul); return 0; }