// 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_close #define __NR_close 57 #endif #ifndef __NR_connect #define __NR_connect 203 #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[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)) { } res = syscall(__NR_socket, /*domain=*/0x2bul, /*type=SOCK_NONBLOCK|SOCK_STREAM*/ 0x801ul, /*proto=*/0); if (res != -1) r[0] = res; res = syscall(__NR_socket, /*domain=*/0xaul, /*type=*/1ul, /*proto=*/0); if (res != -1) r[1] = res; syscall(__NR_close, /*fd=*/r[1]); syscall(__NR_socket, /*domain=AF_SMC*/ 0x2bul, /*type=SOCK_STREAM*/ 1ul, /*proto=*/1); *(uint16_t*)0x20000040 = 0xa; *(uint16_t*)0x20000042 = htobe16(0x4e22); *(uint32_t*)0x20000044 = htobe32(0); memset((void*)0x20000048, 0, 16); *(uint32_t*)0x20000058 = 0; syscall(__NR_bind, /*fd=*/r[1], /*addr=*/0x20000040ul, /*addrlen=*/0x1cul); syscall(__NR_listen, /*fd=*/r[1], /*backlog=*/0); *(uint16_t*)0x20000000 = 2; *(uint16_t*)0x20000002 = htobe16(0x4e22); *(uint32_t*)0x20000004 = htobe32(0x7f000001); syscall(__NR_connect, /*fd=*/r[0], /*addr=*/0x20000000ul, /*addrlen=*/0x10ul); return 0; }