// 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[4] = {0xffffffffffffffff, 0xffffffffffffffff, 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)) { } // 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 = 0x10 (4 bytes) // ninsn: bytesize8 = 0x4 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {b4 00 00 00 00 00 00 00 79 10 48 00 00 00 00 // 00 61 04 00 00 00 00 00 00 95 00 00 00} (length 0x1c) // } // } // } // license: ptr[in, buffer] { // buffer: {47 50 4c 00} (length 0x4) // } // loglev: int32 = 0x2 (4 bytes) // logsize: len = 0xfd90 (4 bytes) // log: ptr[out, buffer] { // buffer: (DirOut) // } // 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 { // sk_msg: sk_msg_attach_types = 0x0 (4 bytes) // } // btf_fd: fd_btf (resource) // func_info_rec_size: const = 0x8 (4 bytes) // func_info: nil // func_info_cnt: len = 0x0 (4 bytes) // line_info_rec_size: const = 0x10 (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 = 0x10 (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 = 0x48 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x20000000e000 = 0x10; *(uint32_t*)0x20000000e004 = 4; *(uint64_t*)0x20000000e008 = 0x200000000040; memcpy((void*)0x200000000040, "\xb4\x00\x00\x00\x00\x00\x00\x00\x79\x10\x48\x00\x00\x00\x00\x00\x61" "\x04\x00\x00\x00\x00\x00\x00\x95\x00\x00\x00", 28); *(uint64_t*)0x20000000e010 = 0x200000003ff6; memcpy((void*)0x200000003ff6, "GPL\000", 4); *(uint32_t*)0x20000000e018 = 2; *(uint32_t*)0x20000000e01c = 0xfd90; *(uint64_t*)0x20000000e020 = 0x20000000cf3d; *(uint32_t*)0x20000000e028 = 0; *(uint32_t*)0x20000000e02c = 0; memset((void*)0x20000000e030, 0, 16); *(uint32_t*)0x20000000e040 = 0; *(uint32_t*)0x20000000e044 = 0; *(uint32_t*)0x20000000e048 = -1; *(uint32_t*)0x20000000e04c = 8; *(uint64_t*)0x20000000e050 = 0; *(uint32_t*)0x20000000e058 = 0; *(uint32_t*)0x20000000e05c = 0x10; *(uint64_t*)0x20000000e060 = 0; *(uint32_t*)0x20000000e068 = 0; *(uint32_t*)0x20000000e06c = 0; *(uint32_t*)0x20000000e070 = -1; *(uint32_t*)0x20000000e074 = 0; *(uint64_t*)0x20000000e078 = 0; *(uint64_t*)0x20000000e080 = 0; *(uint32_t*)0x20000000e088 = 0x10; *(uint32_t*)0x20000000e08c = 0; *(uint32_t*)0x20000000e090 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x20000000e000ul, /*size=*/0x48ul); if (res != -1) r[0] = res; // close arguments: [ // fd: fd (resource) // ] syscall(__NR_close, /*fd=*/r[0]); // socketpair$unix arguments: [ // domain: const = 0x1 (8 bytes) // type: unix_socket_type = 0x1 (8 bytes) // proto: const = 0x0 (4 bytes) // fds: ptr[out, unix_pair] { // unix_pair { // fd0: sock_unix (resource) // fd1: sock_unix (resource) // } // } // ] res = syscall(__NR_socketpair, /*domain=*/1ul, /*type=SOCK_STREAM*/ 1ul, /*proto=*/0, /*fds=*/0x2000000029c0ul); if (res != -1) r[1] = *(uint32_t*)0x2000000029c4; // 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 = 0xe (4 bytes) // ninsn: bytesize8 = 0x4 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {b4 05 00 00 fd ff 7f 00 61 10 58 00 00 00 00 // 00 c6 00 00 00 00 00 00 00 95 00 00 00 00 00 00 00 9f 33 ef 60 // 91 6e 6e 71 3f 1e eb 0b 72 5a d9 9b 81 7f d9 8c d8 24 49 89 49 // 71 4f fa ac 8a 6f 77 06 00 dc ca 55 f2 1f 3c a9 e8 22 d1 82 05 // 4d 54 d5 3c d2 b6 db 71 4e 4b eb 54 47 00 00 01 00 00 00 00 8f // 2b 90 00 f2 24 25 e4 09 7e d6 2c bc 89 10 61 01 7c fa 6f a2 6f // a7 08 8c 60 89 7d 4a 61 48 a1 c1 e4 3f 00 00 1b de 60 be ac 67 // 1e 8e 8f de cb 03 58 8a a6 23 fa 71 f3 1b f0 f8 71 ab 5c 2f f8 // 8a fc 60 02 7f 4e 5b 52 71 ed 58 e8 35 cf 0d 00 00 00 00 98 b5 // 1f e6 b1 b8 d9 db e8 7d cf f4 14 ed 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 b3 47 ab // e6 35 2a 08 0f 81 40 e5 fd 10 74 7b 6e cd b3 54 05 46 bf 63 6e // 3d 6e 70 0e 5b 05 00 00 00 00 00 00 00 eb 9e 14 03 e6 c8 f7 a1 // 87 ea f6 0f 3a 17 f0 f0 46 a3 07 a4 03 c1 9d 98 29 c9 0b d2 11 // 42 52 58 15 67 ac ae 71 5c be 1b 57 d5 cd a4 32 c5 b9 10 40 06 // 23 d2 41 95 40 5f 2e 76 cc b7 b3 7b 41 21 5c 18 4e 73 1f b1} // (length 0x149) // } // } // } // license: ptr[in, buffer] { // buffer: {47 50 4c 00} (length 0x4) // } // loglev: int32 = 0x4 (4 bytes) // logsize: len = 0xfd90 (4 bytes) // log: ptr[out, buffer] { // buffer: (DirOut) // } // 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 { // sk_skb: sk_skb_attach_types = 0x0 (4 bytes) // } // btf_fd: fd_btf (resource) // func_info_rec_size: const = 0x8 (4 bytes) // func_info: ptr[in, bpf_func_info] { // bpf_func_info { // insn_off: int32 = 0x0 (4 bytes) // type_id: int32 = 0x0 (4 bytes) // } // } // func_info_cnt: len = 0x366 (4 bytes) // line_info_rec_size: const = 0x10 (4 bytes) // line_info: ptr[in, bpf_line_info] { // bpf_line_info { // insn_off: int32 = 0x0 (4 bytes) // file_name_off: int32 = 0x0 (4 bytes) // line_off: int32 = 0x0 (4 bytes) // line_col: int32 = 0x0 (4 bytes) // } // } // line_info_cnt: len = 0x1dd (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 = 0x10 (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 = 0x48 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x20000000e000 = 0xe; *(uint32_t*)0x20000000e004 = 4; *(uint64_t*)0x20000000e008 = 0x200000000540; memcpy( (void*)0x200000000540, "\xb4\x05\x00\x00\xfd\xff\x7f\x00\x61\x10\x58\x00\x00\x00\x00\x00\xc6\x00" "\x00\x00\x00\x00\x00\x00\x95\x00\x00\x00\x00\x00\x00\x00\x9f\x33\xef\x60" "\x91\x6e\x6e\x71\x3f\x1e\xeb\x0b\x72\x5a\xd9\x9b\x81\x7f\xd9\x8c\xd8\x24" "\x49\x89\x49\x71\x4f\xfa\xac\x8a\x6f\x77\x06\x00\xdc\xca\x55\xf2\x1f\x3c" "\xa9\xe8\x22\xd1\x82\x05\x4d\x54\xd5\x3c\xd2\xb6\xdb\x71\x4e\x4b\xeb\x54" "\x47\x00\x00\x01\x00\x00\x00\x00\x8f\x2b\x90\x00\xf2\x24\x25\xe4\x09\x7e" "\xd6\x2c\xbc\x89\x10\x61\x01\x7c\xfa\x6f\xa2\x6f\xa7\x08\x8c\x60\x89\x7d" "\x4a\x61\x48\xa1\xc1\xe4\x3f\x00\x00\x1b\xde\x60\xbe\xac\x67\x1e\x8e\x8f" "\xde\xcb\x03\x58\x8a\xa6\x23\xfa\x71\xf3\x1b\xf0\xf8\x71\xab\x5c\x2f\xf8" "\x8a\xfc\x60\x02\x7f\x4e\x5b\x52\x71\xed\x58\xe8\x35\xcf\x0d\x00\x00\x00" "\x00\x98\xb5\x1f\xe6\xb1\xb8\xd9\xdb\xe8\x7d\xcf\xf4\x14\xed\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xb3\x47\xab\xe6\x35\x2a\x08\x0f\x81\x40\xe5\xfd" "\x10\x74\x7b\x6e\xcd\xb3\x54\x05\x46\xbf\x63\x6e\x3d\x6e\x70\x0e\x5b\x05" "\x00\x00\x00\x00\x00\x00\x00\xeb\x9e\x14\x03\xe6\xc8\xf7\xa1\x87\xea\xf6" "\x0f\x3a\x17\xf0\xf0\x46\xa3\x07\xa4\x03\xc1\x9d\x98\x29\xc9\x0b\xd2\x11" "\x42\x52\x58\x15\x67\xac\xae\x71\x5c\xbe\x1b\x57\xd5\xcd\xa4\x32\xc5\xb9" "\x10\x40\x06\x23\xd2\x41\x95\x40\x5f\x2e\x76\xcc\xb7\xb3\x7b\x41\x21\x5c" "\x18\x4e\x73\x1f\xb1", 329); *(uint64_t*)0x20000000e010 = 0x200000003ff6; memcpy((void*)0x200000003ff6, "GPL\000", 4); *(uint32_t*)0x20000000e018 = 4; *(uint32_t*)0x20000000e01c = 0xfd90; *(uint64_t*)0x20000000e020 = 0x20000000cf3d; *(uint32_t*)0x20000000e028 = 0; *(uint32_t*)0x20000000e02c = 0; memset((void*)0x20000000e030, 0, 16); *(uint32_t*)0x20000000e040 = 0; *(uint32_t*)0x20000000e044 = 0; *(uint32_t*)0x20000000e048 = -1; *(uint32_t*)0x20000000e04c = 8; *(uint64_t*)0x20000000e050 = 0x200000000000; *(uint32_t*)0x200000000000 = 0; *(uint32_t*)0x200000000004 = 0; *(uint32_t*)0x20000000e058 = 0x366; *(uint32_t*)0x20000000e05c = 0x10; *(uint64_t*)0x20000000e060 = 0x200000000000; *(uint32_t*)0x200000000000 = 0; *(uint32_t*)0x200000000004 = 0; *(uint32_t*)0x200000000008 = 0; *(uint32_t*)0x20000000000c = 0; *(uint32_t*)0x20000000e068 = 0x1dd; *(uint32_t*)0x20000000e06c = 0; *(uint32_t*)0x20000000e070 = -1; *(uint32_t*)0x20000000e074 = 0; *(uint64_t*)0x20000000e078 = 0; *(uint64_t*)0x20000000e080 = 0; *(uint32_t*)0x20000000e088 = 0x10; *(uint32_t*)0x20000000e08c = 0; *(uint32_t*)0x20000000e090 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x20000000e000ul, /*size=*/0x48ul); if (res != -1) r[2] = res; // bpf$MAP_CREATE arguments: [ // cmd: const = 0x0 (8 bytes) // arg: ptr[in, bpf_map_create_arg] { // union bpf_map_create_arg { // base: bpf_map_create_arg_t[flags[bpf_map_type, int32], int32, int32, // int32, flags[map_flags, int32], const[0, int64]] { // type: bpf_map_type = 0xf (4 bytes) // ksize: int32 = 0x4 (4 bytes) // vsize: int32 = 0x4 (4 bytes) // max: int32 = 0x12 (4 bytes) // flags: map_flags = 0x0 (4 bytes) // inner: fd_bpf_map (resource) // node: int32 = 0x0 (4 bytes) // map_name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00} (length 0x10) map_ifindex: ifindex (resource) btf_fd: fd_btf // (resource) btf_key_type_id: int32 = 0x0 (4 bytes) // btf_value_type_id: int32 = 0x0 (4 bytes) // btf_vmlinux_type_id: int32 = 0x0 (4 bytes) // map_extra: const = 0x0 (8 bytes) // value_type_btf_obj_fd: union // _bpf_map_create_arg_t[flags[bpf_map_type, int32], int32, int32, // int32, flags[map_flags, int32], const[0, // int64]]_value_type_btf_obj_fd_wrapper { // void: buffer: {} (length 0x0) // } // pad1: union _bpf_map_create_arg_t[flags[bpf_map_type, int32], // int32, int32, int32, flags[map_flags, int32], const[0, // int64]]_pad1_wrapper { // value: const = 0x0 (4 bytes) // } // map_token_fd: union _bpf_map_create_arg_t[flags[bpf_map_type, // int32], int32, int32, int32, flags[map_flags, int32], const[0, // int64]]_map_token_fd_wrapper { // void: buffer: {} (length 0x0) // } // pad2: union _bpf_map_create_arg_t[flags[bpf_map_type, int32], // int32, int32, int32, flags[map_flags, int32], const[0, // int64]]_pad2_wrapper { // value: const = 0x0 (4 bytes) // } // } // } // } // size: len = 0x48 (8 bytes) // ] // returns fd_bpf_map *(uint32_t*)0x200000000200 = 0xf; *(uint32_t*)0x200000000204 = 4; *(uint32_t*)0x200000000208 = 4; *(uint32_t*)0x20000000020c = 0x12; *(uint32_t*)0x200000000210 = 0; *(uint32_t*)0x200000000214 = -1; *(uint32_t*)0x200000000218 = 0; memset((void*)0x20000000021c, 0, 16); *(uint32_t*)0x20000000022c = 0; *(uint32_t*)0x200000000230 = -1; *(uint32_t*)0x200000000234 = 0; *(uint32_t*)0x200000000238 = 0; *(uint32_t*)0x20000000023c = 0; *(uint64_t*)0x200000000240 = 0; *(uint32_t*)0x200000000248 = 0; *(uint32_t*)0x20000000024c = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200000000200ul, /*size=*/0x48ul); if (res != -1) r[3] = res; // bpf$BPF_PROG_DETACH arguments: [ // cmd: const = 0x8 (8 bytes) // arg: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {26} (length 0x1) // } // } // } // size: len = 0x10 (8 bytes) // ] *(uint32_t*)0x2000000007c0 = r[3]; *(uint32_t*)0x2000000007c4 = r[2]; memset((void*)0x2000000007c8, 38, 1); syscall(__NR_bpf, /*cmd=*/8ul, /*arg=*/0x2000000007c0ul, /*size=*/0x10ul); // bpf$MAP_UPDATE_ELEM_TAIL_CALL arguments: [ // cmd: const = 0x2 (8 bytes) // arg: ptr[inout, bpf_map_update_tail_call_arg] { // bpf_map_update_tail_call_arg { // map: tail_call_map_update { // in: tail_call_map_fd (resource) // out: tail_call_map (resource) // } // pad = 0x0 (4 bytes) // key: ptr[in, const[0, const]] { // const = 0x0 (4 bytes) // } // val: ptr[in, fd_bpf_prog] { // fd_bpf_prog (resource) // } // flags: const = 0x0 (8 bytes) // } // } // size: len = 0x20 (8 bytes) // ] *(uint32_t*)0x2000000000c0 = r[3]; *(uint64_t*)0x2000000000c8 = 0x200000000000; *(uint32_t*)0x200000000000 = 0; *(uint64_t*)0x2000000000d0 = 0x2000000002c0; *(uint32_t*)0x2000000002c0 = r[0]; *(uint64_t*)0x2000000000d8 = 0; syscall(__NR_bpf, /*cmd=*/2ul, /*arg=*/0x2000000000c0ul, /*size=*/0x20ul); // sendmsg$inet arguments: [ // fd: sock (resource) // msg: ptr[in, msghdr_inet] { // 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: {3e} (length 0x1) // } // len: len = 0x22fe0 (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) // } // } // f: send_flags = 0x0 (8 bytes) // ] *(uint64_t*)0x200000000500 = 0; *(uint32_t*)0x200000000508 = 0; *(uint64_t*)0x200000000510 = 0x200000001740; *(uint64_t*)0x200000001740 = 0x200000000280; memset((void*)0x200000000280, 62, 1); *(uint64_t*)0x200000001748 = 0x22fe0; *(uint64_t*)0x200000000518 = 1; *(uint64_t*)0x200000000520 = 0; *(uint64_t*)0x200000000528 = 0; *(uint32_t*)0x200000000530 = 0; syscall(__NR_sendmsg, /*fd=*/r[1], /*msg=*/0x200000000500ul, /*f=*/0ul); return 0; }