// autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_bpf #define __NR_bpf 321 #endif 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)) { } // sendmsg$nl_route_sched arguments: [ // fd: sock_nl_route (resource) // msg: ptr[in, msghdr_netlink[netlink_msg_route_sched]] { // msghdr_netlink[netlink_msg_route_sched] { // addr: nil // addrlen: len = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // vec: ptr[in, iovec[in, netlink_msg_route_sched]] { // iovec[in, netlink_msg_route_sched] { // addr: nil // len: len = 0x33f (8 bytes) // } // } // vlen: const = 0x1 (8 bytes) // ctrl: const = 0x0 (8 bytes) // ctrllen: const = 0x0 (8 bytes) // f: send_flags = 0xc0d0 (4 bytes) // pad = 0x0 (4 bytes) // } // } // f: send_flags = 0x0 (8 bytes) // ] *(uint64_t*)0x200000007940 = 0; *(uint32_t*)0x200000007948 = 0; *(uint64_t*)0x200000007950 = 0x2000000000c0; *(uint64_t*)0x2000000000c0 = 0; *(uint64_t*)0x2000000000c8 = 0x33f; *(uint64_t*)0x200000007958 = 1; *(uint64_t*)0x200000007960 = 0; *(uint64_t*)0x200000007968 = 0; *(uint32_t*)0x200000007970 = 0xc0d0; syscall(__NR_sendmsg, /*fd=*/(intptr_t)-1, /*msg=*/0x200000007940ul, /*f=*/0ul); // socket$inet_udp arguments: [ // domain: const = 0x2 (8 bytes) // type: const = 0x2 (8 bytes) // proto: const = 0x0 (4 bytes) // ] // returns sock_udp res = syscall(__NR_socket, /*domain=*/2ul, /*type=*/2ul, /*proto=*/0); if (res != -1) r[0] = res; // socket$pppl2tp arguments: [ // domain: const = 0x18 (8 bytes) // type: const = 0x1 (8 bytes) // proto: const = 0x1 (4 bytes) // ] // returns sock_pppl2tp res = syscall(__NR_socket, /*domain=*/0x18ul, /*type=*/1ul, /*proto=*/1); if (res != -1) r[1] = res; // bpf$PROG_LOAD arguments: [ // cmd: const = 0x5 (8 bytes) // arg: ptr[in, bpf_prog_t[flags[bpf_prog_type, int32], // bpf_prog_attach_types, bpf_btf_id[opt], fd_bpf_prog[opt]]] { // bpf_prog_t[flags[bpf_prog_type, int32], bpf_prog_attach_types, // bpf_btf_id[opt], fd_bpf_prog[opt]] { // type: bpf_prog_type = 0x4 (4 bytes) // ninsn: bytesize8 = 0xb (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // license: nil // loglev: int32 = 0x0 (4 bytes) // logsize: len = 0x0 (4 bytes) // log: nil // kern_version: bpf_kern_version = 0x0 (4 bytes) // flags: bpf_prog_load_flags = 0x0 (4 bytes) // prog_name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x10) prog_ifindex: ifindex (resource) expected_attach_type: // union bpf_prog_attach_types { // fallback: bpf_attach_types = 0x30 (4 bytes) // } // btf_fd: fd_btf (resource) // func_info_rec_size: const = 0x0 (4 bytes) // func_info: nil // func_info_cnt: len = 0x0 (4 bytes) // line_info_rec_size: const = 0x0 (4 bytes) // line_info: nil // line_info_cnt: len = 0x0 (4 bytes) // attach_btf_id: bpf_btf_id (resource) // attach_prog_fd: fd_bpf_prog (resource) // core_relo_cnt: len = 0x0 (4 bytes) // fd_array: nil // core_relos: nil // core_relo_rec_size: const = 0x0 (4 bytes) // log_true_size: int32 = 0x0 (4 bytes) // prog_token_fd: union _bpf_prog_t[flags[bpf_prog_type, int32], // bpf_prog_attach_types, bpf_btf_id[opt], // fd_bpf_prog[opt]]_prog_token_fd_wrapper { // void: buffer: {} (length 0x0) // } // pad: union _bpf_prog_t[flags[bpf_prog_type, int32], // bpf_prog_attach_types, bpf_btf_id[opt], // fd_bpf_prog[opt]]_pad_wrapper { // value: const = 0x0 (4 bytes) // } // } // } // size: len = 0x94 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x2000000000c0 = 4; *(uint32_t*)0x2000000000c4 = 0xb; *(uint64_t*)0x2000000000c8 = 0x200000000040; *(uint64_t*)0x2000000000d0 = 0; *(uint32_t*)0x2000000000d8 = 0; *(uint32_t*)0x2000000000dc = 0; *(uint64_t*)0x2000000000e0 = 0; *(uint32_t*)0x2000000000e8 = 0; *(uint32_t*)0x2000000000ec = 0; memset((void*)0x2000000000f0, 0, 16); *(uint32_t*)0x200000000100 = 0; *(uint32_t*)0x200000000104 = 0x30; *(uint32_t*)0x200000000108 = 0; *(uint32_t*)0x20000000010c = 0; *(uint64_t*)0x200000000110 = 0; *(uint32_t*)0x200000000118 = 0; *(uint32_t*)0x20000000011c = 0; *(uint64_t*)0x200000000120 = 0; *(uint32_t*)0x200000000128 = 0; *(uint32_t*)0x20000000012c = 0; *(uint32_t*)0x200000000130 = 0; *(uint32_t*)0x200000000134 = 0; *(uint64_t*)0x200000000138 = 0; *(uint64_t*)0x200000000140 = 0; *(uint32_t*)0x200000000148 = 0; *(uint32_t*)0x20000000014c = 0; *(uint32_t*)0x200000000150 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x2000000000c0ul, /*size=*/0x94ul); // connect$pppl2tp arguments: [ // fd: sock_pppl2tp (resource) // addr: ptr[in, sockaddr_pppl2tp] { // union sockaddr_pppl2tp { // pppol2tp: sockaddr_pppl2tp_t[pppol2tp_addr] { // sa_family: const = 0x18 (2 bytes) // sa_protocol: const = 0x1 (4 bytes) // addr: pppol2tp_addr_t[int16] { // pid: const = 0x0 (4 bytes) // fd: sock (resource) // addr: sockaddr_in { // family: const = 0x2 (2 bytes) // port: int16be = 0x0 (2 bytes) // addr: union ipv4_addr { // rand_addr: int32be = 0x0 (4 bytes) // } // pad = 0x0 (8 bytes) // } // s_tunnel: int16 = 0xa (2 bytes) // s_session: int16 = 0x0 (2 bytes) // d_tunnel: int16 = 0x0 (2 bytes) // d_session: int16 = 0x0 (2 bytes) // } // } // } // } // addrlen: len = 0x26 (8 bytes) // ] *(uint16_t*)0x200000000000 = 0x18; *(uint32_t*)0x200000000002 = 1; *(uint32_t*)0x200000000006 = 0; *(uint32_t*)0x20000000000a = r[0]; *(uint16_t*)0x20000000000e = 2; *(uint16_t*)0x200000000010 = htobe16(0); *(uint32_t*)0x200000000012 = htobe32(0); *(uint16_t*)0x20000000001e = 0xa; *(uint16_t*)0x200000000020 = 0; *(uint16_t*)0x200000000022 = 0; *(uint16_t*)0x200000000024 = 0; syscall(__NR_connect, /*fd=*/r[1], /*addr=*/0x200000000000ul, /*addrlen=*/0x26ul); // sendmmsg$inet arguments: [ // fd: sock (resource) // mmsg: ptr[in, array[mmsghdr_inet]] { // array[mmsghdr_inet] { // mmsghdr_inet { // msg_hdr: msghdr_inet { // msg_name: nil // msg_namelen: len = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // msg_iov: ptr[in, array[iovec[in, array[int8]]]] { // array[iovec[in, array[int8]]] { // iovec[in, array[int8]] { // addr: ptr[in, buffer] { // buffer: {7d 51 07 67 32 89 ee ae 3f 80 6c 5c 62 db 49 7a // 02 99 39 9a b6 10 1c 3b} (length 0x18) // } // len: len = 0x1 (8 bytes) // } // } // } // msg_iovlen: len = 0x1 (8 bytes) // msg_control: nil // msg_controllen: bytesize = 0x0 (8 bytes) // msg_flags: const = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // } // msg_len: const = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // } // } // } // vlen: len = 0x4000000000001ce (8 bytes) // f: send_flags = 0x8040 (8 bytes) // ] *(uint64_t*)0x200000005f80 = 0; *(uint32_t*)0x200000005f88 = 0; *(uint64_t*)0x200000005f90 = 0x200000005dc0; *(uint64_t*)0x200000005dc0 = 0x2000000010c0; memcpy((void*)0x2000000010c0, "\x7d\x51\x07\x67\x32\x89\xee\xae\x3f\x80\x6c\x5c\x62\xdb\x49\x7a\x02" "\x99\x39\x9a\xb6\x10\x1c\x3b", 24); *(uint64_t*)0x200000005dc8 = 1; *(uint64_t*)0x200000005f98 = 1; *(uint64_t*)0x200000005fa0 = 0; *(uint64_t*)0x200000005fa8 = 0; *(uint32_t*)0x200000005fb0 = 0; *(uint32_t*)0x200000005fb8 = 0; syscall(__NR_sendmmsg, /*fd=*/r[1], /*mmsg=*/0x200000005f80ul, /*vlen=*/0x4000000000001ceul, /*f=MSG_MORE|MSG_DONTWAIT*/ 0x8040ul); return 0; }