// https://syzkaller.appspot.com/bug?id=a1954eed3adfde914df9a0a2d0b7d1ecb876072f // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef __NR_bpf #define __NR_bpf 321 #endif static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off)) #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \ *(type*)(addr) = \ htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \ (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len)))) static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } static void setup_sysctl() { int cad_pid = fork(); if (cad_pid < 0) exit(1); if (cad_pid == 0) { for (;;) sleep(100); } char tmppid[32]; snprintf(tmppid, sizeof(tmppid), "%d", cad_pid); struct { const char* name; const char* data; } files[] = { {"/sys/kernel/debug/x86/nmi_longest_ns", "10000000000"}, {"/proc/sys/kernel/hung_task_check_interval_secs", "20"}, {"/proc/sys/net/core/bpf_jit_kallsyms", "1"}, {"/proc/sys/net/core/bpf_jit_harden", "0"}, {"/proc/sys/kernel/kptr_restrict", "0"}, {"/proc/sys/kernel/softlockup_all_cpu_backtrace", "1"}, {"/proc/sys/fs/mount-max", "100"}, {"/proc/sys/vm/oom_dump_tasks", "0"}, {"/proc/sys/debug/exception-trace", "0"}, {"/proc/sys/kernel/printk", "7 4 1 3"}, {"/proc/sys/kernel/keys/gc_delay", "1"}, {"/proc/sys/vm/oom_kill_allocating_task", "1"}, {"/proc/sys/kernel/ctrl-alt-del", "0"}, {"/proc/sys/kernel/cad_pid", tmppid}, }; for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); i++) { if (!write_file(files[i].name, files[i].data)) { } } kill(cad_pid, SIGKILL); while (waitpid(cad_pid, NULL, 0) != cad_pid) ; } #define USLEEP_FORKED_CHILD (3 * 50 * 1000) static long handle_clone_ret(long ret) { if (ret != 0) { return ret; } usleep(USLEEP_FORKED_CHILD); syscall(__NR_exit, 0); while (1) { } } static long syz_clone(volatile long flags, volatile long stack, volatile long stack_len, volatile long ptid, volatile long ctid, volatile long tls) { long sp = (stack + stack_len) & ~15; long ret = (long)syscall(__NR_clone, flags & ~CLONE_VM, sp, ptid, ctid, tls); return handle_clone_ret(ret); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[6] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { 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 = 0x3 (4 bytes) // ninsn: bytesize8 = 0xc (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 18 11 00 00} (length 0x14) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYRES64: ANYRES64 (resource) // } // } // } // 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*)0x200000000a40 = 3; *(uint32_t*)0x200000000a44 = 0xc; *(uint64_t*)0x200000000a48 = 0x200000000440; memcpy((void*)0x200000000440, "\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18" "\x11\x00\x00", 20); *(uint32_t*)0x200000000454 = -1; *(uint64_t*)0x200000000458 = -1; *(uint64_t*)0x200000000a50 = 0; *(uint32_t*)0x200000000a58 = 0; *(uint32_t*)0x200000000a5c = 0; *(uint64_t*)0x200000000a60 = 0; *(uint32_t*)0x200000000a68 = 0; *(uint32_t*)0x200000000a6c = 0; memset((void*)0x200000000a70, 0, 16); *(uint32_t*)0x200000000a80 = 0; *(uint32_t*)0x200000000a84 = 0x25; *(uint32_t*)0x200000000a88 = -1; *(uint32_t*)0x200000000a8c = 8; *(uint64_t*)0x200000000a90 = 0; *(uint32_t*)0x200000000a98 = 0; *(uint32_t*)0x200000000a9c = 0x10; *(uint64_t*)0x200000000aa0 = 0; *(uint32_t*)0x200000000aa8 = 0; *(uint32_t*)0x200000000aac = 0; *(uint32_t*)0x200000000ab0 = 0; *(uint32_t*)0x200000000ab4 = 0; *(uint64_t*)0x200000000ab8 = 0; *(uint64_t*)0x200000000ac0 = 0; *(uint32_t*)0x200000000ac8 = 0x10; *(uint32_t*)0x200000000acc = 0; *(uint32_t*)0x200000000ad0 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000a40ul, /*size=*/0x94ul); // bpf$MAP_CREATE arguments: [ // cmd: const = 0x0 (8 bytes) // arg: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {17 00 00 00 00 00 00 00 04 00 00 00 03} (length // 0xd) // } // } // } // size: len = 0x48 (8 bytes) // ] // returns fd_bpf_map memcpy((void*)0x200000000640, "\x17\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x03", 13); syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200000000640ul, /*size=*/0x48ul); // bpf$MAP_CREATE arguments: [ // cmd: const = 0x0 (8 bytes) // arg: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {1b 00 00 00 00 00 00 00 00 00 00 00 00 80} // (length 0xe) // } // } // } // size: len = 0x48 (8 bytes) // ] // returns fd_bpf_map memcpy((void*)0x2000000000c0, "\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", 14); res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x2000000000c0ul, /*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 = 0x0 (4 bytes) // ninsn: bytesize8 = 0xc (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {18 01 00 00 11 00 00 00 00 00 00 00 00 00 00 // 00 18 12 00 00} (length 0x14) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {00 00 00 00 00 00 00 00 b7 08 00 00 00 00 00 // 00 7b 8a f8 ff 00 00 00 00 bf a2 00 00 00 00 00 00 07 02 00 00 // f8 ff ff ff b7 03 00 00 08 00 00 00 b7 04 00 00 f6 00 00 00 85 // 00 00 00 43 00 00 00 95} (length 0x41) // } // } // } // 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 = 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 = 0x24 (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 = 0x90 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x2000000000c0 = 0; *(uint32_t*)0x2000000000c4 = 0xc; *(uint64_t*)0x2000000000c8 = 0x200000000440; memcpy((void*)0x200000000440, "\x18\x01\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18" "\x12\x00\x00", 20); *(uint32_t*)0x200000000454 = r[0]; memcpy((void*)0x200000000458, "\x00\x00\x00\x00\x00\x00\x00\x00\xb7\x08\x00\x00\x00\x00\x00\x00\x7b" "\x8a\xf8\xff\x00\x00\x00\x00\xbf\xa2\x00\x00\x00\x00\x00\x00\x07\x02" "\x00\x00\xf8\xff\xff\xff\xb7\x03\x00\x00\x08\x00\x00\x00\xb7\x04\x00" "\x00\xf6\x00\x00\x00\x85\x00\x00\x00\x43\x00\x00\x00\x95", 65); *(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 = 0; *(uint32_t*)0x200000000108 = -1; *(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 = 0x24; *(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=*/0x90ul); // 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 = 0x13 (4 bytes) // ninsn: bytesize8 = 0x4 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 85 00 00 00 6d} (length 0x15) // } // } // } // 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 = 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*)0x200000000600 = 0x13; *(uint32_t*)0x200000000604 = 4; *(uint64_t*)0x200000000608 = 0x200000000480; memcpy((void*)0x200000000480, "\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x85" "\x00\x00\x00\x6d", 21); *(uint64_t*)0x200000000610 = 0; *(uint32_t*)0x200000000618 = 0; *(uint32_t*)0x20000000061c = 0; *(uint64_t*)0x200000000620 = 0; *(uint32_t*)0x200000000628 = 0; *(uint32_t*)0x20000000062c = 0; memset((void*)0x200000000630, 0, 16); *(uint32_t*)0x200000000640 = 0; *(uint32_t*)0x200000000644 = 0; *(uint32_t*)0x200000000648 = -1; *(uint32_t*)0x20000000064c = 0; *(uint64_t*)0x200000000650 = 0; *(uint32_t*)0x200000000658 = 0; *(uint32_t*)0x20000000065c = 0; *(uint64_t*)0x200000000660 = 0; *(uint32_t*)0x200000000668 = 0; *(uint32_t*)0x20000000066c = 0; *(uint32_t*)0x200000000670 = -1; *(uint32_t*)0x200000000674 = 0; *(uint64_t*)0x200000000678 = 0; *(uint64_t*)0x200000000680 = 0; *(uint32_t*)0x200000000688 = 0; *(uint32_t*)0x20000000068c = 0; *(uint32_t*)0x200000000690 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000600ul, /*size=*/0x94ul); // 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 = 0x11 (4 bytes) // ninsn: bytesize8 = 0xc (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 = 0x41000 (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 = 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*)0x200000000240 = 0x11; *(uint32_t*)0x200000000244 = 0xc; *(uint64_t*)0x200000000248 = 0x200000000440; *(uint64_t*)0x200000000250 = 0x200000000180; memcpy((void*)0x200000000180, "GPL\000", 4); *(uint32_t*)0x200000000258 = 0; *(uint32_t*)0x20000000025c = 0; *(uint64_t*)0x200000000260 = 0; *(uint32_t*)0x200000000268 = 0x41000; *(uint32_t*)0x20000000026c = 0; memset((void*)0x200000000270, 0, 16); *(uint32_t*)0x200000000280 = 0; *(uint32_t*)0x200000000284 = 0; *(uint32_t*)0x200000000288 = -1; *(uint32_t*)0x20000000028c = 0; *(uint64_t*)0x200000000290 = 0; *(uint32_t*)0x200000000298 = 0; *(uint32_t*)0x20000000029c = 0; *(uint64_t*)0x2000000002a0 = 0; *(uint32_t*)0x2000000002a8 = 0; *(uint32_t*)0x2000000002ac = 0; *(uint32_t*)0x2000000002b0 = 0; *(uint32_t*)0x2000000002b4 = 0; *(uint64_t*)0x2000000002b8 = 0; *(uint64_t*)0x2000000002c0 = 0; *(uint32_t*)0x2000000002c8 = 0; *(uint32_t*)0x2000000002cc = 0; *(uint32_t*)0x2000000002d0 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000240ul, /*size=*/0x94ul); if (res != -1) r[1] = res; // bpf$BPF_RAW_TRACEPOINT_OPEN arguments: [ // cmd: const = 0x11 (8 bytes) // arg: ptr[in, bpf_raw_tracepoint] { // bpf_raw_tracepoint { // name: ptr[in, buffer] { // buffer: {73 79 73 5f 65 6e 74 65 72 00} (length 0xa) // } // prog_fd: fd_bpf_prog_raw_tracepoint (resource) // pad: const = 0x0 (4 bytes) // cookie: int64 = 0x0 (8 bytes) // } // } // size: len = 0x10 (8 bytes) // ] // returns fd_perf_base *(uint64_t*)0x2000000005c0 = 0x200000000300; memcpy((void*)0x200000000300, "sys_enter\000", 10); *(uint32_t*)0x2000000005c8 = r[1]; *(uint32_t*)0x2000000005cc = 0; *(uint64_t*)0x2000000005d0 = 0; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x2000000005c0ul, /*size=*/0x10ul); // perf_event_open arguments: [ // attr: ptr[in, perf_event_attr] { // perf_event_attr { // type: perf_event_type = 0x1 (4 bytes) // size: len = 0x2 (4 bytes) // config0: int8 = 0x0 (1 bytes) // config1: int8 = 0x0 (1 bytes) // config2: int8 = 0x0 (1 bytes) // config3: int8 = 0x40 (1 bytes) // config4: const = 0x0 (4 bytes) // sample_freq: int64 = 0x5d30 (8 bytes) // sample_type: perf_sample_type = 0x0 (8 bytes) // read_format: perf_read_format = 0x6 (8 bytes) // disabled: int64 = 0x0 (0 bytes) // inherit: int64 = 0x0 (0 bytes) // pinned: int64 = 0x0 (0 bytes) // exclusive: int64 = 0x0 (0 bytes) // exclude_user: int64 = 0x0 (0 bytes) // exclude_kernel: int64 = 0x0 (0 bytes) // exclude_hv: int64 = 0x0 (0 bytes) // exclude_idle: int64 = 0x0 (0 bytes) // mmap: int64 = 0x0 (0 bytes) // comm: int64 = 0x0 (0 bytes) // freq: int64 = 0x0 (0 bytes) // inherit_stat: int64 = 0x0 (0 bytes) // enable_on_exec: int64 = 0x0 (0 bytes) // task: int64 = 0x0 (0 bytes) // watermark: int64 = 0x0 (0 bytes) // precise_ip: int64 = 0x0 (0 bytes) // mmap_data: int64 = 0x0 (0 bytes) // sample_id_all: int64 = 0x0 (0 bytes) // exclude_host: int64 = 0x0 (0 bytes) // exclude_guest: int64 = 0x0 (0 bytes) // exclude_callchain_kernel: int64 = 0x0 (0 bytes) // exclude_callchain_user: int64 = 0x0 (0 bytes) // mmap2: int64 = 0x0 (0 bytes) // comm_exec: int64 = 0x0 (0 bytes) // use_clockid: int64 = 0x0 (0 bytes) // context_switch: int64 = 0x0 (0 bytes) // write_backward: int64 = 0x0 (0 bytes) // namespaces: int64 = 0x0 (0 bytes) // ksymbol: int64 = 0x0 (0 bytes) // bpf_event: int64 = 0x0 (0 bytes) // aux_output: int64 = 0x0 (0 bytes) // cgroup: int64 = 0x0 (0 bytes) // text_poke: int64 = 0x0 (0 bytes) // build_id: int64 = 0x0 (0 bytes) // inherit_thread: int64 = 0x0 (0 bytes) // remove_on_exec: int64 = 0x0 (0 bytes) // sigtrap: int64 = 0x0 (0 bytes) // __reserved_1: const = 0x0 (8 bytes) // wakeup_events: int32 = 0x0 (4 bytes) // bp_type: perf_bp_type = 0x0 (4 bytes) // bp_config: union perf_bp_config { // perf_config_ext: perf_config_ext { // config1: int64 = 0x0 (8 bytes) // config2: int64 = 0x0 (8 bytes) // } // } // branch_sample_type: perf_branch_sample_type = 0x214 (8 bytes) // sample_regs_user: int64 = 0x0 (8 bytes) // sample_stack_user: int32 = 0x2 (4 bytes) // clockid: clock_type = 0x0 (4 bytes) // sample_regs_intr: int64 = 0x0 (8 bytes) // aux_watermark: int32 = 0x0 (4 bytes) // sample_max_stack: int16 = 0x1 (2 bytes) // __reserved_2: const = 0x0 (2 bytes) // aux_sample_size: int32 = 0x0 (4 bytes) // __reserved_3: const = 0x0 (4 bytes) // sig_data: int64 = 0x0 (8 bytes) // } // } // pid: pid (resource) // cpu: intptr = 0xffffffffffffffff (8 bytes) // group: fd_perf (resource) // flags: perf_flags = 0x0 (8 bytes) // ] // returns fd_perf *(uint32_t*)0x200000000180 = 1; *(uint32_t*)0x200000000184 = 2; *(uint8_t*)0x200000000188 = 0; *(uint8_t*)0x200000000189 = 0; *(uint8_t*)0x20000000018a = 0; *(uint8_t*)0x20000000018b = 0x40; *(uint32_t*)0x20000000018c = 0; *(uint64_t*)0x200000000190 = 0x5d30; *(uint64_t*)0x200000000198 = 0; *(uint64_t*)0x2000000001a0 = 6; STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 0, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 1, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 2, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 3, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 4, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 5, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 6, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 7, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 8, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 9, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 10, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 11, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 12, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 13, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 14, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 15, 2); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 17, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 18, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 19, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 20, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 21, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 22, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 23, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 24, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 25, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 26, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 27, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 28, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 29, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 30, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 31, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 32, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 33, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 34, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 35, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 36, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 37, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000001a8, 0, 38, 26); *(uint32_t*)0x2000000001b0 = 0; *(uint32_t*)0x2000000001b4 = 0; *(uint64_t*)0x2000000001b8 = 0; *(uint64_t*)0x2000000001c0 = 0; *(uint64_t*)0x2000000001c8 = 0x214; *(uint64_t*)0x2000000001d0 = 0; *(uint32_t*)0x2000000001d8 = 2; *(uint32_t*)0x2000000001dc = 0; *(uint64_t*)0x2000000001e0 = 0; *(uint32_t*)0x2000000001e8 = 0; *(uint16_t*)0x2000000001ec = 1; *(uint16_t*)0x2000000001ee = 0; *(uint32_t*)0x2000000001f0 = 0; *(uint32_t*)0x2000000001f4 = 0; *(uint64_t*)0x2000000001f8 = 0; syscall(__NR_perf_event_open, /*attr=*/0x200000000180ul, /*pid=*/0, /*cpu=*/(intptr_t)-1, /*group=*/(intptr_t)-1, /*flags=*/0ul); // bpf$PROG_LOAD_XDP arguments: [ // cmd: const = 0x5 (8 bytes) // arg: nil // size: len = 0x0 (8 bytes) // ] // returns fd_bpf_prog_xdp syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0ul, /*size=*/0ul); // 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 = 0x11 (4 bytes) // ninsn: bytesize8 = 0xc (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: // union bpf_prog_attach_types { // fallback: bpf_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 = 0x90 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x2000000000c0 = 0x11; *(uint32_t*)0x2000000000c4 = 0xc; *(uint64_t*)0x2000000000c8 = 0x200000000440; *(uint64_t*)0x2000000000d0 = 0x200000000240; memcpy((void*)0x200000000240, "GPL\000", 4); *(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 = 0; *(uint32_t*)0x200000000108 = -1; *(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; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x2000000000c0ul, /*size=*/0x90ul); if (res != -1) r[2] = res; // bpf$BPF_RAW_TRACEPOINT_OPEN arguments: [ // cmd: const = 0x11 (8 bytes) // arg: ptr[in, bpf_raw_tracepoint] { // bpf_raw_tracepoint { // name: ptr[in, buffer] { // buffer: {68 72 74 69 6d 65 72 5f 73 74 61 72 74 00} (length 0xe) // } // prog_fd: fd_bpf_prog_raw_tracepoint (resource) // pad: const = 0x0 (4 bytes) // cookie: int64 = 0x0 (8 bytes) // } // } // size: len = 0x18 (8 bytes) // ] // returns fd_perf_base *(uint64_t*)0x200000000340 = 0x200000000380; memcpy((void*)0x200000000380, "hrtimer_start\000", 14); *(uint32_t*)0x200000000348 = r[2]; *(uint32_t*)0x20000000034c = 0; *(uint64_t*)0x200000000350 = 0; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x200000000340ul, /*size=*/0x18ul); // 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 = 0xc (4 bytes) // ninsn: bytesize8 = 0xe (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {} (length 0x0) // } // } // } // license: ptr[in, buffer] { // buffer: {73 79 7a 6b 61 6c 6c 65 72 00} (length 0xa) // } // 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 = 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 = 0x94 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x200000000200 = 0xc; *(uint32_t*)0x200000000204 = 0xe; *(uint64_t*)0x200000000208 = 0x200000002ec0; *(uint64_t*)0x200000000210 = 0x200000000340; memcpy((void*)0x200000000340, "syzkaller\000", 10); *(uint32_t*)0x200000000218 = 0; *(uint32_t*)0x20000000021c = 0; *(uint64_t*)0x200000000220 = 0; *(uint32_t*)0x200000000228 = 0; *(uint32_t*)0x20000000022c = 0; memset((void*)0x200000000230, 0, 16); *(uint32_t*)0x200000000240 = 0; *(uint32_t*)0x200000000244 = 0; *(uint32_t*)0x200000000248 = -1; *(uint32_t*)0x20000000024c = 8; *(uint64_t*)0x200000000250 = 0; *(uint32_t*)0x200000000258 = 0; *(uint32_t*)0x20000000025c = 0x10; *(uint64_t*)0x200000000260 = 0; *(uint32_t*)0x200000000268 = 0; *(uint32_t*)0x20000000026c = 0; *(uint32_t*)0x200000000270 = -1; *(uint32_t*)0x200000000274 = 0; *(uint64_t*)0x200000000278 = 0; *(uint64_t*)0x200000000280 = 0; *(uint32_t*)0x200000000288 = 0x10; *(uint32_t*)0x20000000028c = 0; *(uint32_t*)0x200000000290 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000200ul, /*size=*/0x94ul); if (res != -1) r[3] = res; // 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 = 0x3 (4 bytes) // ninsn: bytesize8 = 0xc (4 bytes) // insns: nil // 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*)0x200000000a40 = 3; *(uint32_t*)0x200000000a44 = 0xc; *(uint64_t*)0x200000000a48 = 0; *(uint64_t*)0x200000000a50 = 0; *(uint32_t*)0x200000000a58 = 0; *(uint32_t*)0x200000000a5c = 0; *(uint64_t*)0x200000000a60 = 0; *(uint32_t*)0x200000000a68 = 0; *(uint32_t*)0x200000000a6c = 0; memset((void*)0x200000000a70, 0, 16); *(uint32_t*)0x200000000a80 = 0; *(uint32_t*)0x200000000a84 = 0x25; *(uint32_t*)0x200000000a88 = -1; *(uint32_t*)0x200000000a8c = 8; *(uint64_t*)0x200000000a90 = 0; *(uint32_t*)0x200000000a98 = 0; *(uint32_t*)0x200000000a9c = 0x10; *(uint64_t*)0x200000000aa0 = 0; *(uint32_t*)0x200000000aa8 = 0; *(uint32_t*)0x200000000aac = 0; *(uint32_t*)0x200000000ab0 = 0; *(uint32_t*)0x200000000ab4 = 0; *(uint64_t*)0x200000000ab8 = 0; *(uint64_t*)0x200000000ac0 = 0; *(uint32_t*)0x200000000ac8 = 0x10; *(uint32_t*)0x200000000acc = 0; *(uint32_t*)0x200000000ad0 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000a40ul, /*size=*/0x94ul); // bpf$PROG_LOAD arguments: [ // cmd: const = 0x5 (8 bytes) // arg: nil // size: len = 0x0 (8 bytes) // ] // returns fd_bpf_prog res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0ul, /*size=*/0ul); if (res != -1) r[4] = res; // bpf$BPF_RAW_TRACEPOINT_OPEN arguments: [ // cmd: const = 0x11 (8 bytes) // arg: ptr[in, bpf_raw_tracepoint] { // bpf_raw_tracepoint { // name: ptr[in, buffer] { // buffer: {6e 65 74 5f 64 65 76 5f 73 74 61 72 74 5f 78 6d 69 74 00} // (length 0x13) // } // prog_fd: fd_bpf_prog_raw_tracepoint (resource) // pad: const = 0x0 (4 bytes) // cookie: int64 = 0x0 (8 bytes) // } // } // size: len = 0x18 (8 bytes) // ] // returns fd_perf_base *(uint64_t*)0x200000001300 = 0x200000000c00; memcpy((void*)0x200000000c00, "net_dev_start_xmit\000", 19); *(uint32_t*)0x200000001308 = r[4]; *(uint32_t*)0x20000000130c = 0; *(uint64_t*)0x200000001310 = 0; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x200000001300ul, /*size=*/0x18ul); // 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 = 0x18000000000002a0 (4 bytes) // insizedata: len = 0xe2c (4 bytes) // outsizedata: len = 0x60000000 (4 bytes) // indata: ptr[in, buffer] { // buffer: {b9 ff 03 31 68 44 26 8c b8 9e 14 f0 08 00 47 e0 ff ff 00 // 12 40 00 63 2f 77 fb ac 14 fe 16 e0 00 03 0a 07 08 04 03 fe 80 00 // 00 20 00 65 58 84 50 13 f2 32 5f 1a 39 01 05 0b 03 8d a1 88 0b 25 // 18 1a a5 9d 94 3b e3 f4 ae d5 0e a5 a6 b8 68 67 31 cb 89 ef 77 12 // 3c 89 9b 69 9e ea a8 ea a0 07 34 61 11 96 63 90 64 00 f3 0c 06 00 // 00 00 00 00 00 59 b6 d3 29 6e 8c a3 1b ce 1d 83 92 07 8b 72 f2 49 // 96 ae 17 df fc 2e 43 c8 17 4b 54 b6 20 63 68 94 aa ac f2 8f f6 26 // 16 36 3c 70 a4 40 ae c4 01 4c af 28 c0 ad c0 43 08 46 17 d7 ec f4 // 1e 9d 13 45 89 d4 6e 5d fc 4c a5 78 0d 38 ca e8 70 b9 a1 df 48 b2 // 38 19 0d a4 50 29 6b 0a c0 14 96 ac e2 3e ef c9 d4 24 6d d1 4a fb // f7 9a 22 83 a0 bb 7e 1d 23 5f 3d f1 26 c3 ac c2 40 d7 5a 05 8f 6e // fa 6d 1f 5f 7f f4 00 00 00 00 00 00 00 00 00} (length 0xfe) // } // outdata: nil // repeat: int32 = 0x24 (4 bytes) // dur: const = 0x60000000 (4 bytes) // insizectx: len = 0x0 (4 bytes) // outsizectx: len = 0x0 (4 bytes) // inctx: ptr[in, buffer] { // buffer: {} (length 0x0) // } // outctx: ptr[in, buffer] { // buffer: {} (length 0x0) // } // flags: bpf_prog_test_run_flags = 0x0 (4 bytes) // cpu: const = 0x0 (4 bytes) // batch_size: int32 = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // } // } // size: len = 0x2c (8 bytes) // ] *(uint32_t*)0x200000000080 = r[3]; *(uint32_t*)0x200000000084 = 0x2a0; *(uint32_t*)0x200000000088 = 0xe2c; *(uint32_t*)0x20000000008c = 0x60000000; *(uint64_t*)0x200000000090 = 0x200000000100; memcpy((void*)0x200000000100, "\xb9\xff\x03\x31\x68\x44\x26\x8c\xb8\x9e\x14\xf0\x08\x00\x47\xe0\xff" "\xff\x00\x12\x40\x00\x63\x2f\x77\xfb\xac\x14\xfe\x16\xe0\x00\x03\x0a" "\x07\x08\x04\x03\xfe\x80\x00\x00\x20\x00\x65\x58\x84\x50\x13\xf2\x32" "\x5f\x1a\x39\x01\x05\x0b\x03\x8d\xa1\x88\x0b\x25\x18\x1a\xa5\x9d\x94" "\x3b\xe3\xf4\xae\xd5\x0e\xa5\xa6\xb8\x68\x67\x31\xcb\x89\xef\x77\x12" "\x3c\x89\x9b\x69\x9e\xea\xa8\xea\xa0\x07\x34\x61\x11\x96\x63\x90\x64" "\x00\xf3\x0c\x06\x00\x00\x00\x00\x00\x00\x59\xb6\xd3\x29\x6e\x8c\xa3" "\x1b\xce\x1d\x83\x92\x07\x8b\x72\xf2\x49\x96\xae\x17\xdf\xfc\x2e\x43" "\xc8\x17\x4b\x54\xb6\x20\x63\x68\x94\xaa\xac\xf2\x8f\xf6\x26\x16\x36" "\x3c\x70\xa4\x40\xae\xc4\x01\x4c\xaf\x28\xc0\xad\xc0\x43\x08\x46\x17" "\xd7\xec\xf4\x1e\x9d\x13\x45\x89\xd4\x6e\x5d\xfc\x4c\xa5\x78\x0d\x38" "\xca\xe8\x70\xb9\xa1\xdf\x48\xb2\x38\x19\x0d\xa4\x50\x29\x6b\x0a\xc0" "\x14\x96\xac\xe2\x3e\xef\xc9\xd4\x24\x6d\xd1\x4a\xfb\xf7\x9a\x22\x83" "\xa0\xbb\x7e\x1d\x23\x5f\x3d\xf1\x26\xc3\xac\xc2\x40\xd7\x5a\x05\x8f" "\x6e\xfa\x6d\x1f\x5f\x7f\xf4\x00\x00\x00\x00\x00\x00\x00\x00\x00", 254); *(uint64_t*)0x200000000098 = 0; *(uint32_t*)0x2000000000a0 = 0x24; *(uint32_t*)0x2000000000a4 = 0x60000000; *(uint32_t*)0x2000000000a8 = 0; *(uint32_t*)0x2000000000ac = 0; *(uint64_t*)0x2000000000b0 = 0x200000000000; *(uint64_t*)0x2000000000b8 = 0x200000000000; *(uint32_t*)0x2000000000c0 = 0; *(uint32_t*)0x2000000000c4 = 0; *(uint32_t*)0x2000000000c8 = 0; syscall(__NR_bpf, /*cmd=*/0xaul, /*arg=*/0x200000000080ul, /*size=*/0x2cul); // 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 = 0x3 (4 bytes) // ninsn: bytesize8 = 0xc (4 bytes) // insns: nil // 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*)0x200000000a40 = 3; *(uint32_t*)0x200000000a44 = 0xc; *(uint64_t*)0x200000000a48 = 0; *(uint64_t*)0x200000000a50 = 0; *(uint32_t*)0x200000000a58 = 0; *(uint32_t*)0x200000000a5c = 0; *(uint64_t*)0x200000000a60 = 0; *(uint32_t*)0x200000000a68 = 0; *(uint32_t*)0x200000000a6c = 0; memset((void*)0x200000000a70, 0, 16); *(uint32_t*)0x200000000a80 = 0; *(uint32_t*)0x200000000a84 = 0x25; *(uint32_t*)0x200000000a88 = -1; *(uint32_t*)0x200000000a8c = 8; *(uint64_t*)0x200000000a90 = 0; *(uint32_t*)0x200000000a98 = 0; *(uint32_t*)0x200000000a9c = 0x10; *(uint64_t*)0x200000000aa0 = 0; *(uint32_t*)0x200000000aa8 = 0; *(uint32_t*)0x200000000aac = 0; *(uint32_t*)0x200000000ab0 = 0; *(uint32_t*)0x200000000ab4 = 0; *(uint64_t*)0x200000000ab8 = 0; *(uint64_t*)0x200000000ac0 = 0; *(uint32_t*)0x200000000ac8 = 0x10; *(uint32_t*)0x200000000acc = 0; *(uint32_t*)0x200000000ad0 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000a40ul, /*size=*/0x94ul); // 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 = 0x11 (4 bytes) // ninsn: bytesize8 = 0xc (4 bytes) // insns: nil // 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 = 0x8 (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 = 0x35 (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 = 0x11; *(uint32_t*)0x2000000000c4 = 0xc; *(uint64_t*)0x2000000000c8 = 0; *(uint64_t*)0x2000000000d0 = 0x200000000600; memcpy((void*)0x200000000600, "GPL\000", 4); *(uint32_t*)0x2000000000d8 = 0; *(uint32_t*)0x2000000000dc = 0; *(uint64_t*)0x2000000000e0 = 0; *(uint32_t*)0x2000000000e8 = 0; *(uint32_t*)0x2000000000ec = 8; memset((void*)0x2000000000f0, 0, 16); *(uint32_t*)0x200000000100 = 0; *(uint32_t*)0x200000000104 = 0x35; *(uint32_t*)0x200000000108 = -1; *(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; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x2000000000c0ul, /*size=*/0x94ul); if (res != -1) r[5] = res; // bpf$BPF_RAW_TRACEPOINT_OPEN arguments: [ // cmd: const = 0x11 (8 bytes) // arg: ptr[in, bpf_raw_tracepoint] { // bpf_raw_tracepoint { // name: ptr[in, buffer] { // buffer: {6b 66 72 65 65 00} (length 0x6) // } // prog_fd: fd_bpf_prog_raw_tracepoint (resource) // pad: const = 0x0 (4 bytes) // cookie: int64 = 0x0 (8 bytes) // } // } // size: len = 0x10 (8 bytes) // ] // returns fd_perf_base *(uint64_t*)0x200000000f40 = 0x200000000f00; memcpy((void*)0x200000000f00, "kfree\000", 6); *(uint32_t*)0x200000000f48 = r[5]; *(uint32_t*)0x200000000f4c = 0; *(uint64_t*)0x200000000f50 = 0; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x200000000f40ul, /*size=*/0x10ul); // syz_clone arguments: [ // flags: clone_flags = 0x630c1100 (8 bytes) // stack: nil // stack_len: bytesize = 0x0 (8 bytes) // parentid: nil // childtid: nil // tls: nil // ] // returns pid syz_clone( /*flags=CLONE_PIDFD|CLONE_NEWNET|CLONE_NEWPID|CLONE_NEWCGROUP|CLONE_CHILD_SETTID|CLONE_SETTLS|0x40100*/ 0x630c1100, /*stack=*/0, /*stack_len=*/0, /*parentid=*/0, /*childtid=*/0, /*tls=*/0); // perf_event_open arguments: [ // attr: ptr[in, perf_event_attr] { // perf_event_attr { // type: perf_event_type = 0x1 (4 bytes) // size: len = 0x80 (4 bytes) // config0: int8 = 0x0 (1 bytes) // config1: int8 = 0x0 (1 bytes) // config2: int8 = 0x0 (1 bytes) // config3: int8 = 0x0 (1 bytes) // config4: const = 0x0 (4 bytes) // sample_freq: int64 = 0x200 (8 bytes) // sample_type: perf_sample_type = 0x20 (8 bytes) // read_format: perf_read_format = 0x0 (8 bytes) // disabled: int64 = 0x0 (0 bytes) // inherit: int64 = 0x0 (0 bytes) // pinned: int64 = 0x0 (0 bytes) // exclusive: int64 = 0x0 (0 bytes) // exclude_user: int64 = 0x0 (0 bytes) // exclude_kernel: int64 = 0x0 (0 bytes) // exclude_hv: int64 = 0x0 (0 bytes) // exclude_idle: int64 = 0x0 (0 bytes) // mmap: int64 = 0x0 (0 bytes) // comm: int64 = 0x0 (0 bytes) // freq: int64 = 0x0 (0 bytes) // inherit_stat: int64 = 0x0 (0 bytes) // enable_on_exec: int64 = 0x0 (0 bytes) // task: int64 = 0x0 (0 bytes) // watermark: int64 = 0x0 (0 bytes) // precise_ip: int64 = 0x0 (0 bytes) // mmap_data: int64 = 0x0 (0 bytes) // sample_id_all: int64 = 0x0 (0 bytes) // exclude_host: int64 = 0x0 (0 bytes) // exclude_guest: int64 = 0x0 (0 bytes) // exclude_callchain_kernel: int64 = 0x0 (0 bytes) // exclude_callchain_user: int64 = 0x0 (0 bytes) // mmap2: int64 = 0x0 (0 bytes) // comm_exec: int64 = 0x0 (0 bytes) // use_clockid: int64 = 0x0 (0 bytes) // context_switch: int64 = 0x0 (0 bytes) // write_backward: int64 = 0x0 (0 bytes) // namespaces: int64 = 0x0 (0 bytes) // ksymbol: int64 = 0x0 (0 bytes) // bpf_event: int64 = 0x0 (0 bytes) // aux_output: int64 = 0x0 (0 bytes) // cgroup: int64 = 0x0 (0 bytes) // text_poke: int64 = 0x0 (0 bytes) // build_id: int64 = 0x0 (0 bytes) // inherit_thread: int64 = 0x0 (0 bytes) // remove_on_exec: int64 = 0x0 (0 bytes) // sigtrap: int64 = 0x0 (0 bytes) // __reserved_1: const = 0x0 (8 bytes) // wakeup_events: int32 = 0x0 (4 bytes) // bp_type: perf_bp_type = 0x0 (4 bytes) // bp_config: union perf_bp_config { // perf_bp: perf_bp { // bp_addr: nil // bp_len: perf_bp_lens = 0xb (8 bytes) // } // } // branch_sample_type: perf_branch_sample_type = 0x0 (8 bytes) // sample_regs_user: int64 = 0x0 (8 bytes) // sample_stack_user: int32 = 0x0 (4 bytes) // clockid: clock_type = 0x0 (4 bytes) // sample_regs_intr: int64 = 0x0 (8 bytes) // aux_watermark: int32 = 0x2 (4 bytes) // sample_max_stack: int16 = 0x0 (2 bytes) // __reserved_2: const = 0x0 (2 bytes) // aux_sample_size: int32 = 0x0 (4 bytes) // __reserved_3: const = 0x0 (4 bytes) // sig_data: int64 = 0x0 (8 bytes) // } // } // pid: pid (resource) // cpu: intptr = 0xffffffffffffffff (8 bytes) // group: fd_perf (resource) // flags: perf_flags = 0x0 (8 bytes) // ] // returns fd_perf *(uint32_t*)0x2000000012c0 = 1; *(uint32_t*)0x2000000012c4 = 0x80; *(uint8_t*)0x2000000012c8 = 0; *(uint8_t*)0x2000000012c9 = 0; *(uint8_t*)0x2000000012ca = 0; *(uint8_t*)0x2000000012cb = 0; *(uint32_t*)0x2000000012cc = 0; *(uint64_t*)0x2000000012d0 = 0x200; *(uint64_t*)0x2000000012d8 = 0x20; *(uint64_t*)0x2000000012e0 = 0; STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 0, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 1, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 2, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 3, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 4, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 5, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 6, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 7, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 8, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 9, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 10, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 11, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 12, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 13, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 14, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 15, 2); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 17, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 18, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 19, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 20, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 21, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 22, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 23, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 24, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 25, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 26, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 27, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 28, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 29, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 30, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 31, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 32, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 33, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 34, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 35, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 36, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 37, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000012e8, 0, 38, 26); *(uint32_t*)0x2000000012f0 = 0; *(uint32_t*)0x2000000012f4 = 0; *(uint64_t*)0x2000000012f8 = 0; *(uint64_t*)0x200000001300 = 0xb; *(uint64_t*)0x200000001308 = 0; *(uint64_t*)0x200000001310 = 0; *(uint32_t*)0x200000001318 = 0; *(uint32_t*)0x20000000131c = 0; *(uint64_t*)0x200000001320 = 0; *(uint32_t*)0x200000001328 = 2; *(uint16_t*)0x20000000132c = 0; *(uint16_t*)0x20000000132e = 0; *(uint32_t*)0x200000001330 = 0; *(uint32_t*)0x200000001334 = 0; *(uint64_t*)0x200000001338 = 0; syscall(__NR_perf_event_open, /*attr=*/0x2000000012c0ul, /*pid=*/0, /*cpu=*/(intptr_t)-1, /*group=*/(intptr_t)-1, /*flags=*/0ul); // bpf$BPF_PROG_RAW_TRACEPOINT_LOAD arguments: [ // cmd: const = 0x5 (8 bytes) // arg: ptr[in, bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], // const[0, int32], const[0, int32], const[0, int32]]] { // bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], const[0, // int32], const[0, int32], const[0, int32]] { // type: bpf_raw_tracepoint_prog_types = 0x1a (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 d6 21 03 68 8f aa f8 // bf bd 08 06 84 b0 ac 00 00 00 00 fd ff ff ff 95 00 00 00 00 00 // 00 00} (length 0x26) // } // } // } // 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 = 0x19 (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 = 0x2004 (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[flags[bpf_raw_tracepoint_prog_types, int32], const[0, // int32], const[0, int32], const[0, int32]]_prog_token_fd_wrapper { // void: buffer: {} (length 0x0) // } // pad: union _bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], // const[0, int32], const[0, int32], const[0, int32]]_pad_wrapper { // value: const = 0x0 (4 bytes) // } // } // } // size: len = 0x94 (8 bytes) // ] // returns fd_bpf_prog_raw_tracepoint *(uint32_t*)0x200000002ac0 = 0x1a; *(uint32_t*)0x200000002ac4 = 3; *(uint64_t*)0x200000002ac8 = 0x200000000000; memcpy((void*)0x200000000000, "\x18\x00\x00\x00\x02\x00\x00\x00\xd6\x21\x03\x68\x8f\xaa\xf8\xbf\xbd" "\x08\x06\x84\xb0\xac\x00\x00\x00\x00\xfd\xff\xff\xff\x95\x00\x00\x00" "\x00\x00\x00\x00", 38); *(uint64_t*)0x200000002ad0 = 0x2000000001c0; memcpy((void*)0x2000000001c0, "GPL\000", 4); *(uint32_t*)0x200000002ad8 = 0; *(uint32_t*)0x200000002adc = 0; *(uint64_t*)0x200000002ae0 = 0; *(uint32_t*)0x200000002ae8 = 0; *(uint32_t*)0x200000002aec = 0; memset((void*)0x200000002af0, 0, 16); *(uint32_t*)0x200000002b00 = 0; *(uint32_t*)0x200000002b04 = 0x19; *(uint32_t*)0x200000002b08 = -1; *(uint32_t*)0x200000002b0c = 8; *(uint64_t*)0x200000002b10 = 0; *(uint32_t*)0x200000002b18 = 0; *(uint32_t*)0x200000002b1c = 0x10; *(uint64_t*)0x200000002b20 = 0; *(uint32_t*)0x200000002b28 = 0; *(uint32_t*)0x200000002b2c = 0x2004; *(uint32_t*)0x200000002b30 = 0; *(uint32_t*)0x200000002b34 = 0; *(uint64_t*)0x200000002b38 = 0; *(uint64_t*)0x200000002b40 = 0; *(uint32_t*)0x200000002b48 = 0x10; *(uint32_t*)0x200000002b4c = 0; *(uint32_t*)0x200000002b50 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000002ac0ul, /*size=*/0x94ul); // bpf$BPF_RAW_TRACEPOINT_OPEN arguments: [ // cmd: const = 0x11 (8 bytes) // arg: nil // size: len = 0x0 (8 bytes) // ] // returns fd_perf_base syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0ul, /*size=*/0ul); // bpf$MAP_CREATE arguments: [ // cmd: const = 0x0 (8 bytes) // arg: nil // size: len = 0x48 (8 bytes) // ] // returns fd_bpf_map syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0ul, /*size=*/0x48ul); // bpf$MAP_CREATE arguments: [ // cmd: const = 0x0 (8 bytes) // arg: nil // size: len = 0x0 (8 bytes) // ] // returns fd_bpf_map syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0ul, /*size=*/0ul); } 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); setup_sysctl(); const char* reason; (void)reason; loop(); return 0; }