// https://syzkaller.appspot.com/bug?id=ab254c2c5687575b07b0892a3d3d3616bdfd3feb // 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_connect #define __NR_connect 203 #endif #ifndef __NR_dup #define __NR_dup 23 #endif #ifndef __NR_getsockname #define __NR_getsockname 204 #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 uint64_t r[4] = {0xffffffffffffffff, 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=*/2ul, /*type=*/2ul, /*proto=*/0); if (res != -1) r[0] = res; memset((void*)0x20000140, 120, 1); syscall(__NR_connect, /*fd=*/r[0], /*addr=*/0x20000140ul, /*addrlen=*/0x10ul); *(uint32_t*)0x20001200 = 8; syscall(__NR_getsockname, /*fd=*/r[0], /*addr=*/0x20000000ul, /*addrlen=*/0x20001200ul); res = syscall(__NR_socket, /*domain=*/0x2bul, /*type=*/1ul, /*proto=*/0); if (res != -1) r[1] = res; syscall(__NR_bind, /*fd=*/r[1], /*addr=*/0x20000000ul, /*addrlen=*/0x10ul); res = syscall(__NR_dup, /*oldfd=*/r[1]); if (res != -1) r[2] = res; syscall(__NR_listen, /*fd=*/r[2], /*backlog=*/0); res = syscall(__NR_socket, /*domain=*/2ul, /*type=*/1ul, /*proto=*/0); if (res != -1) r[3] = res; syscall(__NR_connect, /*fd=*/r[3], /*addr=*/0x20000000ul, /*addrlen=*/0x10ul); return 0; }