// https://syzkaller.appspot.com/bug?id=ef0079ed857b95d3061fb56426c74ba189f71cc6 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #ifndef __NR_bpf #define __NR_bpf 321 #endif uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*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=*/0x1000, /*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_CONST_STR arguments: [ // cmd: const = 0x0 (8 bytes) // arg: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {02 00 00 00 04 00 00 00 08 00 00 00 01} (length // 0xd) // } // } // } // size: len = 0x48 (8 bytes) // ] // returns fd_bpf_const_str_map memcpy((void*)0x200000000480, "\x02\x00\x00\x00\x04\x00\x00\x00\x08\x00\x00\x00\x01", 13); res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200000000480ul, /*size=*/0x48ul); if (res != -1) r[0] = 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 = 0x3 (4 bytes) // ninsn: bytesize8 = 0x1c (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {18 08 00 00 b0 ff 00 11 00 00 00 00 00 00 00 // 00 18 11 00 00} (length 0x14) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {00 00 00 00 00 00 00 00 b7 02 00 00 14 00 00 // 00 b7 03 00 00 00 00 00 00 85 00 00 00 05 00 00 00 bf 09 00 00 // 00 00 00 00 35 08 01 00 00 00 40 00 95 00 00 00 00 00 00 00 b7 // 02 00 00 00 00 00 00 7b 9a f8 ff 00 00 00 00 75 09 fd ff 03 00 // 00 00 7b aa f0 ff 00 00 00 00 bf 27 00 00 00 00 00 00 07 08 00 // 00 ff fd ff ff bf a4 00 00 00 00 00 00 07 04 00 00 f0 ff ff ff // 74 02 00 00 08 00 00 00 18 22 00 00} (length 0x84) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {00 00 00 00 00 00 00 00 b7 05 00 00 08 00 00 // 00 46 08 f0 ff 76 00 fd ff 6e 98 f0 ff 00 00 00 00 56 08 00 00 // 00 00 00 00 85 00 00 00 05 00 00 00 b7 00 00 00 00 00 00 00 // 95} (length 0x39) // } // } // } // license: ptr[in, buffer] { // buffer: {47 50 4c 00} (length 0x4) // } // loglev: int32 = 0x2 (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 { // sched_cls: sched_cls_attach_types = 0x0 (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*)0x200000001000 = 3; *(uint32_t*)0x200000001004 = 0x1c; *(uint64_t*)0x200000001008 = 0x2000000010c0; memcpy((void*)0x2000000010c0, "\x18\x08\x00\x00\xb0\xff\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x18" "\x11\x00\x00", 20); *(uint32_t*)0x2000000010d4 = r[0]; memcpy((void*)0x2000000010d8, "\x00\x00\x00\x00\x00\x00\x00\x00\xb7\x02\x00\x00\x14\x00\x00\x00\xb7" "\x03\x00\x00\x00\x00\x00\x00\x85\x00\x00\x00\x05\x00\x00\x00\xbf\x09" "\x00\x00\x00\x00\x00\x00\x35\x08\x01\x00\x00\x00\x40\x00\x95\x00\x00" "\x00\x00\x00\x00\x00\xb7\x02\x00\x00\x00\x00\x00\x00\x7b\x9a\xf8\xff" "\x00\x00\x00\x00\x75\x09\xfd\xff\x03\x00\x00\x00\x7b\xaa\xf0\xff\x00" "\x00\x00\x00\xbf\x27\x00\x00\x00\x00\x00\x00\x07\x08\x00\x00\xff\xfd" "\xff\xff\xbf\xa4\x00\x00\x00\x00\x00\x00\x07\x04\x00\x00\xf0\xff\xff" "\xff\x74\x02\x00\x00\x08\x00\x00\x00\x18\x22\x00\x00", 132); *(uint32_t*)0x20000000115c = r[0]; memcpy((void*)0x200000001160, "\x00\x00\x00\x00\x00\x00\x00\x00\xb7\x05\x00\x00\x08\x00\x00\x00\x46" "\x08\xf0\xff\x76\x00\xfd\xff\x6e\x98\xf0\xff\x00\x00\x00\x00\x56\x08" "\x00\x00\x00\x00\x00\x00\x85\x00\x00\x00\x05\x00\x00\x00\xb7\x00\x00" "\x00\x00\x00\x00\x00\x95", 57); *(uint64_t*)0x200000001010 = 0x2000000011c0; memcpy((void*)0x2000000011c0, "GPL\000", 4); *(uint32_t*)0x200000001018 = 2; *(uint32_t*)0x20000000101c = 0; *(uint64_t*)0x200000001020 = 0; *(uint32_t*)0x200000001028 = 0; *(uint32_t*)0x20000000102c = 0; memset((void*)0x200000001030, 0, 16); *(uint32_t*)0x200000001040 = 0; *(uint32_t*)0x200000001044 = 0; *(uint32_t*)0x200000001048 = 0; *(uint32_t*)0x20000000104c = 0; *(uint64_t*)0x200000001050 = 0; *(uint32_t*)0x200000001058 = 0; *(uint32_t*)0x20000000105c = 0; *(uint64_t*)0x200000001060 = 0; *(uint32_t*)0x200000001068 = 0; *(uint32_t*)0x20000000106c = 0; *(uint32_t*)0x200000001070 = 0; *(uint32_t*)0x200000001074 = 0; *(uint64_t*)0x200000001078 = 0; *(uint64_t*)0x200000001080 = 0; *(uint32_t*)0x200000001088 = 0; *(uint32_t*)0x20000000108c = 0; *(uint32_t*)0x200000001090 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000001000ul, /*size=*/0x94ul); return 0; }