// https://syzkaller.appspot.com/bug?id=534443d59baee65901199570f75123b85d6853c2 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // socket$inet_smc arguments: [ // domain: const = 0x2b (8 bytes) // type: const = 0x1 (8 bytes) // proto: const = 0x0 (4 bytes) // ] // returns sock_tcp res = syscall(__NR_socket, /*domain=*/0x2bul, /*type=*/1ul, /*proto=*/0); if (res != -1) r[0] = res; // bind$inet arguments: [ // fd: sock_in (resource) // addr: ptr[in, sockaddr_in] { // sockaddr_in { // family: const = 0x2 (2 bytes) // port: int16be = 0x4e24 (2 bytes) // addr: union ipv4_addr { // loopback: const = 0x7f000001 (4 bytes) // } // pad = 0x0 (8 bytes) // } // } // addrlen: len = 0x10 (8 bytes) // ] *(uint16_t*)0x200000000140 = 2; *(uint16_t*)0x200000000142 = htobe16(0x4e24); *(uint32_t*)0x200000000144 = htobe32(0x7f000001); syscall(__NR_bind, /*fd=*/r[0], /*addr=*/0x200000000140ul, /*addrlen=*/0x10ul); // socket$inet_smc arguments: [ // domain: const = 0x2b (8 bytes) // type: const = 0x1 (8 bytes) // proto: const = 0x0 (4 bytes) // ] // returns sock_tcp res = syscall(__NR_socket, /*domain=*/0x2bul, /*type=*/1ul, /*proto=*/0); if (res != -1) r[1] = res; // listen arguments: [ // fd: sock (resource) // backlog: int32 = 0x9 (4 bytes) // ] syscall(__NR_listen, /*fd=*/r[0], /*backlog=*/9); // connect$inet arguments: [ // fd: sock_in (resource) // addr: ptr[in, sockaddr_in] { // sockaddr_in { // family: const = 0x2 (2 bytes) // port: int16be = 0x4e24 (2 bytes) // addr: union ipv4_addr { // loopback: const = 0x7f000001 (4 bytes) // } // pad = 0x0 (8 bytes) // } // } // addrlen: len = 0x10 (8 bytes) // ] *(uint16_t*)0x200000000000 = 2; *(uint16_t*)0x200000000002 = htobe16(0x4e24); *(uint32_t*)0x200000000004 = htobe32(0x7f000001); syscall(__NR_connect, /*fd=*/r[1], /*addr=*/0x200000000000ul, /*addrlen=*/0x10ul); return 0; }