// https://syzkaller.appspot.com/bug?id=be6d443d3dfa1d68ea358da1d2f71b4870169852 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #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)) { } // mmap arguments: [ // addr: VMA[0x95c000] // len: len = 0x95c000 (8 bytes) // prot: mmap_prot = 0x200000b (8 bytes) // flags: mmap_flags = 0x8c4b815a5465c2b2 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall( __NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x95c000ul, /*prot=PROT_GROWSUP|PROT_SEM|PROT_WRITE|PROT_READ*/ 0x200000bul, /*flags=MAP_UNINITIALIZED|MAP_POPULATE|MAP_NORESERVE|MAP_NONBLOCK|MAP_HUGETLB|0x8c4b815a506002b2*/ 0x8c4b815a5465c2b2ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); // connect$unix arguments: [ // fd: sock_unix (resource) // addr: ptr[in, sockaddr_un] { // union sockaddr_un { // file: sockaddr_un_file { // family: unix_socket_family = 0x0 (2 bytes) // path: buffer: {2e 2f 66 69 6c 65 30 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00} (length 0x6c) // } // } // } // addrlen: len = 0x6e (8 bytes) // ] *(uint16_t*)0x20000057eff8 = 0; memcpy((void*)0x20000057effa, "./" "file0\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000", 108); syscall(__NR_connect, /*fd=*/(intptr_t)-1, /*addr=*/0x20000057eff8ul, /*addrlen=*/0x6eul); // socket$alg arguments: [ // domain: const = 0x26 (8 bytes) // type: const = 0x5 (8 bytes) // proto: const = 0x0 (4 bytes) // ] // returns sock_alg res = syscall(__NR_socket, /*domain=*/0x26ul, /*type=*/5ul, /*proto=*/0); if (res != -1) r[0] = res; // bind$alg arguments: [ // fd: sock_alg (resource) // addr: ptr[in, sockaddr_alg] { // sockaddr_alg { // family: const = 0x26 (2 bytes) // type: buffer: {68 61 73 68 00 00 00 00 00 00 00 00 00 00} (length // 0xe) feat: af_alg_type = 0x0 (4 bytes) mask: af_alg_type = 0x0 (4 // bytes) name: buffer: {73 68 61 35 31 32 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00} (length 0x40) // } // } // addrlen: len = 0x58 (8 bytes) // ] *(uint16_t*)0x200000000000 = 0x26; memcpy((void*)0x200000000002, "hash\000\000\000\000\000\000\000\000\000\000", 14); *(uint32_t*)0x200000000010 = 0; *(uint32_t*)0x200000000014 = 0; memcpy((void*)0x200000000018, "sha512\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000", 64); syscall(__NR_bind, /*fd=*/r[0], /*addr=*/0x200000000000ul, /*addrlen=*/0x58ul); // accept4 arguments: [ // fd: sock (resource) // peer: nil // peerlen: nil // flags: accept_flags = 0x800 (8 bytes) // ] // returns sock res = syscall(__NR_accept4, /*fd=*/r[0], /*peer=*/0ul, /*peerlen=*/0ul, /*flags=SOCK_NONBLOCK*/ 0x800ul); if (res != -1) r[1] = res; // sendmmsg$alg arguments: [ // fd: sock_algconn (resource) // mmsg: ptr[in, array[msghdr_alg]] { // array[msghdr_alg] { // msghdr_alg { // addr: const = 0x0 (8 bytes) // addrlen: const = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // vec: ptr[in, array[iovec[in, array[int8]]]] { // array[iovec[in, array[int8]]] { // iovec[in, array[int8]] { // addr: ptr[in, buffer] { // buffer: {b5 75 23 cb 1a 2c 90 d8 ac ad 2e 2d 98 df c9 ea // 7a 58 43 c3 b6 3b 68 3c ed 2b 32 66 17 55 99 b7 79 61 7e // 66 e6 b3 e1 5c 04 2b e9 06 35 a2 d3 61 60 bb f9 a2 ed ca // cc 0b be 01 5b 84 15 0a 19 28 de 94 39 78 94 ff 36 aa 43 // 0f c2 a0 81 4b a6 34 30 8d 6d 08 37 25 0d fd 1e ca 53 83 // f9 d1 51 44 97 43 b1 a0 c4 ff c5 12 42 a2 29 c5 d6 d0 6f // 14 7a 61 d7 97 ea 7f fe da 95 b7 6f 56 23} (length 0x7d) // } // len: len = 0x7d (8 bytes) // } // iovec[in, array[int8]] { // addr: ptr[in, buffer] { // buffer: {66 f7} (length 0x2) // } // len: len = 0x1 (8 bytes) // } // iovec[in, array[int8]] { // addr: ptr[in, buffer] { // buffer: {6c 33} (length 0x2) // } // len: len = 0x7fffef80 (8 bytes) // } // } // } // vlen: len = 0x3 (8 bytes) // ctrl: nil // ctrllen: bytesize = 0x0 (8 bytes) // f: send_flags = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // } // } // } // vlen: len = 0x1 (8 bytes) // f: send_flags = 0x0 (8 bytes) // ] *(uint64_t*)0x200000000640 = 0; *(uint32_t*)0x200000000648 = 0; *(uint64_t*)0x200000000650 = 0x200000000380; *(uint64_t*)0x200000000380 = 0x200000000140; memcpy( (void*)0x200000000140, "\xb5\x75\x23\xcb\x1a\x2c\x90\xd8\xac\xad\x2e\x2d\x98\xdf\xc9\xea\x7a\x58" "\x43\xc3\xb6\x3b\x68\x3c\xed\x2b\x32\x66\x17\x55\x99\xb7\x79\x61\x7e\x66" "\xe6\xb3\xe1\x5c\x04\x2b\xe9\x06\x35\xa2\xd3\x61\x60\xbb\xf9\xa2\xed\xca" "\xcc\x0b\xbe\x01\x5b\x84\x15\x0a\x19\x28\xde\x94\x39\x78\x94\xff\x36\xaa" "\x43\x0f\xc2\xa0\x81\x4b\xa6\x34\x30\x8d\x6d\x08\x37\x25\x0d\xfd\x1e\xca" "\x53\x83\xf9\xd1\x51\x44\x97\x43\xb1\xa0\xc4\xff\xc5\x12\x42\xa2\x29\xc5" "\xd6\xd0\x6f\x14\x7a\x61\xd7\x97\xea\x7f\xfe\xda\x95\xb7\x6f\x56\x23", 125); *(uint64_t*)0x200000000388 = 0x7d; *(uint64_t*)0x200000000390 = 0x2000000001c0; memcpy((void*)0x2000000001c0, "\x66\xf7", 2); *(uint64_t*)0x200000000398 = 1; *(uint64_t*)0x2000000003a0 = 0x200000000300; memcpy((void*)0x200000000300, "l3", 2); *(uint64_t*)0x2000000003a8 = 0x7fffef80; *(uint64_t*)0x200000000658 = 3; *(uint64_t*)0x200000000660 = 0; *(uint64_t*)0x200000000668 = 0; *(uint32_t*)0x200000000670 = 0; syscall(__NR_sendmmsg, /*fd=*/r[1], /*mmsg=*/0x200000000640ul, /*vlen=*/1ul, /*f=*/0ul); return 0; }