// https://syzkaller.appspot.com/bug?id=fac5f2b27f118ee8e46803569b944e47f1a65b77 // 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[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)) { } *(uint32_t*)0x200009c0 = 0x1b; *(uint32_t*)0x200009c4 = 0; *(uint32_t*)0x200009c8 = 0; *(uint32_t*)0x200009cc = 0x40000; *(uint32_t*)0x200009d0 = 0; *(uint32_t*)0x200009d4 = 0; *(uint32_t*)0x200009d8 = 0; memset((void*)0x200009dc, 0, 16); *(uint32_t*)0x200009ec = 0; *(uint32_t*)0x200009f0 = 0; *(uint32_t*)0x200009f4 = 0; *(uint32_t*)0x200009f8 = 0; *(uint32_t*)0x200009fc = 0; *(uint64_t*)0x20000a00 = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200009c0ul, /*size=*/0x48ul); if (res != -1) r[0] = res; *(uint32_t*)0x20000b00 = 0x11; *(uint32_t*)0x20000b04 = 0xf; *(uint64_t*)0x20000b08 = 0x20000340; *(uint8_t*)0x20000340 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000341, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000341, 0, 4, 4); *(uint16_t*)0x20000342 = 0; *(uint32_t*)0x20000344 = 0; *(uint8_t*)0x20000348 = 0; *(uint8_t*)0x20000349 = 0; *(uint16_t*)0x2000034a = 0; *(uint32_t*)0x2000034c = 0; *(uint8_t*)0x20000350 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000351, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000351, 1, 4, 4); *(uint16_t*)0x20000352 = 0; *(uint32_t*)0x20000354 = r[0]; *(uint8_t*)0x20000358 = 0; *(uint8_t*)0x20000359 = 0; *(uint16_t*)0x2000035a = 0; *(uint32_t*)0x2000035c = 0; STORE_BY_BITMASK(uint8_t, , 0x20000360, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000360, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000360, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000361, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000361, 0, 4, 4); *(uint16_t*)0x20000362 = 0; *(uint32_t*)0x20000364 = 0x14; STORE_BY_BITMASK(uint8_t, , 0x20000368, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000368, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000368, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000369, 3, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000369, 0, 4, 4); *(uint16_t*)0x2000036a = 0; *(uint32_t*)0x2000036c = 0; *(uint8_t*)0x20000370 = 0x85; *(uint8_t*)0x20000371 = 0; *(uint16_t*)0x20000372 = 0; *(uint32_t*)0x20000374 = 0x83; STORE_BY_BITMASK(uint8_t, , 0x20000378, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000378, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000378, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000379, 9, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000379, 0, 4, 4); *(uint16_t*)0x2000037a = 0; *(uint32_t*)0x2000037c = 0; STORE_BY_BITMASK(uint8_t, , 0x20000380, 5, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000380, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000380, 5, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000381, 9, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000381, 0, 4, 4); *(uint16_t*)0x20000382 = 1; *(uint32_t*)0x20000384 = 0; *(uint8_t*)0x20000388 = 0x95; *(uint8_t*)0x20000389 = 0; *(uint16_t*)0x2000038a = 0; *(uint32_t*)0x2000038c = 0; STORE_BY_BITMASK(uint8_t, , 0x20000390, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000390, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000390, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000391, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000391, 9, 4, 4); *(uint16_t*)0x20000392 = 0; *(uint32_t*)0x20000394 = 0; STORE_BY_BITMASK(uint8_t, , 0x20000398, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000398, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000398, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000399, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000399, 0, 4, 4); *(uint16_t*)0x2000039a = 0; *(uint32_t*)0x2000039c = 0; *(uint8_t*)0x200003a0 = 0x85; *(uint8_t*)0x200003a1 = 0; *(uint16_t*)0x200003a2 = 0; *(uint32_t*)0x200003a4 = 0x85; STORE_BY_BITMASK(uint8_t, , 0x200003a8, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200003a8, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200003a8, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200003a9, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200003a9, 0, 4, 4); *(uint16_t*)0x200003aa = 0; *(uint32_t*)0x200003ac = 0; *(uint8_t*)0x200003b0 = 0x95; *(uint8_t*)0x200003b1 = 0; *(uint16_t*)0x200003b2 = 0; *(uint32_t*)0x200003b4 = 0; *(uint64_t*)0x20000b10 = 0x20000080; memcpy((void*)0x20000080, "GPL\000", 4); *(uint32_t*)0x20000b18 = 0; *(uint32_t*)0x20000b1c = 0; *(uint64_t*)0x20000b20 = 0; *(uint32_t*)0x20000b28 = 0; *(uint32_t*)0x20000b2c = 0; memset((void*)0x20000b30, 0, 16); *(uint32_t*)0x20000b40 = 0; *(uint32_t*)0x20000b44 = 0; *(uint32_t*)0x20000b48 = 0; *(uint32_t*)0x20000b4c = 0; *(uint64_t*)0x20000b50 = 0; *(uint32_t*)0x20000b58 = 0; *(uint32_t*)0x20000b5c = 0; *(uint64_t*)0x20000b60 = 0; *(uint32_t*)0x20000b68 = 0; *(uint32_t*)0x20000b6c = 0; *(uint32_t*)0x20000b70 = 0; *(uint32_t*)0x20000b74 = 0; *(uint64_t*)0x20000b78 = 0; *(uint64_t*)0x20000b80 = 0; *(uint32_t*)0x20000b88 = 0; *(uint32_t*)0x20000b8c = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x20000b00ul, /*size=*/0x90ul); if (res != -1) r[1] = res; *(uint64_t*)0x20000000 = 0x20000040; memcpy((void*)0x20000040, "kfree\000", 6); *(uint32_t*)0x20000008 = r[1]; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x20000000ul, /*size=*/0x10ul); *(uint32_t*)0x20000500 = 2; *(uint32_t*)0x20000504 = 0x80; *(uint8_t*)0x20000508 = 0xed; *(uint8_t*)0x20000509 = 0; *(uint8_t*)0x2000050a = 0; *(uint8_t*)0x2000050b = 0; *(uint32_t*)0x2000050c = 0; *(uint64_t*)0x20000510 = 0; *(uint64_t*)0x20000518 = 0; *(uint64_t*)0x20000520 = 0; STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 0, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 1, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 2, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 3, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 4, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 5, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 6, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 7, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 8, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 9, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 10, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 11, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 12, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 13, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 14, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 15, 2); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 17, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 18, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 19, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 20, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 21, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 22, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 23, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 24, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 25, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 26, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 27, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 28, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 29, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 30, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 31, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 32, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 33, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 34, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 35, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 36, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 37, 1); STORE_BY_BITMASK(uint64_t, , 0x20000528, 0, 38, 26); *(uint32_t*)0x20000530 = 0; *(uint32_t*)0x20000534 = 0; *(uint64_t*)0x20000538 = 0; *(uint64_t*)0x20000540 = 0; *(uint64_t*)0x20000548 = 0; *(uint64_t*)0x20000550 = 0; *(uint32_t*)0x20000558 = 0; *(uint32_t*)0x2000055c = 0; *(uint64_t*)0x20000560 = 0; *(uint32_t*)0x20000568 = 0; *(uint16_t*)0x2000056c = 0; *(uint16_t*)0x2000056e = 0; *(uint32_t*)0x20000570 = 0; *(uint32_t*)0x20000574 = 0; *(uint64_t*)0x20000578 = 0; res = syscall(__NR_perf_event_open, /*attr=*/0x20000500ul, /*pid=*/0, /*cpu=*/0ul, /*group=*/-1, /*flags=*/0ul); if (res != -1) r[2] = res; *(uint32_t*)0x200000c0 = 0x1b; *(uint32_t*)0x200000c4 = 0; *(uint32_t*)0x200000c8 = 0; *(uint32_t*)0x200000cc = 0x8000; *(uint32_t*)0x200000d0 = 0; *(uint32_t*)0x200000d4 = -1; *(uint32_t*)0x200000d8 = 0; memset((void*)0x200000dc, 0, 16); *(uint32_t*)0x200000ec = 0; *(uint32_t*)0x200000f0 = -1; *(uint32_t*)0x200000f4 = 0; *(uint32_t*)0x200000f8 = 0; *(uint32_t*)0x200000fc = 0; *(uint64_t*)0x20000100 = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200000c0ul, /*size=*/0x48ul); if (res != -1) r[3] = res; *(uint32_t*)0x200003c0 = 5; *(uint32_t*)0x200003c4 = 0xc; *(uint64_t*)0x200003c8 = 0x200002c0; *(uint8_t*)0x200002c0 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200002c1, 4, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200002c1, 0, 4, 4); *(uint16_t*)0x200002c2 = 0; *(uint32_t*)0x200002c4 = 0; *(uint8_t*)0x200002c8 = 0; *(uint8_t*)0x200002c9 = 0; *(uint16_t*)0x200002ca = 0; *(uint32_t*)0x200002cc = 0; *(uint8_t*)0x200002d0 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200002d1, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200002d1, 1, 4, 4); *(uint16_t*)0x200002d2 = 0; *(uint32_t*)0x200002d4 = r[3]; *(uint8_t*)0x200002d8 = 0; *(uint8_t*)0x200002d9 = 0; *(uint16_t*)0x200002da = 0; *(uint32_t*)0x200002dc = 0; STORE_BY_BITMASK(uint8_t, , 0x200002e0, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200002e0, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200002e0, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200002e1, 8, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200002e1, 0, 4, 4); *(uint16_t*)0x200002e2 = 0; *(uint32_t*)0x200002e4 = 0; STORE_BY_BITMASK(uint8_t, , 0x200002e8, 3, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200002e8, 3, 3, 2); STORE_BY_BITMASK(uint8_t, , 0x200002e8, 3, 5, 3); STORE_BY_BITMASK(uint8_t, , 0x200002e9, 0xa, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200002e9, 8, 4, 4); *(uint16_t*)0x200002ea = 0xfff8; *(uint32_t*)0x200002ec = 0; STORE_BY_BITMASK(uint8_t, , 0x200002f0, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200002f0, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200002f0, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200002f1, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200002f1, 0xa, 4, 4); *(uint16_t*)0x200002f2 = 0; *(uint32_t*)0x200002f4 = 0; STORE_BY_BITMASK(uint8_t, , 0x200002f8, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200002f8, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200002f8, 0, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200002f9, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200002f9, 0, 4, 4); *(uint16_t*)0x200002fa = 0; *(uint32_t*)0x200002fc = 0xfffffff8; STORE_BY_BITMASK(uint8_t, , 0x20000300, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000300, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000300, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000301, 3, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000301, 0, 4, 4); *(uint16_t*)0x20000302 = 0; *(uint32_t*)0x20000304 = 8; STORE_BY_BITMASK(uint8_t, , 0x20000308, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000308, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000308, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000309, 4, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000309, 0, 4, 4); *(uint16_t*)0x2000030a = 0; *(uint32_t*)0x2000030c = 0; *(uint8_t*)0x20000310 = 0x85; *(uint8_t*)0x20000311 = 0; *(uint16_t*)0x20000312 = 0; *(uint32_t*)0x20000314 = 0x82; *(uint8_t*)0x20000318 = 0x95; *(uint8_t*)0x20000319 = 0; *(uint16_t*)0x2000031a = 0; *(uint32_t*)0x2000031c = 0; *(uint64_t*)0x200003d0 = 0x200005c0; memcpy((void*)0x200005c0, "GPL\000", 4); *(uint32_t*)0x200003d8 = 0; *(uint32_t*)0x200003dc = 0; *(uint64_t*)0x200003e0 = 0; *(uint32_t*)0x200003e8 = 0; *(uint32_t*)0x200003ec = 0; memset((void*)0x200003f0, 0, 16); *(uint32_t*)0x20000400 = 0; *(uint32_t*)0x20000404 = 0x25; *(uint32_t*)0x20000408 = -1; *(uint32_t*)0x2000040c = 8; *(uint64_t*)0x20000410 = 0; *(uint32_t*)0x20000418 = 0; *(uint32_t*)0x2000041c = 0x10; *(uint64_t*)0x20000420 = 0; *(uint32_t*)0x20000428 = 0; *(uint32_t*)0x2000042c = 0; *(uint32_t*)0x20000430 = 0; *(uint32_t*)0x20000434 = 0; *(uint64_t*)0x20000438 = 0; *(uint64_t*)0x20000440 = 0; *(uint32_t*)0x20000448 = 0x10; *(uint32_t*)0x2000044c = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200003c0ul, /*size=*/0x90ul); if (res != -1) r[4] = res; syscall(__NR_ioctl, /*fd=*/r[2], /*cmd=*/0x40042408, /*prog=*/r[4]); *(uint32_t*)0x20000200 = 0x18; *(uint32_t*)0x20000204 = 4; *(uint64_t*)0x20000208 = 0x200002c0; memcpy((void*)0x200002c0, "\x18\x01\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x85" "\x00\x00\x00\x6d\x00\x00\x00\x95", 25); *(uint64_t*)0x20000210 = 0x20000100; memcpy((void*)0x20000100, "GPL\000", 4); *(uint32_t*)0x20000218 = 0; *(uint32_t*)0x2000021c = 0; *(uint64_t*)0x20000220 = 0; *(uint32_t*)0x20000228 = 0; *(uint32_t*)0x2000022c = 0; memset((void*)0x20000230, 0, 16); *(uint32_t*)0x20000240 = 0; *(uint32_t*)0x20000244 = 2; *(uint32_t*)0x20000248 = -1; *(uint32_t*)0x2000024c = 8; *(uint64_t*)0x20000250 = 0; *(uint32_t*)0x20000258 = 0; *(uint32_t*)0x2000025c = 0x10; *(uint64_t*)0x20000260 = 0; *(uint32_t*)0x20000268 = 0; *(uint32_t*)0x2000026c = 0; *(uint32_t*)0x20000270 = 0; *(uint32_t*)0x20000274 = 0; *(uint64_t*)0x20000278 = 0; *(uint64_t*)0x20000280 = 0; *(uint32_t*)0x20000288 = 0x10; *(uint32_t*)0x2000028c = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x20000200ul, /*size=*/0x80ul); if (res != -1) r[5] = res; *(uint64_t*)0x20000080 = 0x20000140; memcpy((void*)0x20000140, "contention_end\000", 15); *(uint32_t*)0x20000088 = r[5]; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x20000080ul, /*size=*/0x10ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; for (procid = 0; procid < 5; procid++) { if (fork() == 0) { loop(); } } sleep(1000000); return 0; }