// 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 #ifndef __NR_bpf #define __NR_bpf 280 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_openat #define __NR_openat 56 #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; } 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)) { } // 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*)0x20000240 = 0; *(uint32_t*)0x20000244 = -1; *(uint32_t*)0x20000248 = 0; *(uint32_t*)0x2000024c = 7; *(uint64_t*)0x20000250 = 0x20000000; memcpy((void*)0x20000000, "cgroup\000", 7); syscall(__NR_bpf, /*cmd=*/0x14ul, /*arg=*/0x20000240ul, /*size=*/0x30ul); // 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=*/0x20000000ul, /*flags=*/0x200002, /*mode=*/0); 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 = 0x9 (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 61 12 00 00 00 00 00 00 95 00 00 00 00 00 00 00 51 fa 78 24 // c7 41 86 dc 02 ec 06 96 c3 7b 64 e3 b2 4d a3 18 01 00 00 00 05 // 16 5c 0f 63 cd c2 e8 28 18 25 49 50 ee 03 56 8b 88 09 a1 ff 4c // 7c 47 50 ea bf af cb 95 31 b3 1e 6a 86 82 7d 10 10 c5 a9 09 ab // 98 e0 0e 19 64 4a 88 e9 5b a2 6d 1c 9e ec dd b2 d1 1c 54 14 18 // ce eb 29 b9 b6 82 9c 6e 43 38 22 bd b3 cc 85 24 4a ab 60 c1 aa // e1 31 4d 73 81 fc fe b9 70 be a6 72 cf 1e 92 6f 6a 51 47 93 43 // 14 46 48 a0 7a 97 5b d8 9d c3 98 71 23 76 61 0f 62 54 f1 24 95 // b4 65 83 19 68 43 87 f6 f3 54 32 05 d4 bc 4c e0 5b 8b 96 11 03 // 67 3d ff 7f 15 80 52 e6 2b 20 f0 5f d2 41 08 d8 36 3d 44 fc d0 // f8 f3 64 78 99 76 2a 17 28 2a 19 14 45 2d 11 f5 57 c2 8f 39 6e // eb dc 85 85 58 db 02 76 d1 4f 90 35 f2 b5 f7 03 e5 be 7e 4a cf // 8b 78 c2 83 4a e5 80 5f ff ee 38 a9 a0 03 3d 52 0b cf 6b 08 ed // e5 08 99 d4 b9 bd f8 5c 71 c5 de 25 03 da b3 58 f4 2a 26 24 c7 // da a9 ed 44 03 9a ab 46 41 94 96 36 2e 54 cf ad 05 a0 00 4a c7 // 1a 00 3d 7b 85 d0 71 91 be d4 e5 a8 90 82 63 00 21 41 46 f7 ed // 56 99 85 43 9b aa 35 5c 27 66 dd 05 6f 5d 79 e4 54 f3 d8 73 09 // 5e 7a 23 7b c0 6d 03 5a 8d 60 1f 21 74 6d 88 64 19 f3 8b 34 a4 // 95 04 00 00 00 00 71 c2 f0 cc e8 c9 3c c1 7e 9a fa 31 4f cb 2b // a1 5d 64 6c 66 b0 f6 50 21 82 9f 87 d9 88 b4 e2 d7 17 53 b1 54 // 9f a7 34 f0 b2 e5 6d bd 21 ed 2e 09 d0 cd da d7 21 97 16 37 f3 // 84 ee d3 03 45 97 c9 3e 1c 52 f4 2c ad 0e d0 9c 39 5d c6 e9 70 // 36 60 fe fa 1c 80 f4 67 36 7c 00 6f 25 ca f0 cb ce fd 13 d6 88 // 39 89 3e 39 c5 88 eb 03 29 05 f9 1c af a4 99 6d bf 0c 9b e9 65 // 4d b0 5f b9 18 08 6c c8 22 8d 02 a3 09 2c 08 30 b8 f5 87 a5 62 // 45 15 29 8b 2d 4e b2 bd e6 f9 a2 eb 83 d5 3f 71 7f 13 fa 75 52 // d9 2c 51 db d3 2e a5 0c 49 0e cd 08 5d 28 11 a7 55 5c 53 8c ff // ff ff 7f 00 00 00 00 dd 87 22 44 bf a6 47 79 e0 f4 3a 9c 27 7e // 29 10 b7 cc dc 3d 67 26 d3 4a d2 10 10 33 a6 23 ca 2a 49 ad 34 // 48 84 28 91 30 bc 71 ce e2 b7 de 62 bf 48 12 9a e1 af 05 2a 2d // 46 a6 16 25 73 5a 9e ea 7f 79 39 46 b3 22 9e 86 1d 8e a4 98 06 // b3 f7 d4 29 5f 6b 00 00 00 00 00 00 f3 37 b1 ce b2 d8 a6 5d cd // cd 89 5d 7b a3 70 98 d2 59 3f da ae f4 45 af 5b ee 02 01 9c 00 // 00 00 99 b1 3e cd a2 a5 b3 7d e0 51 9e 97 4c ba 92 eb af 0f 70 // 16 11 a9 b0 27 ce 04 34 0b da 45 94 cc 90 49 c3 f1 01 62 9a b0 // 28 14 5e 00 42 09 eb e7 1a 6f e8 4a f5 08 04 00 00 00 00 00 00 // 00 4a 27 21 33 54 96 4e 25 0a 98 fe 35 76 76 f9 4b 69 47 38 3e // 32 0f bb 11 18 f5 86 d5 b9 b1 b9 77 e1 e1 a4 49 0f f6 77 03 a9 // b5 90 0f 8a 6f 8a 80 58 79 dd 91 ec 5f f4 35 b2 19 c5 36 80 c0 // ae 04 dc c4 ef 69 b9 8f cb 0d 6b 6a 03 a8 b7 1a 66 b4 e2 87 6d // c4 b6 10 44 4b f1 00 00 00 00 00 b0 46 b6 ae 5d 68 15 6b cb d6 // d8 79 3a de 9a 22 ac 8f c7 85 7e 5b bc 14 ad c4 e1 2b 08 f3 50 // c6 78 92 83 b9 99 0c 72 e6 43 72 a1 f7 97 69 a8 bd c6 32 fc 1a // 0b 34 17 85 5d 8b 7d 25 ca 4d 40 4c 23 63 1a d3 d2 f5 5d cd 38 // 53 71 c8 61 70 a4 bc a5 8c 2b 2b 4e ab c3 65 f4 5b d1 0b b4 5b // 0c 5b c3 54 45 6a 52 be 18 d9 b4 40 14 d2 0a 3c 51 c8 f0 13 da // de 83 56 2e 73 27 86 62 82 9e 4f 5a 9a c0 0f d9 11 78 46 8c 73 // 7f 08 72 d9 7d 38 d1 1a 17 6b e5 a0 d7 29 4c 51 eb 16 1e dd cf // ef a8 83 7c 74 30 72 18 51 ec 2a 10 7a f0 df 6d 43 e7 32 bb c0 // 1e 76 c6 68 95 eb 85 d3 67 98 d6 16 22 77 35 91 ee 21 ad 9f 6a // 1b 73 fa 9c f3 ff eb 8a 00 b6 3a f8 00 a8 1d 0f b8 aa 29 df 8b // 8a d6 fb af ef b5 80 2a 23 cb de ea bc ed a5 bf c5 ff 2f a5 c1 // d6 1d 04 a1 32 47 94 c6 ed 00 06 96 d9 f0 40 10 c3 54 74 e6 90 // 54 5c 3d 9b d8 36 d4 ce f2 58 5b a6 16 e0 1c 3d 00 00 00 00 00 // 00 00 00 00 47 0e bc 6f 34 53 ec bf 30 47 e4 54 7d 76 32 d3 ad // 21 79 8e 73 0c b5 d1 da 05 9b 5b db 81 07 81 5d ff 99 5c 07 88 // 90 67 90 40 6d fb 4f 8e e9 f2 4f f9 42 33 e2 e6 e5 81 e6 e5 de // 33 a5 f2 54 c9 a8 b6 12 54 74 73 c3 00 1d f3 92 8d ac 92 03 b7 // 44 61 90 82 42 1a 8d a7 c0 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 01 8a 73 ef 40 cc a6 90 fb 75 95 c6 96 29 84 f8 27 66 77 // be 6f 66 cb db cc f1 89 64 33 80 8c 9c 84 d7 4a c4 a7 c1 86 a0 // 4a 22 50 97 2f 7a cb 15 6b 21 f9 82 6b 6a cb 7d b3 2c 4e 3b 3e // c8 b5 9f d9 72 97 5e db 1d a8 72 d8 1a 35 e4 fd a2 f5 cb de 6b // 40 be a2 04 18 c6 e9 da d3 0b 79 1e ea 58 f5 3e 80 fe e4 dd 7f // e0 83 73 ea 27 84 fc d3 a6 52 61 de 71 eb 86 64 58 d2 c2 2a} // (length 0x563) // } // } // } // 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 = 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 = 0x70 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x20000080 = 9; *(uint32_t*)0x20000084 = 4; *(uint64_t*)0x20000088 = 0x200008c0; memcpy( (void*)0x200008c0, "\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x61\x12" "\x00\x00\x00\x00\x00\x00\x95\x00\x00\x00\x00\x00\x00\x00\x51\xfa\x78\x24" "\xc7\x41\x86\xdc\x02\xec\x06\x96\xc3\x7b\x64\xe3\xb2\x4d\xa3\x18\x01\x00" "\x00\x00\x05\x16\x5c\x0f\x63\xcd\xc2\xe8\x28\x18\x25\x49\x50\xee\x03\x56" "\x8b\x88\x09\xa1\xff\x4c\x7c\x47\x50\xea\xbf\xaf\xcb\x95\x31\xb3\x1e\x6a" "\x86\x82\x7d\x10\x10\xc5\xa9\x09\xab\x98\xe0\x0e\x19\x64\x4a\x88\xe9\x5b" "\xa2\x6d\x1c\x9e\xec\xdd\xb2\xd1\x1c\x54\x14\x18\xce\xeb\x29\xb9\xb6\x82" "\x9c\x6e\x43\x38\x22\xbd\xb3\xcc\x85\x24\x4a\xab\x60\xc1\xaa\xe1\x31\x4d" "\x73\x81\xfc\xfe\xb9\x70\xbe\xa6\x72\xcf\x1e\x92\x6f\x6a\x51\x47\x93\x43" "\x14\x46\x48\xa0\x7a\x97\x5b\xd8\x9d\xc3\x98\x71\x23\x76\x61\x0f\x62\x54" "\xf1\x24\x95\xb4\x65\x83\x19\x68\x43\x87\xf6\xf3\x54\x32\x05\xd4\xbc\x4c" "\xe0\x5b\x8b\x96\x11\x03\x67\x3d\xff\x7f\x15\x80\x52\xe6\x2b\x20\xf0\x5f" "\xd2\x41\x08\xd8\x36\x3d\x44\xfc\xd0\xf8\xf3\x64\x78\x99\x76\x2a\x17\x28" "\x2a\x19\x14\x45\x2d\x11\xf5\x57\xc2\x8f\x39\x6e\xeb\xdc\x85\x85\x58\xdb" "\x02\x76\xd1\x4f\x90\x35\xf2\xb5\xf7\x03\xe5\xbe\x7e\x4a\xcf\x8b\x78\xc2" "\x83\x4a\xe5\x80\x5f\xff\xee\x38\xa9\xa0\x03\x3d\x52\x0b\xcf\x6b\x08\xed" "\xe5\x08\x99\xd4\xb9\xbd\xf8\x5c\x71\xc5\xde\x25\x03\xda\xb3\x58\xf4\x2a" "\x26\x24\xc7\xda\xa9\xed\x44\x03\x9a\xab\x46\x41\x94\x96\x36\x2e\x54\xcf" "\xad\x05\xa0\x00\x4a\xc7\x1a\x00\x3d\x7b\x85\xd0\x71\x91\xbe\xd4\xe5\xa8" "\x90\x82\x63\x00\x21\x41\x46\xf7\xed\x56\x99\x85\x43\x9b\xaa\x35\x5c\x27" "\x66\xdd\x05\x6f\x5d\x79\xe4\x54\xf3\xd8\x73\x09\x5e\x7a\x23\x7b\xc0\x6d" "\x03\x5a\x8d\x60\x1f\x21\x74\x6d\x88\x64\x19\xf3\x8b\x34\xa4\x95\x04\x00" "\x00\x00\x00\x71\xc2\xf0\xcc\xe8\xc9\x3c\xc1\x7e\x9a\xfa\x31\x4f\xcb\x2b" "\xa1\x5d\x64\x6c\x66\xb0\xf6\x50\x21\x82\x9f\x87\xd9\x88\xb4\xe2\xd7\x17" "\x53\xb1\x54\x9f\xa7\x34\xf0\xb2\xe5\x6d\xbd\x21\xed\x2e\x09\xd0\xcd\xda" "\xd7\x21\x97\x16\x37\xf3\x84\xee\xd3\x03\x45\x97\xc9\x3e\x1c\x52\xf4\x2c" "\xad\x0e\xd0\x9c\x39\x5d\xc6\xe9\x70\x36\x60\xfe\xfa\x1c\x80\xf4\x67\x36" "\x7c\x00\x6f\x25\xca\xf0\xcb\xce\xfd\x13\xd6\x88\x39\x89\x3e\x39\xc5\x88" "\xeb\x03\x29\x05\xf9\x1c\xaf\xa4\x99\x6d\xbf\x0c\x9b\xe9\x65\x4d\xb0\x5f" "\xb9\x18\x08\x6c\xc8\x22\x8d\x02\xa3\x09\x2c\x08\x30\xb8\xf5\x87\xa5\x62" "\x45\x15\x29\x8b\x2d\x4e\xb2\xbd\xe6\xf9\xa2\xeb\x83\xd5\x3f\x71\x7f\x13" "\xfa\x75\x52\xd9\x2c\x51\xdb\xd3\x2e\xa5\x0c\x49\x0e\xcd\x08\x5d\x28\x11" "\xa7\x55\x5c\x53\x8c\xff\xff\xff\x7f\x00\x00\x00\x00\xdd\x87\x22\x44\xbf" "\xa6\x47\x79\xe0\xf4\x3a\x9c\x27\x7e\x29\x10\xb7\xcc\xdc\x3d\x67\x26\xd3" "\x4a\xd2\x10\x10\x33\xa6\x23\xca\x2a\x49\xad\x34\x48\x84\x28\x91\x30\xbc" "\x71\xce\xe2\xb7\xde\x62\xbf\x48\x12\x9a\xe1\xaf\x05\x2a\x2d\x46\xa6\x16" "\x25\x73\x5a\x9e\xea\x7f\x79\x39\x46\xb3\x22\x9e\x86\x1d\x8e\xa4\x98\x06" "\xb3\xf7\xd4\x29\x5f\x6b\x00\x00\x00\x00\x00\x00\xf3\x37\xb1\xce\xb2\xd8" "\xa6\x5d\xcd\xcd\x89\x5d\x7b\xa3\x70\x98\xd2\x59\x3f\xda\xae\xf4\x45\xaf" "\x5b\xee\x02\x01\x9c\x00\x00\x00\x99\xb1\x3e\xcd\xa2\xa5\xb3\x7d\xe0\x51" "\x9e\x97\x4c\xba\x92\xeb\xaf\x0f\x70\x16\x11\xa9\xb0\x27\xce\x04\x34\x0b" "\xda\x45\x94\xcc\x90\x49\xc3\xf1\x01\x62\x9a\xb0\x28\x14\x5e\x00\x42\x09" "\xeb\xe7\x1a\x6f\xe8\x4a\xf5\x08\x04\x00\x00\x00\x00\x00\x00\x00\x4a\x27" "\x21\x33\x54\x96\x4e\x25\x0a\x98\xfe\x35\x76\x76\xf9\x4b\x69\x47\x38\x3e" "\x32\x0f\xbb\x11\x18\xf5\x86\xd5\xb9\xb1\xb9\x77\xe1\xe1\xa4\x49\x0f\xf6" "\x77\x03\xa9\xb5\x90\x0f\x8a\x6f\x8a\x80\x58\x79\xdd\x91\xec\x5f\xf4\x35" "\xb2\x19\xc5\x36\x80\xc0\xae\x04\xdc\xc4\xef\x69\xb9\x8f\xcb\x0d\x6b\x6a" "\x03\xa8\xb7\x1a\x66\xb4\xe2\x87\x6d\xc4\xb6\x10\x44\x4b\xf1\x00\x00\x00" "\x00\x00\xb0\x46\xb6\xae\x5d\x68\x15\x6b\xcb\xd6\xd8\x79\x3a\xde\x9a\x22" "\xac\x8f\xc7\x85\x7e\x5b\xbc\x14\xad\xc4\xe1\x2b\x08\xf3\x50\xc6\x78\x92" "\x83\xb9\x99\x0c\x72\xe6\x43\x72\xa1\xf7\x97\x69\xa8\xbd\xc6\x32\xfc\x1a" "\x0b\x34\x17\x85\x5d\x8b\x7d\x25\xca\x4d\x40\x4c\x23\x63\x1a\xd3\xd2\xf5" "\x5d\xcd\x38\x53\x71\xc8\x61\x70\xa4\xbc\xa5\x8c\x2b\x2b\x4e\xab\xc3\x65" "\xf4\x5b\xd1\x0b\xb4\x5b\x0c\x5b\xc3\x54\x45\x6a\x52\xbe\x18\xd9\xb4\x40" "\x14\xd2\x0a\x3c\x51\xc8\xf0\x13\xda\xde\x83\x56\x2e\x73\x27\x86\x62\x82" "\x9e\x4f\x5a\x9a\xc0\x0f\xd9\x11\x78\x46\x8c\x73\x7f\x08\x72\xd9\x7d\x38" "\xd1\x1a\x17\x6b\xe5\xa0\xd7\x29\x4c\x51\xeb\x16\x1e\xdd\xcf\xef\xa8\x83" "\x7c\x74\x30\x72\x18\x51\xec\x2a\x10\x7a\xf0\xdf\x6d\x43\xe7\x32\xbb\xc0" "\x1e\x76\xc6\x68\x95\xeb\x85\xd3\x67\x98\xd6\x16\x22\x77\x35\x91\xee\x21" "\xad\x9f\x6a\x1b\x73\xfa\x9c\xf3\xff\xeb\x8a\x00\xb6\x3a\xf8\x00\xa8\x1d" "\x0f\xb8\xaa\x29\xdf\x8b\x8a\xd6\xfb\xaf\xef\xb5\x80\x2a\x23\xcb\xde\xea" "\xbc\xed\xa5\xbf\xc5\xff\x2f\xa5\xc1\xd6\x1d\x04\xa1\x32\x47\x94\xc6\xed" "\x00\x06\x96\xd9\xf0\x40\x10\xc3\x54\x74\xe6\x90\x54\x5c\x3d\x9b\xd8\x36" "\xd4\xce\xf2\x58\x5b\xa6\x16\xe0\x1c\x3d\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x47\x0e\xbc\x6f\x34\x53\xec\xbf\x30\x47\xe4\x54\x7d\x76\x32\xd3\xad" "\x21\x79\x8e\x73\x0c\xb5\xd1\xda\x05\x9b\x5b\xdb\x81\x07\x81\x5d\xff\x99" "\x5c\x07\x88\x90\x67\x90\x40\x6d\xfb\x4f\x8e\xe9\xf2\x4f\xf9\x42\x33\xe2" "\xe6\xe5\x81\xe6\xe5\xde\x33\xa5\xf2\x54\xc9\xa8\xb6\x12\x54\x74\x73\xc3" "\x00\x1d\xf3\x92\x8d\xac\x92\x03\xb7\x44\x61\x90\x82\x42\x1a\x8d\xa7\xc0" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x8a\x73\xef" "\x40\xcc\xa6\x90\xfb\x75\x95\xc6\x96\x29\x84\xf8\x27\x66\x77\xbe\x6f\x66" "\xcb\xdb\xcc\xf1\x89\x64\x33\x80\x8c\x9c\x84\xd7\x4a\xc4\xa7\xc1\x86\xa0" "\x4a\x22\x50\x97\x2f\x7a\xcb\x15\x6b\x21\xf9\x82\x6b\x6a\xcb\x7d\xb3\x2c" "\x4e\x3b\x3e\xc8\xb5\x9f\xd9\x72\x97\x5e\xdb\x1d\xa8\x72\xd8\x1a\x35\xe4" "\xfd\xa2\xf5\xcb\xde\x6b\x40\xbe\xa2\x04\x18\xc6\xe9\xda\xd3\x0b\x79\x1e" "\xea\x58\xf5\x3e\x80\xfe\xe4\xdd\x7f\xe0\x83\x73\xea\x27\x84\xfc\xd3\xa6" "\x52\x61\xde\x71\xeb\x86\x64\x58\xd2\xc2\x2a", 1379); *(uint64_t*)0x20000090 = 0x20000100; memcpy((void*)0x20000100, "GPL\000", 4); *(uint32_t*)0x20000098 = 0; *(uint32_t*)0x2000009c = 0; *(uint64_t*)0x200000a0 = 0; *(uint32_t*)0x200000a8 = 0; *(uint32_t*)0x200000ac = 0; memset((void*)0x200000b0, 0, 16); *(uint32_t*)0x200000c0 = 0; *(uint32_t*)0x200000c4 = 0; *(uint32_t*)0x200000c8 = -1; *(uint32_t*)0x200000cc = 8; *(uint64_t*)0x200000d0 = 0; *(uint32_t*)0x200000d8 = 0; *(uint32_t*)0x200000dc = 0x10; *(uint64_t*)0x200000e0 = 0; *(uint32_t*)0x200000e8 = 0; *(uint32_t*)0x200000ec = 0; *(uint32_t*)0x200000f0 = -1; *(uint32_t*)0x200000f4 = 0; *(uint64_t*)0x200000f8 = 0; *(uint64_t*)0x20000100 = 0; *(uint32_t*)0x20000108 = 0x10; *(uint32_t*)0x2000010c = 0; *(uint32_t*)0x20000110 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x20000080ul, /*size=*/0x70ul); if (res != -1) r[1] = res; // bpf$BPF_PROG_DETACH arguments: [ // cmd: const = 0x8 (8 bytes) // arg: ptr[in, bpf_detach_arg] { // bpf_detach_arg { // target: union bpf_attach_targets { // cgroup: fd_cgroup (resource) // } // prog: fd_bpf_prog (resource) // type: bpf_attach_types = 0x2 (4 bytes) // flags: bpf_mprog_attach_flags = 0x2 (4 bytes) // replace_bpf_fd: const = 0x0 (4 bytes) // relative_link_fd: union _bpf_detach_arg_relative_link_fd_wrapper { // void: buffer: {} (length 0x0) // } // relative_prog_fd: union _bpf_detach_arg_relative_prog_fd_wrapper { // value: fd_bpf_prog (resource) // } // relative_link_id: union _bpf_detach_arg_relative_link_id_wrapper { // void: buffer: {} (length 0x0) // } // relative_prog_id: union _bpf_detach_arg_relative_prog_id_wrapper { // void: buffer: {} (length 0x0) // } // exp_revision: bpf_revision (resource) // } // } // size: len = 0x10 (8 bytes) // ] *(uint32_t*)0x20000040 = r[0]; *(uint32_t*)0x20000044 = r[1]; *(uint32_t*)0x20000048 = 2; *(uint32_t*)0x2000004c = 2; *(uint32_t*)0x20000050 = 0; *(uint32_t*)0x20000054 = -1; *(uint64_t*)0x20000058 = 0; syscall(__NR_bpf, /*cmd=*/8ul, /*arg=*/0x20000040ul, /*size=*/0x10ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-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=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*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; }