// https://syzkaller.appspot.com/bug?id=a20e027793708d13530a4b9f63284683a326cd18 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_bind #define __NR_bind 200 #endif #ifndef __NR_close #define __NR_close 57 #endif #ifndef __NR_listen #define __NR_listen 201 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_socket #define __NR_socket 198 #endif #ifndef __NR_writev #define __NR_writev 66 #endif uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; 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 = syscall(__NR_socket, /*domain=*/0xaul, /*type=*/1ul, /*proto=*/0); if (res != -1) r[0] = res; syscall(__NR_close, /*fd=*/r[0]); res = syscall(__NR_socket, /*domain=*/0xaul, /*type=*/1ul, /*proto=*/0x106); if (res != -1) r[1] = res; *(uint16_t*)0x20000000 = 0xa; *(uint16_t*)0x20000002 = htobe16(0x4e22); *(uint32_t*)0x20000004 = htobe32(0); memset((void*)0x20000008, 0, 16); *(uint32_t*)0x20000018 = 0; syscall(__NR_bind, /*fd=*/r[0], /*addr=*/0x20000000ul, /*addrlen=*/0x1cul); syscall(__NR_listen, /*fd=*/r[1], /*backlog=*/0); res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/4); if (res != -1) r[2] = res; *(uint64_t*)0x20000080 = 0x20000180; memcpy( (void*)0x20000180, "\x58\x00\x00\x00\x15\x00\xad\xd4\x27\x32\x3b\x47\x0c\x45\xb4\x56\x02\x06" "\x7f\xff\xff\xff\x81\x00\x4e\x22\x00\x0d\x00\xff\x00\x28\x92\x5a\xa8\x00" "\x20\x00\xea\xa5\x7b\x00\x09\x00\x80\x00\x0e\xff\xfe\xff\xe8\x09\x00\x00" "\x00\xff\x00\x00\xf0\x3a\x02\x00\xf0\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xe7\xee\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", 88); *(uint64_t*)0x20000088 = 0x78; syscall(__NR_writev, /*fd=*/r[2], /*vec=*/0x20000080ul, /*vlen=*/1ul); return 0; }