// 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[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)) { } memcpy((void*)0x200000c0, "[\v\333X\256[\032\251\375\372\255\321md\310\205HX\251%" "\f\032e\340\000\000\000\000\373\377\000\000\201\236G\331," "\342\306a\237\350\361\263\206\342+Op\320\242\202\036b;(" "\265\341jS\326\221%||\240\216z\255T\310\f\345\211\2773:\231\036\254`" "\303\317\323\256\322\a\021\251\245^\377\365\225\322q#" "\306\312\227\235\313\036\200\326\325%N&\370#\200z8Z\322}" "\365\344\2375\233\001\371t\273\036r\024\333\323\315\375\275nC\354", 137); res = syscall(__NR_memfd_create, /*name=*/0x200000c0ul, /*flags=*/0ul); if (res != -1) r[0] = res; memset((void*)0x20000000, 0, 1); syscall(__NR_execveat, /*dirfd=*/r[0], /*file=*/0x20000000ul, /*argv=*/0ul, /*envp=*/0ul, /*flags=AT_EMPTY_PATH*/ 0x1000ul); return 0; }