// https://syzkaller.appspot.com/bug?id=e37cd3116d37d681e7178d373040ec722896f0b4 // 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 #ifndef __NR_bpf #define __NR_bpf 321 #endif static unsigned long long procid; 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 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // 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 = 0x1b (1 bytes) // config1: int8 = 0x1 (1 bytes) // config2: int8 = 0x0 (1 bytes) // config3: int8 = 0x0 (1 bytes) // config4: const = 0x0 (4 bytes) // sample_freq: int64 = 0x2 (8 bytes) // sample_type: perf_sample_type = 0x0 (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_config_ext: perf_config_ext { // config1: int64 = 0x0 (8 bytes) // config2: int64 = 0x0 (8 bytes) // } // } // branch_sample_type: perf_branch_sample_type = 0x14869 (8 bytes) // sample_regs_user: int64 = 0x0 (8 bytes) // sample_stack_user: int32 = 0xfffffffc (4 bytes) // clockid: clock_type = 0x0 (4 bytes) // sample_regs_intr: int64 = 0xdd3 (8 bytes) // aux_watermark: int32 = 0x0 (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 = 0x0 (8 bytes) // group: fd_perf (resource) // flags: perf_flags = 0x0 (8 bytes) // ] // returns fd_perf *(uint32_t*)0x200000000140 = 2; *(uint32_t*)0x200000000144 = 0x80; *(uint8_t*)0x200000000148 = 0x1b; *(uint8_t*)0x200000000149 = 1; *(uint8_t*)0x20000000014a = 0; *(uint8_t*)0x20000000014b = 0; *(uint32_t*)0x20000000014c = 0; *(uint64_t*)0x200000000150 = 2; *(uint64_t*)0x200000000158 = 0; *(uint64_t*)0x200000000160 = 0; STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 0, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 1, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 2, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 3, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 4, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 5, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 6, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 7, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 8, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 9, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 10, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 11, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 12, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 13, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 14, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 15, 2); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 17, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 18, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 19, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 20, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 21, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 22, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 23, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 24, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 25, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 26, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 27, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 28, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 29, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 30, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 31, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 32, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 33, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 34, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 35, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 36, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 37, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000168, 0, 38, 26); *(uint32_t*)0x200000000170 = 0; *(uint32_t*)0x200000000174 = 0; *(uint64_t*)0x200000000178 = 0; *(uint64_t*)0x200000000180 = 0; *(uint64_t*)0x200000000188 = 0x14869; *(uint64_t*)0x200000000190 = 0; *(uint32_t*)0x200000000198 = 0xfffffffc; *(uint32_t*)0x20000000019c = 0; *(uint64_t*)0x2000000001a0 = 0xdd3; *(uint32_t*)0x2000000001a8 = 0; *(uint16_t*)0x2000000001ac = 0; *(uint16_t*)0x2000000001ae = 0; *(uint32_t*)0x2000000001b0 = 0; *(uint32_t*)0x2000000001b4 = 0; *(uint64_t*)0x2000000001b8 = 0; res = syscall(__NR_perf_event_open, /*attr=*/0x200000000140ul, /*pid=*/0, /*cpu=*/0ul, /*group=*/(intptr_t)-1, /*flags=*/0ul); 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 = 0x5 (4 bytes) // ninsn: bytesize8 = 0x3 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {85 00 00 00 2a 00 00 00 25 00 00 00 00 00 00 // 00 95 00 00 00 00 00 00 00 af cd 48 d6 49 4d 61 4d cc 6f ab 53 // 35 ec 47 0d b2 c6 16 1d ba 39 21 76 dd 29 63 03 8e 1d 69 ba 7e // a9 4c 50 0d c4 ef 2f ad 96 ed 40 6f 21 be f5 ad cf 92 05 69 c0 // 0c c1 19 96 84 fa 7c 93 83 6d 9e a2 cf b0 e6 04 36 e0 54 25 cc // 46 86 b0 66 70 7d e9 4a 4f 4d 5f c7 9c 98 7d 66 9f 38 1f ac a0 // f9 d9 b2 4b e4 1a 91 69 bd fa f1 6d a9 15 b2 e2 49 ee 1c 6e ee // 84 30 9e 7a 23 c1 9a 39 48 48 09 53 9f ca 4e 0b 6e ab 1a a7 d5 // 55 45 a3 4e ff a0 77 fa a5 6d 59 e8 82 54 f5 40 77 f7 99 bf 16 // 83 01 00 00 00 bf 22 55 d6 a0 24 4d 35 b2 13 bd a8 4c c1 72 af // d8 cc 2e 59 a7 d8 b8 5a 5e 3d 77 ac 46 39 20 e2 31 b7 ae 0d a8 // 61 6d 2b 79 58 f9 1f 5d a6 c0 25 d0 fa ab 18 6d 94 af 98 af 1d // a2 b5 95 2e b1 58 55 93 3a 21 23 04 e0 35 f7 a3 5d fc 72 c8 12 // 56 a5 5a 25 f8 fe 3b 28 d7 e5 3c 78 fb fe 5a b0 25 5f 34 71 60 // ec 83 07 00 00 00 00 00 00 40 15 cf 10 45 3f 6c 0b 97 3b 81 a4 // 84 eb ad 04 85 9d 92 83 65 a7 ea 3f ab 8b 4b 38 0a 00 d7 2b c0 // 48 0f 94 30 67 20 39 93 79 d9 27 1c f5 55 c1 4d 56 b5 1c 22 98 // 23 7b eb fc 08 e0 d5 97 6a 94 2b 84 69 70 cf d9 8b 9d 41 39 f1 // 11 1f 2d c5 e4 6a c1 c6 0a 9b 03 00 74 bf bc d4 b0 90 12 17 54 // 84 13 5f 0e 51 9f 0b 1e 4a aa 02 6d 57 0e cb 5e 8c dd be d6 5f // f7 02 00 00 00 a3 ff 4f 8a 4c f7 96 b0 7a 6f f6 1c 55 52 41 7f // d7 03 f7 f1 4d 8b 78 a6 02 ca 3c df 6a 91 20 07 2a 5d 00 dc dd // 85 95 35 6c 9b 24 92 aa f1 26 4d 4e f4 a4 10 c8 82 83 48 67 bc // d2 b6 e5 59 d1 78 79 57 0c 8a d9 43 32 69 af 3b e5 fa 6a 9a 5c // 24 e3 92 95 5f 4e 97 9e a1 32 01 ba fe 4f 0f 6e a5 08 00 00 00 // a0 c5 48 55 2b 57 1b ed 56 47 22 3c 78 a9 92 81 00 00 00 05 71 // cb b1 7d 9f 37 28 24 62 f0 e9 c1 47 c0 d4 97 c6 14 33 c6 cc c3 // 56 01 ee f9 7e e6 11 be 8c 97 f4 15 1f fd f6 f7 82 05 49 cd a6 // cb 79 9c 6e 92 49 66 a7 f9 0b f8 fd 1e 75 ee 76 bd 72 34 6c fb // b5 26 89 0a a7 fe 5e 68 94 9a 3b 30 56 7e 54 d3 50 47 23 17 7d // 35 6c 46 04 bc a4 92 ed e6 2f c2 88 39 b5 30 11 60 ec ec 37 e8 // 3e fc ee fd 7c a2 53 36 59 ed c8 be 05 cc 85 45 1c 6a 14 50 74 // 34 3c ae a5 c4 bf 69 04 41 97 4b 15 5f 5a dc 68 1a 03 c0 bb b8 // 35 88 56 17 5e 2c e8 b0 cb bb e3 c0 33 e5 4f fc eb de 1d 9d 3d // 35 a1 42 a9 ec 9a 7a 37 55 e0 f2 09 15 0a 07 68 2c 4e 14 e3 a8 // 35 70 1b ea 82 40 39 9c 56 ce 8f 58 df 6f 3f c9 7f 17 30 a1 36 // bd ee 07 e9 8c b9 84 b2 e2 30 4a 1b 63 af ef db 63 6e 56 bb aa // e4 e6 21 36 57 4b c6 37 1a 0b b2 be 1a 96 2a ae 9c 12 58 da 6e // f5 90 e1 d8 5e a9 e1 2b 30 25 f4 3e 7e 08 cc ff c5 06 4d ea 4c // 39 cf 4b 98 e1 fc 6e fb 59 78 f5 1e 16 b6 78 ec a0 b6 58 a5 60 // 08 94 8e 56 1a 98 45 e4 ff 29 e2 bd b1 d0 b9 23 b2 62 34 1c 5e // 09 3f d6 6a 29 46 50 15 59 33 57 81 09 2c f8 ce 3c 7c 56 cd 31 // 12 16 24 d7 65 17 fd 36 66 27 6c 3c 0e 81 2b 28 e2 f3 0d 03 5c // ee 5d 0e 77 a3 c7 00 08 ec 65 1c c0 ae 63 7f a4 74 81 6b c5 9d // 2e 2a 00 09 24 19 30 4b 33 8a 98 7e 9d 30 44 d8 56 cf 24 f3 70 // 03 0b e3 b5 f7 9f 03 0b 8d 3e bc e6 86 63 ef 5a f4 69 ab e7 53 // 31 4f ae 31 65 1e 0e ce a5 ec e8 fb 11 a4 ee 28 8e b1 49 f1 fa // 33 66 9c c8 d9 01 fa 8e 46 35 4c 9c 3a 04 1a 1e 7b 55 c4 e8 1d // ba 1e 12 28 9e e3 44 63 ba f2 83 45 bd e0 c1 95 bc 9f 02 1d a8 // f3 02 5e e9 c8 e3 16 8b 41 77 ce 37 ed 85 46 4c 31 67 90 53 e7 // f9 d0 4b b5 cb 51 da 0b 79 58 98 9f d7 0f 24 12 62 fa 3f 1d ab // eb 4f c4 bd a3 45 36 02 00 00 00 01 fb dd ea cd 3a da a4 d2 71 // 5e 21 c7 72 cc d4 43 41 f7 fd 53 df 58 ae 79 1e e8 b4 89 a7 c9 // ef e3 62 5a 9d 97 1b 59 97 48 5d 6a 06 3d c6 f7 35 9e 2e cc c2 // fb 39 d4 19 de 1a 7b 5c 9d c2 2c 96 29 5a 46 01 ad f5 9d 44 e5 // 8e b1 c6 0b 34 75 be 31 a9 b7 cf 42 b6 40 23 12 d2 72 5b 8d 9f // a7 00 a8 64 07 e7 9a e2 9d 2c 11 7c a6 5f c8 6c 2d ce 97 aa 03 // 27 9a 66 ec 87 12 22 19 b0 f7 96 ab 92 b1 ad ec ae 50 fd b4 08 // c8 a8 0f 7f 02 f7 50 d6 c9 77 a1 91 9f 9f 69 a6 cf ef df 87 9d // 44 7d f5 3f 3b 9b 70 d1 03 55 b0 74 66 d1 ef 00 56 b5 af 55 3d // 18 a6 cc 50 fe eb 7b fa d9 b7 be 32 83 b6 45 0d 01 4e 77 12 d2 // f1 d7 00 45 48 b1 91 62 ce f0 4d 18 d4 f5 98 7b aa b9 7a 9b fb // d8 f1 85 b5 67 18 20 42 0b f5 b6 52 2c 0e 21 c8 82 c6 6f 4f 25 // ff b6 d9 5e 07 de 02 20 5f ca 4f 18 a2 eb 5b 63 e4 5d 5d 80 fe // 52 73 40 93 ae 5a a3 c0 b4 f3 f4 5b ff f2 41 8a 18 21 77 47 ae // 44 2e 31 56 0e 5b 74 14 45 ea 2a 1a ce e2 e9 8c 9f 34 27 83 4b // a0 a7 65 d2 0b 30 f8 7a f9 76 a4 6f 9a 9a 1a c7 de a1 ea 68 45 // f9 aa 66 23 92 0d ac c1 07 f5 32 34 8c c2 11 64 ef e7 94 87 4e // ac 73 38 1e 96 1f 3d 9c 8c 21 57 8f e3 24 50 97 c2 80 ab e5 14 // 27 a7 f6 cd 72 b5 da 6d 02 52 80 3c 66 73 0c d5 ea c9 07 f0 9b // 96 95 90 63 13 f8 87 35 22 60 8c 6f c0 1e 1b 9e 16 58 7b b5 f7 // 21 30 3e 6b 89 e5 c5 4d 68 0a c6 6d 09 af 90 db f5 0e e6 9a 39 // 26 59 64 27 9d 17 eb 00 00 00 00 00 00 00 00 00 00 00 fa 08 ad // 07 31 c4 b8 39 68 8b 22 c4 da 2a 6b 00 00 8a 19 49 a6 ba 49 fb // f9 81 f8 26 5e 7f 1f 4c 2d 97 f4 68 0b 13 5f 87 c2 28 ce 69 41 // 8a 28 2b ff ff 24 81 a0 df 17 74 fa 7d 94 94 4b b9 2d 2b 89 f7 // 3f 0e 8b 63 f6 31 6c 57 62 f3 28 8b c9 70 72 0f 48 b5 64 7d d1 // 77 db 68 10 fa e0 53 34 d5 a4 4a 02 00 00 00 1c 0d 88 2a 56 4d // 74 a7 c7 2b f9 a2 15 2b 26 1e 58 fe a6 d2 f9 35 89 cf e2 61 dc // 04 10 b5 cc c9 2a 5a 0e ab 32 7a 33 43 1d 62 d2 b7 c7 5c e6 54 // d5 56 c9 e1 81 7c 1a bc a7 62 ab 53 d4 0d a5 15 60 35 1b 67 33 // 63 65 2e 1e cb 56 cf e4 a7 46 a4 5a b1 3c 60 14 e9 f3 61 ab 68 // 7d 1c d1 79 5c e9 e0 5c 81 7b 83 d7 60 46 bd b3 70 9d e5 df 74 // 99 a0 2d 2f 63 6a 45 4b 85 b9 87 58 0a da 02 5d 83 bd 7b 8d f2 // 8a 54 0d 5e c5 53 79 42 e7 9f 2f 1a b2 5e a5 f5 63 bc 77 e4 f9 // 46 8b d3 09 46 98 80 c7 e3 41 50 ca 88 6d 1f 9a c2 f7 e8 2d be // 29 6c 87 7d 92 5c 38 c5 4c c8 13 7b 29 02 88 54 b6 bd 57 ca 89 // 39 27 c3 31 30 0e 16 ab a7 92 28 9e 13 55 89 d9 33 02 fc 37 c7 // 3c 30 3e 38 3c df 8e f3 f6 d6 26 5f e5 ee 01 75 9d 24 02 74 75 // c8 90 10 39 a8 98 58 20 22 bc 95 99 2b 86 dc e0 71 08 87 c8 a6 // 25 d9 cb b8 97 bd bf af 49 a3 f6 42 a1 69 82 7a 9b ae 4f cf a5 // 21 24 61 db 00 00 00 00 00 00 e6 ed 75 ca 8f cd a7 ef 3e e3 36 // 18 9f ef 3b 3f fb 9f 38 fe fc 5f f3 9c 4e 69 e3 fa 1f 8b 10 ee // 97 12 3e 99 b6 1e ba 06 5b 1a d6 75 30 e7 c4 f1 1f 9d a7 ae 00 // 00 02 00 00 00 61 01 01 ad 7f 79 cb 9b bf 64 a0 fc 10 9f 49 fe // 87 99 fe 26 6e 2c ca c8 0f ef e7 50 15 1f 5d df e5 18 33 ec 65 // ec e7 0e 07 ce 8a b5 d9 7d b4 7d a8 f8 00 00 66 4d c0 b8 6a e2 // b3 ff 9d 4e 22 07 52 a6 b2 f3 ea 9f 79 36 12 38 64 96 dc a5 af // 7b 89 52 aa fa 79 6e a7 b1 56 d1 96 12 29 7c 63 bb 20 e1 e0 46 // 9f 76 15 f6 7a 92 18 cb ac e3 8f 52 36 82 13 14 f7 63 02 b9 8a // fa 93 04 4b 83 98 93 39 ca 10 e6 ae 30 e7 0e 17 a8 2f 03 e9 15 // b8 42 5e 8e 7a 91 61 43 06 d2 ae 0b c3 55 0d 85 6f 2d 72 93 67 // 2b 56 73 d2 64 fc 88 6b 0c 8b df 43 6a 0f cd 21 bf 9d a7 bd ca // 98 e3 4c d6 e5 9b 0a 7c e4 ba 1b 46 65 61 aa a3 54 48 df f4 7b // b1 d7 df 23 d4 67 68 9a 66 69 e4 30 0d 5a cf 12 e4 d0 b3 5a bf // 91 56 9f 60 5b 2f 6d f0 d8 61} (length 0x8a1) // } // } // } // license: ptr[in, buffer] { // buffer: {47 50 4c 00} (length 0x4) // } // loglev: int32 = 0x5 (4 bytes) // logsize: len = 0x252 (4 bytes) // log: ptr[out, buffer] { // buffer: (DirOut) // } // 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 = 0x48 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x200000000080 = 5; *(uint32_t*)0x200000000084 = 3; *(uint64_t*)0x200000000088 = 0x2000000001c0; memcpy( (void*)0x2000000001c0, "\x85\x00\x00\x00\x2a\x00\x00\x00\x25\x00\x00\x00\x00\x00\x00\x00\x95\x00" "\x00\x00\x00\x00\x00\x00\xaf\xcd\x48\xd6\x49\x4d\x61\x4d\xcc\x6f\xab\x53" "\x35\xec\x47\x0d\xb2\xc6\x16\x1d\xba\x39\x21\x76\xdd\x29\x63\x03\x8e\x1d" "\x69\xba\x7e\xa9\x4c\x50\x0d\xc4\xef\x2f\xad\x96\xed\x40\x6f\x21\xbe\xf5" "\xad\xcf\x92\x05\x69\xc0\x0c\xc1\x19\x96\x84\xfa\x7c\x93\x83\x6d\x9e\xa2" "\xcf\xb0\xe6\x04\x36\xe0\x54\x25\xcc\x46\x86\xb0\x66\x70\x7d\xe9\x4a\x4f" "\x4d\x5f\xc7\x9c\x98\x7d\x66\x9f\x38\x1f\xac\xa0\xf9\xd9\xb2\x4b\xe4\x1a" "\x91\x69\xbd\xfa\xf1\x6d\xa9\x15\xb2\xe2\x49\xee\x1c\x6e\xee\x84\x30\x9e" "\x7a\x23\xc1\x9a\x39\x48\x48\x09\x53\x9f\xca\x4e\x0b\x6e\xab\x1a\xa7\xd5" "\x55\x45\xa3\x4e\xff\xa0\x77\xfa\xa5\x6d\x59\xe8\x82\x54\xf5\x40\x77\xf7" "\x99\xbf\x16\x83\x01\x00\x00\x00\xbf\x22\x55\xd6\xa0\x24\x4d\x35\xb2\x13" "\xbd\xa8\x4c\xc1\x72\xaf\xd8\xcc\x2e\x59\xa7\xd8\xb8\x5a\x5e\x3d\x77\xac" "\x46\x39\x20\xe2\x31\xb7\xae\x0d\xa8\x61\x6d\x2b\x79\x58\xf9\x1f\x5d\xa6" "\xc0\x25\xd0\xfa\xab\x18\x6d\x94\xaf\x98\xaf\x1d\xa2\xb5\x95\x2e\xb1\x58" "\x55\x93\x3a\x21\x23\x04\xe0\x35\xf7\xa3\x5d\xfc\x72\xc8\x12\x56\xa5\x5a" "\x25\xf8\xfe\x3b\x28\xd7\xe5\x3c\x78\xfb\xfe\x5a\xb0\x25\x5f\x34\x71\x60" "\xec\x83\x07\x00\x00\x00\x00\x00\x00\x40\x15\xcf\x10\x45\x3f\x6c\x0b\x97" "\x3b\x81\xa4\x84\xeb\xad\x04\x85\x9d\x92\x83\x65\xa7\xea\x3f\xab\x8b\x4b" "\x38\x0a\x00\xd7\x2b\xc0\x48\x0f\x94\x30\x67\x20\x39\x93\x79\xd9\x27\x1c" "\xf5\x55\xc1\x4d\x56\xb5\x1c\x22\x98\x23\x7b\xeb\xfc\x08\xe0\xd5\x97\x6a" "\x94\x2b\x84\x69\x70\xcf\xd9\x8b\x9d\x41\x39\xf1\x11\x1f\x2d\xc5\xe4\x6a" "\xc1\xc6\x0a\x9b\x03\x00\x74\xbf\xbc\xd4\xb0\x90\x12\x17\x54\x84\x13\x5f" "\x0e\x51\x9f\x0b\x1e\x4a\xaa\x02\x6d\x57\x0e\xcb\x5e\x8c\xdd\xbe\xd6\x5f" "\xf7\x02\x00\x00\x00\xa3\xff\x4f\x8a\x4c\xf7\x96\xb0\x7a\x6f\xf6\x1c\x55" "\x52\x41\x7f\xd7\x03\xf7\xf1\x4d\x8b\x78\xa6\x02\xca\x3c\xdf\x6a\x91\x20" "\x07\x2a\x5d\x00\xdc\xdd\x85\x95\x35\x6c\x9b\x24\x92\xaa\xf1\x26\x4d\x4e" "\xf4\xa4\x10\xc8\x82\x83\x48\x67\xbc\xd2\xb6\xe5\x59\xd1\x78\x79\x57\x0c" "\x8a\xd9\x43\x32\x69\xaf\x3b\xe5\xfa\x6a\x9a\x5c\x24\xe3\x92\x95\x5f\x4e" "\x97\x9e\xa1\x32\x01\xba\xfe\x4f\x0f\x6e\xa5\x08\x00\x00\x00\xa0\xc5\x48" "\x55\x2b\x57\x1b\xed\x56\x47\x22\x3c\x78\xa9\x92\x81\x00\x00\x00\x05\x71" "\xcb\xb1\x7d\x9f\x37\x28\x24\x62\xf0\xe9\xc1\x47\xc0\xd4\x97\xc6\x14\x33" "\xc6\xcc\xc3\x56\x01\xee\xf9\x7e\xe6\x11\xbe\x8c\x97\xf4\x15\x1f\xfd\xf6" "\xf7\x82\x05\x49\xcd\xa6\xcb\x79\x9c\x6e\x92\x49\x66\xa7\xf9\x0b\xf8\xfd" "\x1e\x75\xee\x76\xbd\x72\x34\x6c\xfb\xb5\x26\x89\x0a\xa7\xfe\x5e\x68\x94" "\x9a\x3b\x30\x56\x7e\x54\xd3\x50\x47\x23\x17\x7d\x35\x6c\x46\x04\xbc\xa4" "\x92\xed\xe6\x2f\xc2\x88\x39\xb5\x30\x11\x60\xec\xec\x37\xe8\x3e\xfc\xee" "\xfd\x7c\xa2\x53\x36\x59\xed\xc8\xbe\x05\xcc\x85\x45\x1c\x6a\x14\x50\x74" "\x34\x3c\xae\xa5\xc4\xbf\x69\x04\x41\x97\x4b\x15\x5f\x5a\xdc\x68\x1a\x03" "\xc0\xbb\xb8\x35\x88\x56\x17\x5e\x2c\xe8\xb0\xcb\xbb\xe3\xc0\x33\xe5\x4f" "\xfc\xeb\xde\x1d\x9d\x3d\x35\xa1\x42\xa9\xec\x9a\x7a\x37\x55\xe0\xf2\x09" "\x15\x0a\x07\x68\x2c\x4e\x14\xe3\xa8\x35\x70\x1b\xea\x82\x40\x39\x9c\x56" "\xce\x8f\x58\xdf\x6f\x3f\xc9\x7f\x17\x30\xa1\x36\xbd\xee\x07\xe9\x8c\xb9" "\x84\xb2\xe2\x30\x4a\x1b\x63\xaf\xef\xdb\x63\x6e\x56\xbb\xaa\xe4\xe6\x21" "\x36\x57\x4b\xc6\x37\x1a\x0b\xb2\xbe\x1a\x96\x2a\xae\x9c\x12\x58\xda\x6e" "\xf5\x90\xe1\xd8\x5e\xa9\xe1\x2b\x30\x25\xf4\x3e\x7e\x08\xcc\xff\xc5\x06" "\x4d\xea\x4c\x39\xcf\x4b\x98\xe1\xfc\x6e\xfb\x59\x78\xf5\x1e\x16\xb6\x78" "\xec\xa0\xb6\x58\xa5\x60\x08\x94\x8e\x56\x1a\x98\x45\xe4\xff\x29\xe2\xbd" "\xb1\xd0\xb9\x23\xb2\x62\x34\x1c\x5e\x09\x3f\xd6\x6a\x29\x46\x50\x15\x59" "\x33\x57\x81\x09\x2c\xf8\xce\x3c\x7c\x56\xcd\x31\x12\x16\x24\xd7\x65\x17" "\xfd\x36\x66\x27\x6c\x3c\x0e\x81\x2b\x28\xe2\xf3\x0d\x03\x5c\xee\x5d\x0e" "\x77\xa3\xc7\x00\x08\xec\x65\x1c\xc0\xae\x63\x7f\xa4\x74\x81\x6b\xc5\x9d" "\x2e\x2a\x00\x09\x24\x19\x30\x4b\x33\x8a\x98\x7e\x9d\x30\x44\xd8\x56\xcf" "\x24\xf3\x70\x03\x0b\xe3\xb5\xf7\x9f\x03\x0b\x8d\x3e\xbc\xe6\x86\x63\xef" "\x5a\xf4\x69\xab\xe7\x53\x31\x4f\xae\x31\x65\x1e\x0e\xce\xa5\xec\xe8\xfb" "\x11\xa4\xee\x28\x8e\xb1\x49\xf1\xfa\x33\x66\x9c\xc8\xd9\x01\xfa\x8e\x46" "\x35\x4c\x9c\x3a\x04\x1a\x1e\x7b\x55\xc4\xe8\x1d\xba\x1e\x12\x28\x9e\xe3" "\x44\x63\xba\xf2\x83\x45\xbd\xe0\xc1\x95\xbc\x9f\x02\x1d\xa8\xf3\x02\x5e" "\xe9\xc8\xe3\x16\x8b\x41\x77\xce\x37\xed\x85\x46\x4c\x31\x67\x90\x53\xe7" "\xf9\xd0\x4b\xb5\xcb\x51\xda\x0b\x79\x58\x98\x9f\xd7\x0f\x24\x12\x62\xfa" "\x3f\x1d\xab\xeb\x4f\xc4\xbd\xa3\x45\x36\x02\x00\x00\x00\x01\xfb\xdd\xea" "\xcd\x3a\xda\xa4\xd2\x71\x5e\x21\xc7\x72\xcc\xd4\x43\x41\xf7\xfd\x53\xdf" "\x58\xae\x79\x1e\xe8\xb4\x89\xa7\xc9\xef\xe3\x62\x5a\x9d\x97\x1b\x59\x97" "\x48\x5d\x6a\x06\x3d\xc6\xf7\x35\x9e\x2e\xcc\xc2\xfb\x39\xd4\x19\xde\x1a" "\x7b\x5c\x9d\xc2\x2c\x96\x29\x5a\x46\x01\xad\xf5\x9d\x44\xe5\x8e\xb1\xc6" "\x0b\x34\x75\xbe\x31\xa9\xb7\xcf\x42\xb6\x40\x23\x12\xd2\x72\x5b\x8d\x9f" "\xa7\x00\xa8\x64\x07\xe7\x9a\xe2\x9d\x2c\x11\x7c\xa6\x5f\xc8\x6c\x2d\xce" "\x97\xaa\x03\x27\x9a\x66\xec\x87\x12\x22\x19\xb0\xf7\x96\xab\x92\xb1\xad" "\xec\xae\x50\xfd\xb4\x08\xc8\xa8\x0f\x7f\x02\xf7\x50\xd6\xc9\x77\xa1\x91" "\x9f\x9f\x69\xa6\xcf\xef\xdf\x87\x9d\x44\x7d\xf5\x3f\x3b\x9b\x70\xd1\x03" "\x55\xb0\x74\x66\xd1\xef\x00\x56\xb5\xaf\x55\x3d\x18\xa6\xcc\x50\xfe\xeb" "\x7b\xfa\xd9\xb7\xbe\x32\x83\xb6\x45\x0d\x01\x4e\x77\x12\xd2\xf1\xd7\x00" "\x45\x48\xb1\x91\x62\xce\xf0\x4d\x18\xd4\xf5\x98\x7b\xaa\xb9\x7a\x9b\xfb" "\xd8\xf1\x85\xb5\x67\x18\x20\x42\x0b\xf5\xb6\x52\x2c\x0e\x21\xc8\x82\xc6" "\x6f\x4f\x25\xff\xb6\xd9\x5e\x07\xde\x02\x20\x5f\xca\x4f\x18\xa2\xeb\x5b" "\x63\xe4\x5d\x5d\x80\xfe\x52\x73\x40\x93\xae\x5a\xa3\xc0\xb4\xf3\xf4\x5b" "\xff\xf2\x41\x8a\x18\x21\x77\x47\xae\x44\x2e\x31\x56\x0e\x5b\x74\x14\x45" "\xea\x2a\x1a\xce\xe2\xe9\x8c\x9f\x34\x27\x83\x4b\xa0\xa7\x65\xd2\x0b\x30" "\xf8\x7a\xf9\x76\xa4\x6f\x9a\x9a\x1a\xc7\xde\xa1\xea\x68\x45\xf9\xaa\x66" "\x23\x92\x0d\xac\xc1\x07\xf5\x32\x34\x8c\xc2\x11\x64\xef\xe7\x94\x87\x4e" "\xac\x73\x38\x1e\x96\x1f\x3d\x9c\x8c\x21\x57\x8f\xe3\x24\x50\x97\xc2\x80" "\xab\xe5\x14\x27\xa7\xf6\xcd\x72\xb5\xda\x6d\x02\x52\x80\x3c\x66\x73\x0c" "\xd5\xea\xc9\x07\xf0\x9b\x96\x95\x90\x63\x13\xf8\x87\x35\x22\x60\x8c\x6f" "\xc0\x1e\x1b\x9e\x16\x58\x7b\xb5\xf7\x21\x30\x3e\x6b\x89\xe5\xc5\x4d\x68" "\x0a\xc6\x6d\x09\xaf\x90\xdb\xf5\x0e\xe6\x9a\x39\x26\x59\x64\x27\x9d\x17" "\xeb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfa\x08\xad\x07\x31\xc4" "\xb8\x39\x68\x8b\x22\xc4\xda\x2a\x6b\x00\x00\x8a\x19\x49\xa6\xba\x49\xfb" "\xf9\x81\xf8\x26\x5e\x7f\x1f\x4c\x2d\x97\xf4\x68\x0b\x13\x5f\x87\xc2\x28" "\xce\x69\x41\x8a\x28\x2b\xff\xff\x24\x81\xa0\xdf\x17\x74\xfa\x7d\x94\x94" "\x4b\xb9\x2d\x2b\x89\xf7\x3f\x0e\x8b\x63\xf6\x31\x6c\x57\x62\xf3\x28\x8b" "\xc9\x70\x72\x0f\x48\xb5\x64\x7d\xd1\x77\xdb\x68\x10\xfa\xe0\x53\x34\xd5" "\xa4\x4a\x02\x00\x00\x00\x1c\x0d\x88\x2a\x56\x4d\x74\xa7\xc7\x2b\xf9\xa2" "\x15\x2b\x26\x1e\x58\xfe\xa6\xd2\xf9\x35\x89\xcf\xe2\x61\xdc\x04\x10\xb5" "\xcc\xc9\x2a\x5a\x0e\xab\x32\x7a\x33\x43\x1d\x62\xd2\xb7\xc7\x5c\xe6\x54" "\xd5\x56\xc9\xe1\x81\x7c\x1a\xbc\xa7\x62\xab\x53\xd4\x0d\xa5\x15\x60\x35" "\x1b\x67\x33\x63\x65\x2e\x1e\xcb\x56\xcf\xe4\xa7\x46\xa4\x5a\xb1\x3c\x60" "\x14\xe9\xf3\x61\xab\x68\x7d\x1c\xd1\x79\x5c\xe9\xe0\x5c\x81\x7b\x83\xd7" "\x60\x46\xbd\xb3\x70\x9d\xe5\xdf\x74\x99\xa0\x2d\x2f\x63\x6a\x45\x4b\x85" "\xb9\x87\x58\x0a\xda\x02\x5d\x83\xbd\x7b\x8d\xf2\x8a\x54\x0d\x5e\xc5\x53" "\x79\x42\xe7\x9f\x2f\x1a\xb2\x5e\xa5\xf5\x63\xbc\x77\xe4\xf9\x46\x8b\xd3" "\x09\x46\x98\x80\xc7\xe3\x41\x50\xca\x88\x6d\x1f\x9a\xc2\xf7\xe8\x2d\xbe" "\x29\x6c\x87\x7d\x92\x5c\x38\xc5\x4c\xc8\x13\x7b\x29\x02\x88\x54\xb6\xbd" "\x57\xca\x89\x39\x27\xc3\x31\x30\x0e\x16\xab\xa7\x92\x28\x9e\x13\x55\x89" "\xd9\x33\x02\xfc\x37\xc7\x3c\x30\x3e\x38\x3c\xdf\x8e\xf3\xf6\xd6\x26\x5f" "\xe5\xee\x01\x75\x9d\x24\x02\x74\x75\xc8\x90\x10\x39\xa8\x98\x58\x20\x22" "\xbc\x95\x99\x2b\x86\xdc\xe0\x71\x08\x87\xc8\xa6\x25\xd9\xcb\xb8\x97\xbd" "\xbf\xaf\x49\xa3\xf6\x42\xa1\x69\x82\x7a\x9b\xae\x4f\xcf\xa5\x21\x24\x61" "\xdb\x00\x00\x00\x00\x00\x00\xe6\xed\x75\xca\x8f\xcd\xa7\xef\x3e\xe3\x36" "\x18\x9f\xef\x3b\x3f\xfb\x9f\x38\xfe\xfc\x5f\xf3\x9c\x4e\x69\xe3\xfa\x1f" "\x8b\x10\xee\x97\x12\x3e\x99\xb6\x1e\xba\x06\x5b\x1a\xd6\x75\x30\xe7\xc4" "\xf1\x1f\x9d\xa7\xae\x00\x00\x02\x00\x00\x00\x61\x01\x01\xad\x7f\x79\xcb" "\x9b\xbf\x64\xa0\xfc\x10\x9f\x49\xfe\x87\x99\xfe\x26\x6e\x2c\xca\xc8\x0f" "\xef\xe7\x50\x15\x1f\x5d\xdf\xe5\x18\x33\xec\x65\xec\xe7\x0e\x07\xce\x8a" "\xb5\xd9\x7d\xb4\x7d\xa8\xf8\x00\x00\x66\x4d\xc0\xb8\x6a\xe2\xb3\xff\x9d" "\x4e\x22\x07\x52\xa6\xb2\xf3\xea\x9f\x79\x36\x12\x38\x64\x96\xdc\xa5\xaf" "\x7b\x89\x52\xaa\xfa\x79\x6e\xa7\xb1\x56\xd1\x96\x12\x29\x7c\x63\xbb\x20" "\xe1\xe0\x46\x9f\x76\x15\xf6\x7a\x92\x18\xcb\xac\xe3\x8f\x52\x36\x82\x13" "\x14\xf7\x63\x02\xb9\x8a\xfa\x93\x04\x4b\x83\x98\x93\x39\xca\x10\xe6\xae" "\x30\xe7\x0e\x17\xa8\x2f\x03\xe9\x15\xb8\x42\x5e\x8e\x7a\x91\x61\x43\x06" "\xd2\xae\x0b\xc3\x55\x0d\x85\x6f\x2d\x72\x93\x67\x2b\x56\x73\xd2\x64\xfc" "\x88\x6b\x0c\x8b\xdf\x43\x6a\x0f\xcd\x21\xbf\x9d\xa7\xbd\xca\x98\xe3\x4c" "\xd6\xe5\x9b\x0a\x7c\xe4\xba\x1b\x46\x65\x61\xaa\xa3\x54\x48\xdf\xf4\x7b" "\xb1\xd7\xdf\x23\xd4\x67\x68\x9a\x66\x69\xe4\x30\x0d\x5a\xcf\x12\xe4\xd0" "\xb3\x5a\xbf\x91\x56\x9f\x60\x5b\x2f\x6d\xf0\xd8\x61", 2209); *(uint64_t*)0x200000000090 = 0x200000000000; memcpy((void*)0x200000000000, "GPL\000", 4); *(uint32_t*)0x200000000098 = 5; *(uint32_t*)0x20000000009c = 0x252; *(uint64_t*)0x2000000000a0 = 0x20000000cf3d; *(uint32_t*)0x2000000000a8 = 0; *(uint32_t*)0x2000000000ac = 0; memset((void*)0x2000000000b0, 0, 16); *(uint32_t*)0x2000000000c0 = 0; *(uint32_t*)0x2000000000c4 = 0; *(uint32_t*)0x2000000000c8 = -1; *(uint32_t*)0x2000000000cc = 8; *(uint64_t*)0x2000000000d0 = 0; *(uint32_t*)0x2000000000d8 = 0; *(uint32_t*)0x2000000000dc = 0x10; *(uint64_t*)0x2000000000e0 = 0; *(uint32_t*)0x2000000000e8 = 0; *(uint32_t*)0x2000000000ec = 0; *(uint32_t*)0x2000000000f0 = -1; *(uint32_t*)0x2000000000f4 = 0; *(uint64_t*)0x2000000000f8 = 0; *(uint64_t*)0x200000000100 = 0; *(uint32_t*)0x200000000108 = 0x10; *(uint32_t*)0x20000000010c = 0; *(uint32_t*)0x200000000110 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000080ul, /*size=*/0x48ul); if (res != -1) r[1] = res; // ioctl$PERF_EVENT_IOC_SET_BPF arguments: [ // fd: fd_perf (resource) // cmd: const = 0x40042408 (4 bytes) // prog: fd_bpf_prog (resource) // ] syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x40042408, /*prog=*/r[1]); } 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; for (procid = 0; procid < 5; procid++) { if (fork() == 0) { loop(); } } sleep(1000000); return 0; }