// 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)) { } // 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 = 0x9 (4 bytes) // ksize: int32 = 0x9 (4 bytes) // vsize: int32 = 0x2 (4 bytes) // max: int32 = 0x9 (4 bytes) // flags: map_flags = 0x42 (4 bytes) // inner: fd_bpf_map (resource) // node: int32 = 0x3 (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 = 0x50 (8 bytes) // ] // returns fd_bpf_map *(uint32_t*)0x200000000b40 = 9; *(uint32_t*)0x200000000b44 = 9; *(uint32_t*)0x200000000b48 = 2; *(uint32_t*)0x200000000b4c = 9; *(uint32_t*)0x200000000b50 = 0x42; *(uint32_t*)0x200000000b54 = -1; *(uint32_t*)0x200000000b58 = 3; memset((void*)0x200000000b5c, 0, 16); *(uint32_t*)0x200000000b6c = 0; *(uint32_t*)0x200000000b70 = -1; *(uint32_t*)0x200000000b74 = 0; *(uint32_t*)0x200000000b78 = 0; *(uint32_t*)0x200000000b7c = 0; *(uint64_t*)0x200000000b80 = 0; *(uint32_t*)0x200000000b88 = 0; *(uint32_t*)0x200000000b8c = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200000000b40ul, /*size=*/0x50ul); if (res != -1) r[0] = res; // bpf$MAP_UPDATE_CONST_STR arguments: [ // cmd: const = 0x2 (8 bytes) // arg: ptr[inout, bpf_map_update_const_str_arg] { // bpf_map_update_const_str_arg { // map: map_bpf_const_str { // in: fd_bpf_const_str_map (resource) // out: fd_bpf_const_str (resource) // } // pad = 0x0 (4 bytes) // key: ptr[in, const[0, const]] { // const = 0x0 (4 bytes) // } // val: ptr[in, buffer] { // buffer: {25 70 49 34 20 20 20 00} (length 0x8) // } // flags: const = 0x0 (8 bytes) // } // } // size: len = 0x20 (8 bytes) // ] *(uint32_t*)0x200000000080 = r[0]; *(uint64_t*)0x200000000088 = 0x2000000000c0; *(uint32_t*)0x2000000000c0 = 0; *(uint64_t*)0x200000000090 = 0x200000000100; memcpy((void*)0x200000000100, "%pI4 \000", 8); *(uint64_t*)0x200000000098 = 0; res = syscall(__NR_bpf, /*cmd=*/2ul, /*arg=*/0x200000000080ul, /*size=*/0x20ul); if (res != -1) r[1] = *(uint32_t*)0x200000000080; // bpf$MAP_UPDATE_CONST_STR arguments: [ // cmd: const = 0x2 (8 bytes) // arg: ptr[inout, bpf_map_update_const_str_arg] { // bpf_map_update_const_str_arg { // map: map_bpf_const_str { // in: fd_bpf_const_str_map (resource) // out: fd_bpf_const_str (resource) // } // pad = 0x0 (4 bytes) // key: ptr[in, const[0, const]] { // const = 0x40000000 (4 bytes) // } // val: ptr[in, buffer] { // buffer: {25 70 53 20 20 20 20 00} (length 0x8) // } // flags: const = 0x2 (8 bytes) // } // } // size: len = 0x20 (8 bytes) // ] *(uint32_t*)0x200000000800 = r[1]; *(uint64_t*)0x200000000808 = 0x200000000780; *(uint32_t*)0x200000000780 = 0x40000000; *(uint64_t*)0x200000000810 = 0x2000000007c0; memcpy((void*)0x2000000007c0, "%pS \000", 8); *(uint64_t*)0x200000000818 = 2; syscall(__NR_bpf, /*cmd=*/2ul, /*arg=*/0x200000000800ul, /*size=*/0x20ul); return 0; }