// https://syzkaller.appspot.com/bug?id=101b7e71f53b37caf00bf159bd293d6d6512242a // 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"); } #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[7] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0x0}; void execute_one(void) { 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 = 0x1b (4 bytes) // ksize: int32 = 0x0 (4 bytes) // vsize: int32 = 0x0 (4 bytes) // max: int32 = 0x8000 (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*)0x2000000000c0 = 0x1b; *(uint32_t*)0x2000000000c4 = 0; *(uint32_t*)0x2000000000c8 = 0; *(uint32_t*)0x2000000000cc = 0x8000; *(uint32_t*)0x2000000000d0 = 0; *(uint32_t*)0x2000000000d4 = -1; *(uint32_t*)0x2000000000d8 = 0; memset((void*)0x2000000000dc, 0, 16); *(uint32_t*)0x2000000000ec = 0; *(uint32_t*)0x2000000000f0 = -1; *(uint32_t*)0x2000000000f4 = 0; *(uint32_t*)0x2000000000f8 = 0; *(uint32_t*)0x2000000000fc = 0; *(uint64_t*)0x200000000100 = 0; *(uint32_t*)0x200000000108 = 0; *(uint32_t*)0x20000000010c = 0; 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 = 0x0 (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 = 0; *(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); // bpf$MAP_CREATE_CONST_STR arguments: [ // cmd: const = 0x0 (8 bytes) // arg: nil // size: len = 0x50 (8 bytes) // ] // returns fd_bpf_const_str_map syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0ul, /*size=*/0x50ul); // bpf$PROG_LOAD arguments: [ // cmd: const = 0x5 (8 bytes) // arg: nil // size: len = 0x0 (8 bytes) // ] // returns fd_bpf_prog syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0ul, /*size=*/0ul); // bpf$PROG_LOAD arguments: [ // cmd: const = 0x1c (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 = 0x0 (4 bytes) // insns: nil // license: nil // loglev: int32 = 0x4 (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 = 0x36 (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 = 0xffffffff (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*)0x2000000003c0 = 3; *(uint32_t*)0x2000000003c4 = 0; *(uint64_t*)0x2000000003c8 = 0; *(uint64_t*)0x2000000003d0 = 0; *(uint32_t*)0x2000000003d8 = 4; *(uint32_t*)0x2000000003dc = 0; *(uint64_t*)0x2000000003e0 = 0; *(uint32_t*)0x2000000003e8 = 0; *(uint32_t*)0x2000000003ec = 0; memset((void*)0x2000000003f0, 0, 16); *(uint32_t*)0x200000000400 = 0; *(uint32_t*)0x200000000404 = 0x36; *(uint32_t*)0x200000000408 = 0; *(uint32_t*)0x20000000040c = 0; *(uint64_t*)0x200000000410 = 0; *(uint32_t*)0x200000000418 = 0; *(uint32_t*)0x20000000041c = 0; *(uint64_t*)0x200000000420 = 0; *(uint32_t*)0x200000000428 = 0; *(uint32_t*)0x20000000042c = 0; *(uint32_t*)0x200000000430 = 0; *(uint32_t*)0x200000000434 = 0; *(uint64_t*)0x200000000438 = 0; *(uint64_t*)0x200000000440 = 0; *(uint32_t*)0x200000000448 = 0; *(uint32_t*)0x20000000044c = -1; *(uint32_t*)0x200000000450 = 0; syscall(__NR_bpf, /*cmd=*/0x1cul, /*arg=*/0x2000000003c0ul, /*size=*/0x94ul); // perf_event_open arguments: [ // attr: ptr[in, perf_event_attr] { // perf_event_attr { // type: perf_event_type = 0x2 (4 bytes) // size: len = 0x80 (4 bytes) // config0: int8 = 0xe2 (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 = 0x0 (8 bytes) // sample_type: perf_sample_type = 0x0 (8 bytes) // read_format: perf_read_format = 0x2 (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 = 0x1 (8 bytes) // config2: int64 = 0x0 (8 bytes) // } // } // branch_sample_type: perf_branch_sample_type = 0x0 (8 bytes) // sample_regs_user: int64 = 0x0 (8 bytes) // sample_stack_user: int32 = 0x1000000 (4 bytes) // clockid: clock_type = 0x0 (4 bytes) // sample_regs_intr: int64 = 0x7fffffff (8 bytes) // aux_watermark: int32 = 0x0 (4 bytes) // sample_max_stack: int16 = 0x9 (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 = 0x0 (8 bytes) // group: fd_perf (resource) // flags: perf_flags = 0x0 (8 bytes) // ] // returns fd_perf *(uint32_t*)0x200000000100 = 2; *(uint32_t*)0x200000000104 = 0x80; *(uint8_t*)0x200000000108 = 0xe2; *(uint8_t*)0x200000000109 = 0; *(uint8_t*)0x20000000010a = 0; *(uint8_t*)0x20000000010b = 0; *(uint32_t*)0x20000000010c = 0; *(uint64_t*)0x200000000110 = 0; *(uint64_t*)0x200000000118 = 0; *(uint64_t*)0x200000000120 = 2; STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 0, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 1, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 2, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 3, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 4, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 5, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 6, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 7, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 8, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 9, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 10, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 11, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 12, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 13, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 14, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 15, 2); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 17, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 18, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 19, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 20, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 21, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 22, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 23, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 24, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 25, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 26, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 27, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 28, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 29, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 30, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 31, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 32, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 33, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 34, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 35, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 36, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 37, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000128, 0, 38, 26); *(uint32_t*)0x200000000130 = 0; *(uint32_t*)0x200000000134 = 0; *(uint64_t*)0x200000000138 = 1; *(uint64_t*)0x200000000140 = 0; *(uint64_t*)0x200000000148 = 0; *(uint64_t*)0x200000000150 = 0; *(uint32_t*)0x200000000158 = 0x1000000; *(uint32_t*)0x20000000015c = 0; *(uint64_t*)0x200000000160 = 0x7fffffff; *(uint32_t*)0x200000000168 = 0; *(uint16_t*)0x20000000016c = 9; *(uint16_t*)0x20000000016e = 0; *(uint32_t*)0x200000000170 = 0; *(uint32_t*)0x200000000174 = 0; *(uint64_t*)0x200000000178 = 0; syscall(__NR_perf_event_open, /*attr=*/0x200000000100ul, /*pid=*/0, /*cpu=*/0ul, /*group=*/(intptr_t)-1, /*flags=*/0ul); // mkdirat$cgroup_root arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // path: ptr[in, buffer] { // buffer: {2e 2f 63 67 72 6f 75 70 2f 73 79 7a 30 00} (length 0xe) // } // mode: const = 0x1ff (8 bytes) // ] memcpy((void*)0x200000000000, "./cgroup/syz0\000", 14); syscall(__NR_mkdirat, /*fd=*/0xffffffffffffff9cul, /*path=*/0x200000000000ul, /*mode=*/0x1fful); // 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 = 0x4 (4 bytes) // ninsn: bytesize8 = 0xe (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 = 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 = 0x8 (4 bytes) // func_info: ptr[in, bpf_func_info] { // bpf_func_info { // insn_off: int32 = 0x2 (4 bytes) // type_id: int32 = 0x0 (4 bytes) // } // } // func_info_cnt: len = 0x8 (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 = 0x10 (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 = 4; *(uint32_t*)0x200000000204 = 0xe; *(uint64_t*)0x200000000208 = 0; *(uint64_t*)0x200000000210 = 0x200000000340; memcpy((void*)0x200000000340, "GPL\000", 4); *(uint32_t*)0x200000000218 = 0; *(uint32_t*)0x20000000021c = 0; *(uint64_t*)0x200000000220 = 0; *(uint32_t*)0x200000000228 = 0x41000; *(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 = 0x200000000000; *(uint32_t*)0x200000000000 = 2; *(uint32_t*)0x200000000004 = 0; *(uint32_t*)0x200000000258 = 8; *(uint32_t*)0x20000000025c = 0x10; *(uint64_t*)0x200000000260 = 0x200000000100; *(uint32_t*)0x200000000100 = 0; *(uint32_t*)0x200000000104 = 0; *(uint32_t*)0x200000000108 = 0; *(uint32_t*)0x20000000010c = 0; *(uint32_t*)0x200000000268 = 0x10; *(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; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000200ul, /*size=*/0x94ul); // mkdirat$cgroup_root arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // path: ptr[in, buffer] { // buffer: {2e 2f 63 67 72 6f 75 70 2e 6e 65 74 2f 73 79 7a 30 00} // (length 0x12) // } // mode: const = 0x1ff (8 bytes) // ] memcpy((void*)0x200000000040, "./cgroup.net/syz0\000", 18); syscall(__NR_mkdirat, /*fd=*/0xffffffffffffff9cul, /*path=*/0x200000000040ul, /*mode=*/0x1fful); // openat$cgroup_root arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {} (length 0x0) // } // flags: const = 0x200002 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_cgroup res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000040ul, /*flags=*/0x200002, /*mode=*/0); if (res != -1) r[2] = res; // openat$cgroup_devices arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {64 65 76 69 63 65 73 2e 61 6c 6c 6f 77 00} (length 0xe) // } // flags: const = 0x2 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_cgroup_devices memcpy((void*)0x200000000300, "devices.allow\000", 14); res = syscall(__NR_openat, /*fd=*/r[2], /*file=*/0x200000000300ul, /*flags=*/2, /*mode=*/0); if (res != -1) r[3] = res; // write$cgroup_devices arguments: [ // fd: fd_cgroup_devices (resource) // buf: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {63 20 2a 3a 32 33} (length 0x6) // } // } // } // len: bytesize = 0xa (8 bytes) // ] memcpy((void*)0x200000000140, "c *:23", 6); syscall(__NR_write, /*fd=*/r[3], /*buf=*/0x200000000140ul, /*len=*/0xaul); // openat$cgroup_type arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {63 67 72 6f 75 70 2e 74 79 70 65 00} (length 0xc) // } // flags: const = 0x2 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_cgroup_type memcpy((void*)0x200000000100, "cgroup.type\000", 12); res = syscall(__NR_openat, /*fd=*/(intptr_t)-1, /*file=*/0x200000000100ul, /*flags=*/2, /*mode=*/0); if (res != -1) r[4] = res; // write$cgroup_type arguments: [ // fd: fd_cgroup_type (resource) // buf: ptr[in, buffer] { // buffer: {74 68 72 65 61 64 65 64 00} (length 0x9) // } // len: bytesize = 0x9 (8 bytes) // ] memcpy((void*)0x200000000280, "threaded\000", 9); syscall(__NR_write, /*fd=*/r[4], /*buf=*/0x200000000280ul, /*len=*/9ul); // 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*)0x200000000340, "\x02\x00\x00\x00\x04\x00\x00\x00\x08\x00\x00\x00\x01", 13); res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200000000340ul, /*size=*/0x48ul); if (res != -1) r[5] = 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 = 0x6 (4 bytes) // ninsn: bytesize8 = 0x10 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {18 05 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 b7 08 00 00 00 00 00 00 7b 8a f8 ff 00 00 00 00 b7 08 00 00 // 00 00 00 00 7b 8a f0 ff 00 00 00 00 bf a1 00 00 00 00 00 00 07 // 01 00 00 f8 ff ff ff bf a4 00 00 00 00 00 00 07 04 00 00 f0 ff // ff ff b7 02 00 00 00 00 00 00 18 23 00 00} (length 0x5c) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {00 00 00 00 00 00 00 00 b7 04 00 00 00 00 00 // 00 85 00 00 00 1c 00 00 00 95} (length 0x19) // } // } // } // 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 { // xdp: xdp_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*)0x2000000003c0 = 6; *(uint32_t*)0x2000000003c4 = 0x10; *(uint64_t*)0x2000000003c8 = 0x2000000008c0; memcpy((void*)0x2000000008c0, "\x18\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb7" "\x08\x00\x00\x00\x00\x00\x00\x7b\x8a\xf8\xff\x00\x00\x00\x00\xb7\x08" "\x00\x00\x00\x00\x00\x00\x7b\x8a\xf0\xff\x00\x00\x00\x00\xbf\xa1\x00" "\x00\x00\x00\x00\x00\x07\x01\x00\x00\xf8\xff\xff\xff\xbf\xa4\x00\x00" "\x00\x00\x00\x00\x07\x04\x00\x00\xf0\xff\xff\xff\xb7\x02\x00\x00\x00" "\x00\x00\x00\x18\x23\x00\x00", 92); *(uint32_t*)0x20000000091c = r[5]; memcpy((void*)0x200000000920, "\x00\x00\x00\x00\x00\x00\x00\x00\xb7\x04\x00\x00\x00\x00\x00\x00\x85" "\x00\x00\x00\x1c\x00\x00\x00\x95", 25); *(uint64_t*)0x2000000003d0 = 0x200000000000; memcpy((void*)0x200000000000, "syzkaller\000", 10); *(uint32_t*)0x2000000003d8 = 0; *(uint32_t*)0x2000000003dc = 0; *(uint64_t*)0x2000000003e0 = 0; *(uint32_t*)0x2000000003e8 = 0; *(uint32_t*)0x2000000003ec = 0; memset((void*)0x2000000003f0, 0, 16); *(uint32_t*)0x200000000400 = 0; *(uint32_t*)0x200000000404 = 0; *(uint32_t*)0x200000000408 = -1; *(uint32_t*)0x20000000040c = 0; *(uint64_t*)0x200000000410 = 0; *(uint32_t*)0x200000000418 = 0; *(uint32_t*)0x20000000041c = 0; *(uint64_t*)0x200000000420 = 0; *(uint32_t*)0x200000000428 = 0; *(uint32_t*)0x20000000042c = 0; *(uint32_t*)0x200000000430 = 0; *(uint32_t*)0x200000000434 = 0; *(uint64_t*)0x200000000438 = 0; *(uint64_t*)0x200000000440 = 0; *(uint32_t*)0x200000000448 = 0; *(uint32_t*)0x20000000044c = 0; *(uint32_t*)0x200000000450 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x2000000003c0ul, /*size=*/0x94ul); // openat$cgroup_procs arguments: [ // fd: fd_cgroup (resource) // file: nil // flags: const = 0x2 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_cgroup_pid syscall(__NR_openat, /*fd=*/(intptr_t)-1, /*file=*/0ul, /*flags=*/2, /*mode=*/0); // syz_clone arguments: [ // flags: clone_flags = 0xc920000 (8 bytes) // stack: nil // stack_len: bytesize = 0x0 (8 bytes) // parentid: nil // childtid: nil // tls: nil // ] // returns pid res = -1; res = syz_clone( /*flags=CLONE_NEWIPC|CLONE_NEWUTS|CLONE_UNTRACED|CLONE_PARENT_SETTID|CLONE_NEWNS*/ 0xc920000, /*stack=*/0, /*stack_len=*/0, /*parentid=*/0, /*childtid=*/0, /*tls=*/0); if (res != -1) r[6] = res; // bpf$BPF_TASK_FD_QUERY arguments: [ // cmd: const = 0x14 (8 bytes) // arg: ptr[inout, bpf_task_fd_query] { // bpf_task_fd_query { // pid: pid (resource) // fd: fd_perf_base (resource) // flags: const = 0x0 (4 bytes) // buf_len: bytesize = 0x7 (4 bytes) // buf: ptr[in, buffer] { // buffer: {63 67 72 6f 75 70 00} (length 0x7) // } // prog_id: bpf_prog_id (resource) // fd_type: int32 = 0x0 (4 bytes) // probe_offset: int64 = 0x0 (8 bytes) // probe_addr: int64 = 0x0 (8 bytes) // } // } // size: len = 0x30 (8 bytes) // ] *(uint32_t*)0x200000000180 = r[6]; *(uint32_t*)0x200000000184 = -1; *(uint32_t*)0x200000000188 = 0; *(uint32_t*)0x20000000018c = 7; *(uint64_t*)0x200000000190 = 0x200000000000; memcpy((void*)0x200000000000, "cgroup\000", 7); syscall(__NR_bpf, /*cmd=*/0x14ul, /*arg=*/0x200000000180ul, /*size=*/0x30ul); // write$cgroup_subtree arguments: [ // fd: fd_cgroup_subtree (resource) // buf: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {2b 70 69 64 73 20 e9 61 ca ea 89 f8 82 ea 8d 22 // ac de 99 c4 0e ee 67 7e 38 3a 90} (length 0x1b) // } // } // } // len: bytesize = 0x6 (8 bytes) // ] memcpy((void*)0x200000000040, "\x2b\x70\x69\x64\x73\x20\xe9\x61\xca\xea\x89\xf8\x82\xea\x8d\x22\xac" "\xde\x99\xc4\x0e\xee\x67\x7e\x38\x3a\x90", 27); syscall(__NR_write, /*fd=*/(intptr_t)-1, /*buf=*/0x200000000040ul, /*len=*/6ul); } 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; loop(); return 0; }