// 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[1] = {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_XDP arguments: [ // cmd: const = 0x5 (8 bytes) // arg: ptr[in, bpf_prog_t[const[BPF_PROG_TYPE_XDP, int32], const[BPF_XDP, // int32], const[0, int32], const[0, int32]]] { // bpf_prog_t[const[BPF_PROG_TYPE_XDP, int32], const[BPF_XDP, int32], // const[0, int32], const[0, int32]] { // type: const = 0x6 (4 bytes) // ninsn: bytesize8 = 0x3 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {18 00 00 00 02 00 00 00 00 00 00 00 00 00 00 // 00 95} (length 0x11) // } // } // } // 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: // const = 0x25 (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: const = 0x0 (4 bytes) // attach_prog_fd: const = 0x0 (4 bytes) // 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[const[BPF_PROG_TYPE_XDP, int32], // const[BPF_XDP, int32], const[0, int32], const[0, // int32]]_prog_token_fd_wrapper { // void: buffer: {} (length 0x0) // } // pad: union _bpf_prog_t[const[BPF_PROG_TYPE_XDP, int32], // const[BPF_XDP, int32], const[0, int32], const[0, int32]]_pad_wrapper // { // value: const = 0x0 (4 bytes) // } // } // } // size: len = 0x94 (8 bytes) // ] // returns fd_bpf_prog_xdp *(uint32_t*)0x200000000380 = 6; *(uint32_t*)0x200000000384 = 3; *(uint64_t*)0x200000000388 = 0x200000000680; memcpy((void*)0x200000000680, "\x18\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95", 17); *(uint64_t*)0x200000000390 = 0; *(uint32_t*)0x200000000398 = 0; *(uint32_t*)0x20000000039c = 0; *(uint64_t*)0x2000000003a0 = 0; *(uint32_t*)0x2000000003a8 = 0; *(uint32_t*)0x2000000003ac = 0; memset((void*)0x2000000003b0, 0, 16); *(uint32_t*)0x2000000003c0 = 0; *(uint32_t*)0x2000000003c4 = 0x25; *(uint32_t*)0x2000000003c8 = -1; *(uint32_t*)0x2000000003cc = 8; *(uint64_t*)0x2000000003d0 = 0; *(uint32_t*)0x2000000003d8 = 0; *(uint32_t*)0x2000000003dc = 0x10; *(uint64_t*)0x2000000003e0 = 0; *(uint32_t*)0x2000000003e8 = 0; *(uint32_t*)0x2000000003ec = 0; *(uint32_t*)0x2000000003f0 = 0; *(uint32_t*)0x2000000003f4 = 0; *(uint64_t*)0x2000000003f8 = 0; *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0x10; *(uint32_t*)0x20000000040c = 0; *(uint32_t*)0x200000000410 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000380ul, /*size=*/0x94ul); // bpf$PROG_LOAD_XDP arguments: [ // cmd: const = 0x5 (8 bytes) // arg: ptr[in, bpf_prog_t[const[BPF_PROG_TYPE_XDP, int32], const[BPF_XDP, // int32], const[0, int32], const[0, int32]]] { // bpf_prog_t[const[BPF_PROG_TYPE_XDP, int32], const[BPF_XDP, int32], // const[0, int32], const[0, int32]] { // type: const = 0x6 (4 bytes) // ninsn: bytesize8 = 0x3 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // license: ptr[in, buffer] { // buffer: {47 50 4c 00} (length 0x4) // } // 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: // const = 0x25 (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: const = 0x0 (4 bytes) // attach_prog_fd: const = 0x0 (4 bytes) // 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 = 0x5 (4 bytes) // prog_token_fd: union _bpf_prog_t[const[BPF_PROG_TYPE_XDP, int32], // const[BPF_XDP, int32], const[0, int32], const[0, // int32]]_prog_token_fd_wrapper { // void: buffer: {} (length 0x0) // } // pad: union _bpf_prog_t[const[BPF_PROG_TYPE_XDP, int32], // const[BPF_XDP, int32], const[0, int32], const[0, int32]]_pad_wrapper // { // value: const = 0x0 (4 bytes) // } // } // } // size: len = 0x94 (8 bytes) // ] // returns fd_bpf_prog_xdp *(uint32_t*)0x200000000440 = 6; *(uint32_t*)0x200000000444 = 3; *(uint64_t*)0x200000000448 = 0x200000000680; *(uint64_t*)0x200000000450 = 0x2000000002c0; memcpy((void*)0x2000000002c0, "GPL\000", 4); *(uint32_t*)0x200000000458 = 0; *(uint32_t*)0x20000000045c = 0; *(uint64_t*)0x200000000460 = 0; *(uint32_t*)0x200000000468 = 0; *(uint32_t*)0x20000000046c = 0; memset((void*)0x200000000470, 0, 16); *(uint32_t*)0x200000000480 = 0; *(uint32_t*)0x200000000484 = 0x25; *(uint32_t*)0x200000000488 = -1; *(uint32_t*)0x20000000048c = 8; *(uint64_t*)0x200000000490 = 0; *(uint32_t*)0x200000000498 = 0; *(uint32_t*)0x20000000049c = 0x10; *(uint64_t*)0x2000000004a0 = 0; *(uint32_t*)0x2000000004a8 = 0; *(uint32_t*)0x2000000004ac = 0; *(uint32_t*)0x2000000004b0 = 0; *(uint32_t*)0x2000000004b4 = 0; *(uint64_t*)0x2000000004b8 = 0; *(uint64_t*)0x2000000004c0 = 0; *(uint32_t*)0x2000000004c8 = 0x10; *(uint32_t*)0x2000000004cc = 5; *(uint32_t*)0x2000000004d0 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000440ul, /*size=*/0x94ul); if (res != -1) r[0] = res; // bpf$BPF_PROG_TEST_RUN arguments: [ // cmd: const = 0xa (8 bytes) // arg: ptr[in, bpf_test_prog_arg] { // bpf_test_prog_arg { // prog: fd_bpf_prog (resource) // retval: const = 0x5 (4 bytes) // insizedata: len = 0xd28 (4 bytes) // outsizedata: len = 0x0 (4 bytes) // indata: ptr[in, buffer] { // buffer: {25} (length 0x1) // } // outdata: nil // repeat: int32 = 0xd01 (4 bytes) // dur: const = 0x88be (4 bytes) // insizectx: len = 0x0 (4 bytes) // outsizectx: len = 0x0 (4 bytes) // inctx: nil // outctx: nil // flags: bpf_prog_test_run_flags = 0x2 (4 bytes) // cpu: const = 0x0 (4 bytes) // batch_size: int32 = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // } // } // size: len = 0x48 (8 bytes) // ] *(uint32_t*)0x200000000600 = r[0]; *(uint32_t*)0x200000000604 = 5; *(uint32_t*)0x200000000608 = 0xd28; *(uint32_t*)0x20000000060c = 0; *(uint64_t*)0x200000000610 = 0x200000000000; memset((void*)0x200000000000, 37, 1); *(uint64_t*)0x200000000618 = 0; *(uint32_t*)0x200000000620 = 0xd01; *(uint32_t*)0x200000000624 = 0x88be; *(uint32_t*)0x200000000628 = 0; *(uint32_t*)0x20000000062c = 0; *(uint64_t*)0x200000000630 = 0; *(uint64_t*)0x200000000638 = 0; *(uint32_t*)0x200000000640 = 2; *(uint32_t*)0x200000000644 = 0; *(uint32_t*)0x200000000648 = 0; syscall(__NR_bpf, /*cmd=*/0xaul, /*arg=*/0x200000000600ul, /*size=*/0x48ul); return 0; }