// https://syzkaller.appspot.com/bug?id=2810321b8cf1d3f6194894e061931df12494a486 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_execveat #define __NR_execveat 322 #endif #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif uint64_t r[2] = {0xffffffffffffffff, 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)) { } memcpy( (void*)0x20000180, "-B\325NI\305j\232ppp\360\b\204\242m\000\v\030\0004\246Ey\333\321\247\261" "S\361:)\000\312\327Uw\000\274\3722\263\273\215\254\254\276\341}knh#\317)" "\017\310\300\"\234c\020d\356\251\213\006\227k\336\305\3516\335U)" "\3118M\315\373\314\202n=\177=\315Jx\252\317~" "\2710a\251\262\004\035\241\316\213\031\352\357\343\000\000\000\000\000" "\000\000\000", 115); res = syscall(__NR_memfd_create, /*name=*/0x20000180ul, /*flags=*/0ul); if (res != -1) r[0] = res; res = syscall(__NR_dup, /*oldfd=*/r[0]); if (res != -1) r[1] = res; memset((void*)0x20000000, 0, 1); syscall(__NR_execveat, /*dirfd=*/r[1], /*file=*/0x20000000ul, /*argv=*/0ul, /*envp=*/0ul, /*flags=AT_EMPTY_PATH*/ 0x1000ul); return 0; }