// https://syzkaller.appspot.com/bug?id=b97ec15bfe317ac1ddccb41f2a913d4f7a31c6d7 // 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 #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; } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; for (;;) { uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts); if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) return 1; now = current_time_ms(); if (now - start > timeout) return 0; } } 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"); } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 10; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); if (call == 8) break; event_timedwait(&th->done, 50); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); } 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[4] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: res = syscall(__NR_socket, /*domain=*/0x29ul, /*type=SOCK_DGRAM*/ 2ul, /*proto=*/0); if (res != -1) r[0] = res; break; case 1: *(uint32_t*)0x200000000080 = 1; *(uint32_t*)0x200000000084 = 5; *(uint64_t*)0x200000000088 = 0x200000001cc0; memcpy( (void*)0x200000001cc0, "\xbf\x16\x00\x00\x00\x00\x00\x00\xb7\x07\x00\x00\x01\x00\xf0\xff\x50" "\x70\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\xc0\x00\x95\x00" "\x00\x00\x00\x00\x00\x00\x2b\xa7\x28\x04\x15\x98\xd6\xfb\xd3\x0c\xb5" "\x99\xe8\x3d\x24\xbd\x81\x37\xa3\xaa\x81\xe0\xed\x13\x9a\x85\xd3\x6b" "\xb3\x01\x9d\x13\xbd\x23\x21\xaf\x3c\x2b\xd6\x7c\xe6\x8f\x15\xc0\xec" "\x71\xd0\xe6\xad\xfe\xfc\xf1\xd8\xf7\xfa\xf7\x5e\x0f\x22\x6b\xd9\x17" "\x06\x00\x00\x00\x71\x42\xfa\x9e\xa4\x31\x81\x23\xf5\x1c\x0a\x0e\x16" "\x8c\x18\x86\xd0\xd4\xd3\x53\x79\xbd\x22\x3e\xc8\x39\xbc\x16\xee\x98" "\x8e\x6e\x0d\xc8\xce\xdf\x3c\xeb\x9f\xbf\xbf\x9b\x0a\x49\xef\x23\xd4" "\x30\xf6\x29\x6b\x32\xa8\x34\x38\x81\x07\x20\xa1\x59\xcd\xa9\x03\x63" "\xdb\x3d\x22\x1e\x15\x2d\xfc\xa6\x40\x57\xff\x3c\x47\x44\xae\xac\xcd" "\x36\x41\x11\x0b\xec\x4e\x90\x27\xa0\xc8\x05\x5b\xbf\xc3\xa9\x6d\x2e" "\x89\x10\xc2\xc3\x9e\x4b\xab\xe8\x02\xf5\xab\x3e\x89\xcf\x6c\x66\x2e" "\xd4\x04\x8d\x3b\x3e\x39\x62\xdc\xdd\xef\x6a\xf1\xa1\x19\x72\xa6\xb4" "\x97\x50\x22\x27\x8d\x00\x03\x1e\x53\x88\xee\x5c\x86\x7d\xdd\x58\x21" "\x1d\x6e\xce\x1c\xcb\x0c\xd2\xb6\xd3\xcf\xfd\x96\x28\x67\xa3\xa2\xf6" "\x24\xf9\x92\xda\xa9\x4a\x0c\x55\x6f\x32\x18\xce\x74\x00\x68\x72\x5c" "\x37\x07\x4e\x46\x8e\xe2\x07\xd2\xf7\x39\x02\xeb\xcf\xcf\x49\x82\x27" "\x75\x98\x5b\xf3\x1b\x71\x5f\x58\x88\xb2\x4e\xfa\x19\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdd\xff\xff\xff\x02\x00\x00" "\x00\x00\x00\x00\x00\x00\xdd\xff\xff\xff\x00\x00\xb2\x7c\xf3\xd1\x84" "\x8a\x54\xd7\x13\x2b\xe1\xbf\xb0\xad\xf9\xde\xab\x33\x23\xaa\x9f\xdf" "\xb5\x2f\xaf\x9c\xb0\x9c\x3b\xfd\x09\x71\xd3\x79\x38\x0b\xf6\x34\x32" "\x87\x2c\xfe\xd4\x53\x87\x00\x00\xb2\x19\xef\x00\xbb\x7b\x3d\xe8\xf6" "\x7f\xfc\xad\x3f\x6c\x3c\x2b\x1f\x03\x55\x00\x00\x00\x00\x00\x00\x1c" "\xf4\x1a\xb1\x1f\x12\xfb\x1e\x0a\x49\x40\x34\x00\x7d\xe7\xc6\x59\x2d" "\xf1\xa6\xc6\x4d\x3f\x15\x3b\x3d\x34\x88\x9f\x40\x15\x9e\x80\x0e\xa2" "\x47\x4b\x54\x05\x00\xa3\x0b\x23\xbc\xee\x46\x76\x2e\x20\x93\xbc\xc9" "\xea\xe5\xee\x3e\x98\x00\x26\xc9\x6f\x80\xee\x1a\x74\xe0\x4b\xde\x74" "\x07\x50\xfa\x4d\x9a\xaa\x70\x59\x89\xb8\xe6\x73\xe3\x29\x6e\x52\xd3" "\x11\x28\x74\xec\x51\xd6\xfe\x04\x8b\xa6\x86\x6a\xde\xba\xb5\x31\x68" "\x77\x0a\x71\xad\x90\x1a\xce\x38\x3e\x79\x27\xde\x21\x7d\x6b\xf7\x4d" "\xaf\x41\xd2\x77\xb1\x03\x92\x3a\x9d\x96\x1f\x7a\x25\x91\xdb\xe4\xa9" "\x12\xff\xaf\x6f\x65\x8f\x3f\x9c\xd1\x62\x86\x74\x4f\x83\xa8\x3f\x13" "\x8f\x8f\x92\xef\xd9\x22\x39\xea\xfc\xe5\xc1\xb3\xf9\x7a\x29\x7c\x9e" "\x49\x0f\x24\x19\x99\x08\x5a\xfa\xbd\xd5\x29\xf6\x2c\xa0\xc3\x30\x0e" "\xf7\xb7\xfb\x5f\x09\xe0\xc8\xa8\x68\xa3\x53\x40\x9e\x34\xd3\xe8\x22" "\x79\x63\x7f\x99\xf3\x5a\xd3\xf7\xff\xff\xff\x3c\xac\x39\x4c\x7b\xbd" "\xcd\x0e\x0e\xb5\x21\x62\xe0\xc4\x10\xad\xe7\xa3\x6b\x26\xa4\xe7\x0f" "\x03\xcc\x41\x46\xa7\x7a\xf0\x2c\x1d\x4c\xef\xd4\xa2\xb9\x4c\x0a\xed" "\x84\x77\xdf\xa8\xce\xef\xb4\x67\xf0\x5c\x69\x77\xc7\x8c\xdb\xf3\x77" "\x04\xec\x73\x75\x55\x39\x2a\x0b\x06\x49\x1c\xba\x71\xf8\x97\x14\x49" "\x10\xfe\x05\x00\x38\xec\x9e\x47\x5e\x89\x29\x8b\x7b\xf4\xd7\x69\xcc" "\xc1\x8e\xed\xe0\x06\x8c\xa1\x45\x78\x70\xeb\x30\xd2\x11\xe2\x3c\xcc" "\x8e\x06\xdd\xde\xb6\x17\x9d\x25\x7a\xb5\x00\x00\x13\xc8\x6b\xa9\xaf" "\xfb\x12\xec\x75\x7c\x72\x34\xc2\x70\x24\x6c\x87\x8d\x01\x16\x0e\x6c" "\x07\xbf\x6c\xf8\x80\x9c\x3a\x0d\x06\x23\x57\xba\x25\x15\x56\x72\x30" "\xa6\xf8\xb2\xad\x1e\x1f\x49\x33\x54\x5f\xc3\xc7\x41\x37\x42\x11\x66" "\x3f\x6b\x63\xb1\xdd\x04\x4d\xd0\x11\x7c\x9b\x73\x7b\x9b\x59\x41\x80" "\x06\xc1\xbc\x1a\xaf\xa2\x76\x8e\x82\x59\x72\x51\xe5\x51\x0a\x33\xdc" "\xda\x5e\x4e\x20\x2b\xd6\x22\x54\x9c\x4c\xff\xff\xff\x50\x1d\x3a\x5d" "\xd7\x14\x3f\xbf\x22\x1f\xff\x16\x1c\x12\xca\x38\x9c\xbe\x00\x00\x00" "\x00\x00\x00\x0f\xff\x75\x06\x7d\x2a\x21\x4f\x8c\x9d\x9b\x2e\xcf\x63" "\x1c\x6c\x5f\xd9\xc2\x6a\x54\xd4\x3f\xa0\x50\xb8\x8d\x1d\x43\xa8\x64" "\x5b\xd9\x10\x9b\x7e\x07\x86\x9b\xba\x71\x31\x42\x1c\x0f\x39\x70\x73" "\x94\x33\x30\xba\xaf\xd2\x43\xc0\xc6\xff\xe6\x73\xba\xb4\x11\x3b\xe7" "\x66\x4e\x08\xbd\xd7\x11\x5c\x61\xaf\xcb\x71\x8c\xf3\xc4\x68\x0b\x2f" "\x6c\x7a\x84\x00\xe3\x78\xa9\xb1\x01\x00\x0f\x49\xe2\x98\x72\x73\x40" "\xe8\x7c\xde\xfb\x40\xe5\x6e\x9c\xfa\xd9\x73\x34\x7d\x0d\xe7\xba\x47" "\x54\xff\x23\x1a\x1b\x93\x3d\x8f\x93\x1b\x8c\x55\x2b\x2c\x7c\x50\x3f" "\x3d\x0e\x7a\xb0\xe9\x58\xad\xb8\x62\x82\x2e\x40\x00\x99\x95\xae\x16" "\x6d\xeb\x98\x56\x29\x1a\x43\xa6\xf7\xeb\x2e\x32\xce\xfb\xf4\x44\xb0" "\x32\xda\xd1\x30\x07\xb8\x2e\x60\x44\xf6\x43\xfc\x8c\xd0\x7a\x97\xe2" "\xbb\xe6\x36\xa5\xdb\xe9\x86\x4a\x11\x7d\x27\x32\x68\x50\xa7\xc3\xb5" "\x70\x86\x3f\x53\x2c\x21\x8b\x10\xaf\x13\xd7\xbe\x94\x98\x70\x05\x08" "\x8a\x83\x88\x0c\xca\xb9\xc9\x92\x0c\x2d\x2a\xf8\xc5\xe1\x3d\x52\xc8" "\x3a\xc3\xfa\x7c\x3a\xe6\xc0\x83\x84\x86\x5b\x66\xd2\xb4\xdc\xb5\xdd" "\x9c\xba\x16\xb6\x20\x40\xbf\x87\x02\xae\x12\xc7\x7e\x6e\x34\x99\x1a" "\xf6\x03\xe3\x85\x6a\x34\x6c\xf7\x08\xfe\xeb\x70\x8a\xb2\x2b\x56\x0c" "\xf8\xa4\xa6\xf3\x1b\xa6\xd9\xb8\xcb\x09\x08\x00\x00\x00\x00\x00\x00" "\x00\x1a\x34\x2c\x01\x00\x00\x00\x00\x00\xe6\x67\xa7\x59\x2b\x33\x40" "\x6f\x1f\x71\xc7\x39\xb5\x5d\xb9\x1d\x23\x09\xdc\x7a\xe4\x01\x00\x5f" "\x52\x05\x3a\x39\xe7\x30\x7c\x09\xff\x3a\xc3\xe8\x20\xb0\x1c\x57\xdd" "\x74\xd4\xaa\xfc\x4c\x38\x3a\x17\xbc\x1d\xe5\x34\x7b\xb7\x1c\xa1\x6d" "\xcb\xbb\xaa\x29\x35\xf6\x02\x32\x59\x84\x38\x6b\x21\xb9\x64\x92\xae" "\x66\x20\x82\xb5\x6c\xf6\x66\xe6\x3a\x75\x7c\x0e\xf3\xea\x7a\xf6\x88" "\x15\x13\xbe\x94\xb3\x62\xe1\x5f\xfc\xa8\xec\x45\x3b\x3a\x2a\x67\xbe" "\x70\xc1\x7b\x0f\x9c\x2e\xac\x76\x58\x16\xc3\x0c\x2e\x71\x33\x8a\x40" "\xc7\x66\x95\x22\xe8\xdf\xf8\xbc\x57\x0a\x93\xfb\xdb\x68\x8c\x3a\xef" "\x81\x00\x00\x00\x7a\x6e\xa6\xb1\x11\x63\x39\x2a\x19\xd8\x79\x95\xb5" "\x1c\xb6\xfe\xbd\x5f\x24\xa3\x49\x98\xd2\x01\x0f\xd5\xfa\xcf\x68\xc4" "\xf8\x4e\x2f\x66\xe2\x7c\x81\xa1\x49\xd7\xb3\x31\x98\x3d\x3b\x74\x44" "\x49\x53\xfc\x12\x16\xdf\xec\x10\xb7\x24\xbe\x37\x33\xc2\x6f\x12\x53" "\x83\x76\xe1\x77\xff\xef\x6f\xd2\x60\x3b\xfa\xb9\x68\x31\x95\x7a\x08" "\xe4\x91\x9a\x46\x3d\x53\x32\xa2\x54\x60\x32\xa3\xc0\x6b\x94\xf1\x68" "\xe8\xfc\x4b\xda\x0c\x29\x47\x23\xfe\x30\x6f\x26\xc4\x77\xaf\x4b\x92" "\x66\x44\x67\x29\x85\xfa\xb7\xcc\x67\xbc\x5b\x5f\x5d\x38\xcd\xd8\xdf" "\x95\x14\x7e\xbe\x1c\xd8\x8b\x0a\x4c\x6c\xde\x99\x51\xbe\x42\x82\x7d" "\xfd\xdf\xef\xb2\x38\xfa\xc2\x30\x3c\xc8\x98\x2f\x1e\x55\xb0\x05\xaf" "\xcf\xea\x5e\xb0\x37\x24\x8f\xef\xad\x6b\xb0\x2c\x16\x2c\xe9\x2a\xb1" "\x77\x44\xc8\xec\x3d\x2e\x80\xcf\x32\x05\xd3\x66\x99\xfd\x38\x1b\xc8" "\x12\x31\xfb\x5e\x12\xe4\x5f\x30\x59\xf3\x61\xd0\x8d\x6a\x6d\x01\xaf" "\x43\x08\x3c\x29\x51\x2b\xce\xdd\x79\xca\x9b\xf2\x4e\x06\x3d\x0c\x27" "\x3e\xd7\x0a\x2b\x70\xbe\x52\x1e\xa2\x7d\xc8\xcf\x3c\x9b\xdf\x83\xb9" "\x34\x05\xdb\x07\xe8\x2e\x2d\xdf\x4c\x4d\x26\xf1\xcd\xd8\xc3\xc9\x73" "\x6c\xf5\xe5\x08\x2d\xe3\xb4\x84\xf8\x67\x3e\x0e\x97\xdd\x7e\x8a\x87" "\x21\x48\x61\x3c\x3a\x04\xf3\xd6\x7f\x43\x75\xba\x5c\x7f\x1b\x00\x33" "\xf8\xdf\xe0\xfd\x9b\xb2\xa7\x08\x01\xf7\x63\x52\x4e\x1d\x79\xd8\x12" "\xce\xd7\x82\x64\x6b\x5f\x79\xc8\xfc\x08\xbb\x5c\x11\x02\x01\x08\xd7" "\x02\xed\xd2\xea\x9c\x96\xcf\xcb\x90\x66\x66\x86\x27\xeb\xe9\x2d\x48" "\xaa\x5f\xc0\xa7\xbf\x1b\x51\x08\xb3\x4d\x22\xad\x00\x4d\xe8\x27\x4c" "\x22\xc8\xba\x82\x3d\x96\x49\x69\xc9\xf0\x2b\xb7\x8c\x59\x8f\xa8\x70" "\x1b\x00\x08\x84\xde\x71\x0b\x54\xe5\xab\x2e\x8f\xf0\xc7\xae\x23\xe0" "\xb6\x01\xac\x95\xc4\xc2\xee\xf2\xe5\xeb\x1d\x01\x9d\x52\x09\x9f\xbd" "\x40\x4e\x8e\xce\x97\x0f\x67\x73\x6b\xa7\xe9\x60\xbd\x8b\x1e\x41\x05" "\xb6\x50\x07\xc8\xff\x1f\x00\xa8\xce\x7e\x31\xf7\xc9\xc3\xe3\xfa\x61" "\xaa\xb9\x67\xb9\x00\x87\xe9\x1d\x70\x3e\x98\x53\x5b\x10\x7b\x8f\x46" "\x53\xbe\x4c\x46\xa3\xa1\xad\xb0\x7d\x22\x69\x52\xb8\x57\x3b\x41\x70" "\x18\x31\x6f\xa9\x6e\x94\x2e\x35\xc4\xba\xa1\x90\x41\x22\xc8\x63\x70" "\x9b\x08\xd4\x63\x9a\x19\xa4\x6a\xc9\x0a\xc4\x8a\x13\xee\x9b\xca\xa8" "\x75\xfc\x70\x0b\xa3\x63\xca\x31\x82\x10\x59\x60\xbe\xf3\x37\x8a\x98" "\x00\x00\x00\x00\x00\x00\x3b\x40\xdc\x5c\x74\x5f\xe2\x49\x1e\x84\x25" "\xe6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x25\x03" "\x18\xa4\x4a\xd3\x1b\xaa\xc0\x52\x0a\x91\x33\x01\xe6\x30\xae\x54\x0f" "\x32\x89\xae\xbd\xe8\x63\x3f\x6f\x45\x0c\xfe\x6e\x39\x95\x97\x35\x75" "\x82\x48\x03\x2c\xdf\x73\x20\xc6\xdc\x87\xb0\x1e\x3f\x9a\x78\x11\xb2" "\x00\x00\x00\x00\xae\x18\x9d\xe4\xb9\xb2\x5f\x7c\x7a\x9c\x32\xe4\xf1" "\xf2\x2a\xf1\xc0\x63\x15\x27\x0d\xe4\xa6\x60\x5e\x4b\x4b\x58\xbe\xf7" "\x6f\xac\x54\xf1\x1b\x84\xbd\x7b\xcd\x6b\x6a\x48\x5e\xdf\xb7\x68\x4c" "\x77\x0a\x39\xb3\x8b\x08\xe1\x8a\x51\xa4\xd4\xe6\x6c\xa2\x1c\x06\xa4" "\xb4\x19\x8e\x1b\xc2\xef\x99\x0c\x9b\xa9\x11\xef\xed\x62\x6e\x5e\xe3" "\x41\xa1\x7b\xf8\x13\x2b\x5b\x1d\xfa\x9f\xd3\x1d\xf2\x13\xc8\x8b\x40" "\x47\x97\x05\x6f\xd3\xba\xa8\xb2\xd6\xcb\x13\x44\x37\xcb\xa0\x19\x3b" "\xa4\x36\x0b\xdc\xc9\x8a\xad\x25\x60\xaa\x58\x29\x1c\x4e\xb9\xd4\xe0" "\x8a\xd7\xa9\xc5\xf0\x4b\xe1\xab\x59\x71\x9a\x82\x00\x00\x7b\xd8\xcc" "\xa8\xf6\x81\x54\xa0\xed\x35\x6e\x77\x3a\x79\x7c\xa6\xd6\x67\x48\x85" "\x7b\x4a\xbb\xf8\x83\x0a\xbe\xea\x2a\x46\x34\x2e\x6a\x73\x78\x17\x3c" "\xb2\x9d\x5c\xdc\xd6\x98\xa0\x20\x3f\x78\x11\x6b\x71\x00\x08\x00\x00" "\x00\x00\x00\x00\x00\x7c\x2d\x86\xb9\x44\x72\x80\x7c\x10\xeb\x9a\x8e" "\x2f\xb8\xbd\x79\xfe\x3a\x83\x16\xde\xff\x3e\xe6\x41\xc9\xa0\x80\xa2" "\x17\x36\x42\xe6\x73\xa6\x72\x27\x9b\xae\x4e\x7e\x28\x05\x5d\xa9\x49" "\x7d\x7e\xdb\x53\xbe\x6e\x80\x48\x2b\xd4\xd9\xa7\x4b\x7f\x76\xc7\x8b" "\xa0\xb4\x4e\xc0\xbd\xfa\x0d\x32\xd7\x03\x00\x00\x00\x3a\x07\x3b\x12" "\xeb\x57\x90\x32\xb8\x56\xd8\x92\xad\x6a\xf5\x12\x4c\x9c\x31\x30\x48" "\x5e\x96\x82\xff\x1f\x3c\x54\xe4\x75\xd5\xbb\x49\x6a\xef\x4b\xb5\x37" "\xd7\xe1\x91\xdf\xde\xba\x10\x9f\xdc\xf7\x86\x47\x63\xf8\x7a\x6d\x71" "\x1c\xf5\x2e\x52\x0a\x6c\xe3\x0e\x13\x4c\x55\xe0\x2b\x7c\xd2\x53\x85" "\xf3\xb9\x62\x84\x71\xb4\x36\x49\x87\xb0\xb2\xc8\x2a\x8b\x0f\x97\x63" "\x87\xeb\xb6\x2e\xad\x0e\x1b\x76\x1e\x6e\xc9\xb8\x24\xfe\x00\x6e\xa5" "\x2c\x0c\x46\x9e\x3b\xd8\xfe\xd0\x5a\x48\x6b\xd5\x51\x11\x44\xeb\xb6" "\x3d\x56\xd6\x1d\xa5\xfc\xb5\x8e\x19\x6a\x89\x23\xed\xaf\x22\x8b\x0c" "\xb9\x6b\x85\x6b\x15\xc9\x0b\x15\x44\x94\xfb\x0c\xff\x76\x8b\x34\x17" "\xfc\xc8\x9a\xcb\x9b\x9b\x4f\x85\x81\xc8\x2f\xf3\x12\x1b\x59\x20\xf4" "\xe7\x15\x08\xee\xa4\x34\x1e\xc6\x18\xf4\xd9\x11\x09\x28\xea\x8d\xd1" "\x7e\x36\xf3\xbe\xb0\xc0\x7d\x91\x1c\x00\xeb\x40\x54\xad\x48\xca\xb5" "\x63\xc5\xad\x97\xd7\x32\xc3\x65\x36\x35\xdf\x76\x00\x09\x19\x73\xd4" "\x4f\xf9\x4a\xc6\xd6\x70\xec\xc0\x85\x50\x1b\xd9\x1b\x58\x6a\xdf\x85" "\x8b\x41\xd9\x18\xfd\x58\xf8\x57\x7a\xdb\x54\x18\x57\xdb\xbf\x33\xbe" "\x97\xc4\x80\x9c\x65\x95\xeb\xff\xf1\x9b\x34\xce\xc7\xfd\x87\x7e\x8f" "\x2a\xad\x6a\x1a\x6a\x4e\xc6\xdb\xb3\xde\x42\xbb\x2e\x75\xb4\x76\x8d" "\x13\x9d\x7b\x7f\xf5\xd5\x1e\x68\x63\xb6\x70\x49\x01\xb5\x9f\xd9\x24" "\x95\x60\x83\x95\xfc\xe9\x8c\x26\x7a\x38\x46\xb6\x7e\x7a\x5b\x57\xd9" "\x95\xe0\x7d\xca\x8d\xb5\x55\xae\xa5\xa0\xf6\xf1\xcd\x85\xd7\x91\xf2" "\x2d\x06\xff\x37\xfc\xbb\x22\xb2\xd9\x29\x6b\x36\xfa\xee\x22\xe5\x13" "\xb2\x76\xfc\x84\x94\xce\x31\x69\x93\x43\x27\x8a\xa8\xf5\x31\xee\x54" "\x9d\x2b\xa4\x95\x05\x9c\x80\xd5\x74\x8d\x8a\x0c\xb1\x9d\xf2\x73\x38" "\xaa\xaf\xbf\x08\x49\xc3\x15\x72\xd1\x7a\x78\x63\x83\xb3\xf6\x19\x21" "\x26\x51\xa0\x76\xe5\x14\x8f\xa6\x42\x1f\x54\x05\xe6\x5e\xe3\x1e\x6f" "\xbd\x51\x0d\x92\xc1\x7f\xe1\x2a\x7f\x20\x30\x66\x84\x8e\x2a\x9a\xde" "\xf6\x6a\xd7\xae\x8e\xde\xa2\x0f\xb8\xc7\x23\x3d\xe3\x73\x69\x49\xe1" "\x5b\x88\x69\x9c\x2f\x85\x76\x06\x0c\xf9\x5d\x25\x93\x82\x8a\xbd\xe6" "\xe2\xee\xd2\xa7\x17\x65\x57\x82\xae\x9e\x58\x9f\x5d\xe9\x79\x2c\x81" "\x0e\xc0\x7a\x84\x2b\xca\x96\xe5\x94\xf1\x32\x11\xea\xe7\xee\x19\x19" "\xb7\xaf\x1e\x33\xff\x72\x67\x92\xcb\xb1\x36\x6f\xb8\xa3\x68\x43\x70" "\xe3\x51\x22\xb0\xad\x40\xf5\x58\x46\xca\x7d\x39\xcf\x6f\x9a\x1c\xfa" "\x54\x60\xf5\x37\xe8\x9e\x1c\x5f\x3c\xd1\x0a\x3d\x8a\xe3\xec\xec\x0c" "\x7e\x41\x14\xae\xc3\x07\x42\xd8\x8f\x31\x3d\x74\x44\x77\x23\x80\x8d" "\xa0\x88\x9e\x34\xb3\x1c\x13\xa7\x9b\x8b\xb1\x05\xcd\xcb\x23\x4d\x56" "\x24\x6b\xbf\x00\x3c\x0a\xd0\x3f\xf2\x0f\x57\x3d\xf9\x60\x47\x20\xd6" "\x52\xb0\xa0\xcc\x5d\x90\xa2\x84\xb5\xc7\x82\x4b\xfd\xc4\xe3\xf1\x8e" "\xaf\x98\x20\xff\xbd\x8c\x4f\x32\xc8\xde\x63\x1c\x18\x1a\xb7\x65\x05" "\xda\xc7\x53\xfe\xc7\x59\xb0\x41\x4c\xb3\xc5\xdf\xa0\x2b\x6a\x3b\x93" "\xff\x79\xbc\xf8\xc6\x13\xb4\xa9\x12\x49\x23\xe7\xe6\xce\x74\x26\x6f" "\xd7\x85\x64\x00\x00\x00\x00\x0c\xe0\xd3\xac\x23\x50\x50\x2c\xf4\xa4" "\x10\x15\x2e\xe8\x93\xd5\x76\x22\xbe\xe2\xb5\x2d\xf8\x3c\xd3\x0b\x4a" "\xe1\x7d\x50\x7f\xba\x05\xe7\x05\x5d\xb7\xe6\xd4\xcf\xc0\x85\x77\x3b" "\x90\x0c\xa5\x0b\xee\x4d\x49\x52\x9f\x24\xba\xb3\x89\xfb\x87\xfb\xb4" "\x81\x34\x0e\x8c\xe1\x81\x07\x27\x21\x2d\xc5\xe9\x6d\x99\xde\x07\x61" "\x1c\xb5\x88\xa5\xd8\xb5\xc5\x10\xc1\xf5\xb3\xfb\x56\x89\x71\x64\x68" "\x21\xb5\x0d\xc2\x54\x20\x03\xeb\x60\xa4\xee\x93\x98\xae\x4b\x66\x81" "\xc2\x9c\xd9\x21\xfb\x35\xb1\x2c\xa1\x11\xf1\x2c\x59\xac\x39\xdd\xe4" "\xbf\x4f\x75\x24\x36\x23\x04\x61\x09\x79\xf5\x19\x9e\xf9\xd2\x71\xaf" "\x60\xa4\x21\xe2\x9c\x64\x83\x42\x31\x57\xed\x4c\x27\x21\x12\x3d\xdf" "\x33\x31\x3a\x97\xec\x1a\x55\x11\x5b\x6d\xf2\x31\x57\xad\x17\xb5\xe5" "\x44\xdb\x26\xc4\x6d\x31\xb2\xe7\x37\x5c\x37\xac\xe0\x25\x95\x5c\x94" "\x82\xe1\xef\x84\x15\x54\xc2\x02\xc3\x56\x84\x22\x33\xc5\x7c\x25\x8f" "\x8f\x20\x43\xb4\xb6\xde\x43\x3e\x8a\x2f\xb9\x36\x5b\x65\x49\x6c\x57" "\x77\xc1\xa1\xa2\x23\x76\x3d\x51\x19\x0a\x24\xfb\x40\x47\xad\x7f\xf6" "\x25\x8f\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xef" "\x07\x72\x62\x28\xfb\x15\x0d\x09\xf6\x97\xee\x3d\xb6\xcc\x09\x66\x76" "\x22\x57\x80\xd4\x22\xfe\x91\x7a\x5c\x57\xbe\xda\xbb\x42\x39\x97\x27" "\xb3\x86\xe9\x79\xdd\xe3\xb7\x24\x3d\xad\x1f\x78\xe8\x59\x29\x37\x86" "\x6c\xfc\x01\x7f\x3a\x8a\xd3\x1c\x53\x11\x5f\xb7\xf3\x45\x2b\xd3\x31" "\x8c\x4a\x17\xcc\x80\xbc\xab\x32\xd9\xed\x35\x27\x3c\x3c\x93\x07\x19" "\xdd\xb5\xb7\x57\xf9\xd8\x5c\xc8\x6d\xdd", 3325); *(uint64_t*)0x200000000090 = 0x200000000140; memcpy((void*)0x200000000140, "GPL\000", 4); *(uint32_t*)0x200000000098 = 0; *(uint32_t*)0x20000000009c = 0; *(uint64_t*)0x2000000000a0 = 0; *(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; break; case 2: res = syscall(__NR_socket, /*domain=*/2ul, /*type=*/1ul, /*proto=*/0); if (res != -1) r[2] = res; break; case 3: *(uint32_t*)0x2000000001c0 = r[1]; syscall(__NR_setsockopt, /*fd=*/r[2], /*level=*/1, /*optname=*/0x32, /*optval=*/0x2000000001c0ul, /*optlen=*/4ul); for (int i = 0; i < 64; i++) { syscall(__NR_setsockopt, /*fd=*/r[2], /*level=*/1, /*optname=*/0x32, /*optval=*/0x2000000001c0ul, /*optlen=*/4ul); } break; case 4: *(uint64_t*)0x200000000300 = 0x200000000000; *(uint16_t*)0x200000000000 = 2; *(uint16_t*)0x200000000002 = htobe16(0); *(uint8_t*)0x200000000004 = 0xac; *(uint8_t*)0x200000000005 = 0x14; *(uint8_t*)0x200000000006 = 0x14; *(uint8_t*)0x200000000007 = 0xbb; *(uint32_t*)0x200000000308 = 0x10; *(uint64_t*)0x200000000310 = 0; *(uint64_t*)0x200000000318 = 0; *(uint64_t*)0x200000000320 = 0; *(uint64_t*)0x200000000328 = 0; *(uint32_t*)0x200000000330 = 0; syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0x200000000300ul, /*f=MSG_FASTOPEN|MSG_PROBE|MSG_OOB|MSG_DONTROUTE*/ 0x20000015ul); for (int i = 0; i < 64; i++) { syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0x200000000300ul, /*f=MSG_FASTOPEN|MSG_PROBE|MSG_OOB|MSG_DONTROUTE*/ 0x20000015ul); } break; case 5: *(uint32_t*)0x200000000180 = r[0]; res = syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x89e2, /*arg=*/0x200000000180ul); if (res != -1) r[3] = *(uint32_t*)0x200000000180; break; case 6: *(uint64_t*)0x200000000340 = 0; *(uint32_t*)0x200000000348 = 0; *(uint64_t*)0x200000000350 = 0x2000000002c0; *(uint64_t*)0x2000000002c0 = 0x2000000029c0; memset((void*)0x2000000029c0, 82, 1); *(uint64_t*)0x2000000002c8 = 1; *(uint64_t*)0x200000000358 = 1; *(uint64_t*)0x200000000360 = 0; *(uint64_t*)0x200000000368 = 0; *(uint32_t*)0x200000000370 = 0; syscall(__NR_sendmsg, /*fd=*/r[3], /*msg=*/0x200000000340ul, /*f=*/0ul); break; case 7: *(uint32_t*)0x200000000040 = r[2]; *(uint32_t*)0x200000000044 = r[1]; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x89e0, /*arg=*/0x200000000040ul); break; case 8: *(uint32_t*)0x200000000100 = r[2]; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x89e1, /*arg=*/0x200000000100ul); break; case 9: syscall(__NR_close, /*fd=*/r[3]); break; } } 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; }