// https://syzkaller.appspot.com/bug?id=5d8567b6c07513533b725d89c41e758c8f1cf404 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_bpf #define __NR_bpf 321 #endif uint64_t r[3] = {0xffffffffffffffff, 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)) { } *(uint32_t*)0x200004c0 = 2; *(uint32_t*)0x200004c4 = 4; *(uint32_t*)0x200004c8 = 4; *(uint32_t*)0x200004cc = 8; *(uint32_t*)0x200004d0 = 0x1014; *(uint32_t*)0x200004d4 = -1; *(uint32_t*)0x200004d8 = 0; memset((void*)0x200004dc, 0, 16); *(uint32_t*)0x200004ec = 0; *(uint32_t*)0x200004f0 = -1; *(uint32_t*)0x200004f4 = 0; *(uint32_t*)0x200004f8 = 0; *(uint32_t*)0x200004fc = 0; *(uint64_t*)0x20000500 = 0; *(uint32_t*)0x20000508 = 0; *(uint32_t*)0x2000050c = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200004c0ul, /*size=*/0x48ul); if (res != -1) r[0] = res; *(uint32_t*)0x20000000 = r[0]; *(uint64_t*)0x20000008 = 0; *(uint64_t*)0x20000010 = 0; *(uint64_t*)0x20000018 = 0; syscall(__NR_bpf, /*cmd=*/4ul, /*arg=*/0x20000000ul, /*size=*/0x20ul); *(uint32_t*)0x200004c0 = 2; *(uint32_t*)0x200004c4 = 4; *(uint32_t*)0x200004c8 = 4; *(uint32_t*)0x200004cc = 8; *(uint32_t*)0x200004d0 = 0x1014; *(uint32_t*)0x200004d4 = -1; *(uint32_t*)0x200004d8 = 0; memset((void*)0x200004dc, 0, 16); *(uint32_t*)0x200004ec = 0; *(uint32_t*)0x200004f0 = -1; *(uint32_t*)0x200004f4 = 0; *(uint32_t*)0x200004f8 = 0; *(uint32_t*)0x200004fc = 0; *(uint64_t*)0x20000500 = 0; *(uint32_t*)0x20000508 = 0; *(uint32_t*)0x2000050c = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200004c0ul, /*size=*/0x48ul); if (res != -1) r[1] = res; *(uint32_t*)0x20000040 = 0xd; *(uint32_t*)0x20000044 = 4; *(uint32_t*)0x20000048 = 4; *(uint32_t*)0x2000004c = 9; *(uint32_t*)0x20000050 = 1; *(uint32_t*)0x20000054 = r[1]; *(uint32_t*)0x20000058 = 0; memset((void*)0x2000005c, 0, 16); *(uint32_t*)0x2000006c = 0; *(uint32_t*)0x20000070 = -1; *(uint32_t*)0x20000074 = 0; *(uint32_t*)0x20000078 = 0; *(uint32_t*)0x2000007c = 0; *(uint64_t*)0x20000080 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x20000040ul, /*size=*/0x48ul); if (res != -1) r[2] = res; *(uint32_t*)0x200003c0 = r[2]; *(uint64_t*)0x200003c8 = 0x20000300; *(uint64_t*)0x200003d0 = 0x20000000; *(uint64_t*)0x200003d8 = 0; syscall(__NR_bpf, /*cmd=*/2ul, /*arg=*/0x200003c0ul, /*size=*/0x20ul); syscall(__NR_close, /*fd=*/r[0]); *(uint32_t*)0x20000300 = r[2]; *(uint64_t*)0x20000308 = 0x20000240; *(uint64_t*)0x20000310 = 0; *(uint64_t*)0x20000318 = 0; syscall(__NR_bpf, /*cmd=*/3ul, /*arg=*/0x20000300ul, /*size=*/0x20ul); return 0; }