// https://syzkaller.appspot.com/bug?id=496c096898a32838d255bb10e366fc2738397900 // 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 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 long syz_open_procfs(volatile long a0, volatile long a1) { char buf[128]; memset(buf, 0, sizeof(buf)); if (a0 == 0) { snprintf(buf, sizeof(buf), "/proc/self/%s", (char*)a1); } else if (a0 == -1) { snprintf(buf, sizeof(buf), "/proc/thread-self/%s", (char*)a1); } else { snprintf(buf, sizeof(buf), "/proc/self/task/%d/%s", (int)a0, (char*)a1); } int fd = open(buf, O_RDWR); if (fd == -1) fd = open(buf, O_RDONLY); return fd; } 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) { int i, call, thread; int collide = 0; again: for (call = 0; call < 5; 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 (collide && (call % 2) == 0) break; event_timedwait(&th->done, 45); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); if (!collide) { collide = 1; goto again; } } 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 (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5 * 1000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: res = syscall(__NR_socket, 0x10ul, 3ul, 0xc); if (res != -1) r[0] = res; break; case 1: *(uint64_t*)0x200001c0 = 0; *(uint32_t*)0x200001c8 = 0; *(uint64_t*)0x200001d0 = 0x20000180; *(uint64_t*)0x20000180 = 0x20000040; *(uint32_t*)0x20000040 = 0x28; *(uint8_t*)0x20000044 = 2; *(uint8_t*)0x20000045 = 3; *(uint16_t*)0x20000046 = 0x401; *(uint32_t*)0x20000048 = 0; *(uint32_t*)0x2000004c = 0; *(uint8_t*)0x20000050 = 0; *(uint8_t*)0x20000051 = 0; *(uint16_t*)0x20000052 = htobe16(0); *(uint16_t*)0x20000054 = 8; *(uint16_t*)0x20000056 = 1; *(uint8_t*)0x20000058 = 1; *(uint8_t*)0x20000059 = 0; *(uint16_t*)0x2000005a = htobe16(0); *(uint16_t*)0x2000005c = 9; *(uint16_t*)0x2000005e = 2; *(uint32_t*)0x20000060 = htobe32(0); *(uint8_t*)0x20000064 = 2; *(uint64_t*)0x20000188 = 0x28; *(uint64_t*)0x200001d8 = 1; *(uint64_t*)0x200001e0 = 0; *(uint64_t*)0x200001e8 = 0; *(uint32_t*)0x200001f0 = 0; syscall(__NR_sendmsg, r[0], 0x200001c0ul, 0ul); break; case 2: syz_open_procfs(0, 0); break; case 3: res = syscall(__NR_socket, 2ul, 3ul, 1); if (res != -1) r[1] = res; break; case 4: memcpy((void*)0x20000740, "raw\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000", 32); *(uint32_t*)0x20000760 = 9; *(uint32_t*)0x20000764 = 3; *(uint32_t*)0x20000768 = 0x9a8; *(uint32_t*)0x2000076c = 0x98; *(uint32_t*)0x20000770 = 0; *(uint32_t*)0x20000774 = 0xb0; *(uint32_t*)0x20000778 = 0; *(uint32_t*)0x2000077c = 0xb0; *(uint32_t*)0x20000780 = 0x910; *(uint32_t*)0x20000784 = 0x1a8; *(uint32_t*)0x20000788 = 0x1a8; *(uint32_t*)0x2000078c = 0x910; *(uint32_t*)0x20000790 = 0x1a8; *(uint32_t*)0x20000794 = 3; *(uint64_t*)0x20000798 = 0; *(uint8_t*)0x200007a0 = 0; *(uint8_t*)0x200007a1 = 0; *(uint8_t*)0x200007a2 = 0; *(uint8_t*)0x200007a3 = 0; *(uint8_t*)0x200007a4 = 0; *(uint8_t*)0x200007a5 = 0; *(uint8_t*)0x200007a6 = 0; *(uint8_t*)0x200007a7 = 0; *(uint8_t*)0x200007a8 = 0; *(uint8_t*)0x200007a9 = 0; *(uint8_t*)0x200007aa = 0; *(uint8_t*)0x200007ab = 0; *(uint8_t*)0x200007ac = 0; *(uint8_t*)0x200007ad = 0; *(uint8_t*)0x200007ae = 0; *(uint8_t*)0x200007af = 0; *(uint8_t*)0x200007b0 = 0; *(uint8_t*)0x200007b1 = 0; *(uint8_t*)0x200007b2 = 0; *(uint8_t*)0x200007b3 = 0; *(uint8_t*)0x200007b4 = 0; *(uint8_t*)0x200007b5 = 0; *(uint8_t*)0x200007b6 = 0; *(uint8_t*)0x200007b7 = 0; *(uint8_t*)0x200007b8 = 0; *(uint8_t*)0x200007b9 = 0; *(uint8_t*)0x200007ba = 0; *(uint8_t*)0x200007bb = 0; *(uint8_t*)0x200007bc = 0; *(uint8_t*)0x200007bd = 0; *(uint8_t*)0x200007be = 0; *(uint8_t*)0x200007bf = 0; *(uint8_t*)0x200007c0 = 0; *(uint8_t*)0x200007c1 = 0; *(uint8_t*)0x200007c2 = 0; *(uint8_t*)0x200007c3 = 0; *(uint8_t*)0x200007c4 = 0; *(uint8_t*)0x200007c5 = 0; *(uint8_t*)0x200007c6 = 0; *(uint8_t*)0x200007c7 = 0; *(uint8_t*)0x200007c8 = 0; *(uint8_t*)0x200007c9 = 0; *(uint8_t*)0x200007ca = 0; *(uint8_t*)0x200007cb = 0; *(uint8_t*)0x200007cc = 0; *(uint8_t*)0x200007cd = 0; *(uint8_t*)0x200007ce = 0; *(uint8_t*)0x200007cf = 0; *(uint8_t*)0x200007d0 = 0; *(uint8_t*)0x200007d1 = 0; *(uint8_t*)0x200007d2 = 0; *(uint8_t*)0x200007d3 = 0; *(uint8_t*)0x200007d4 = 0; *(uint8_t*)0x200007d5 = 0; *(uint8_t*)0x200007d6 = 0; *(uint8_t*)0x200007d7 = 0; *(uint8_t*)0x200007d8 = 0; *(uint8_t*)0x200007d9 = 0; *(uint8_t*)0x200007da = 0; *(uint8_t*)0x200007db = 0; *(uint8_t*)0x200007dc = 0; *(uint8_t*)0x200007dd = 0; *(uint8_t*)0x200007de = 0; *(uint8_t*)0x200007df = 0; *(uint8_t*)0x200007e0 = 0; *(uint8_t*)0x200007e1 = 0; *(uint8_t*)0x200007e2 = 0; *(uint8_t*)0x200007e3 = 0; *(uint8_t*)0x200007e4 = 0; *(uint8_t*)0x200007e5 = 0; *(uint8_t*)0x200007e6 = 0; *(uint8_t*)0x200007e7 = 0; *(uint8_t*)0x200007e8 = 0; *(uint8_t*)0x200007e9 = 0; *(uint8_t*)0x200007ea = 0; *(uint8_t*)0x200007eb = 0; *(uint8_t*)0x200007ec = 0; *(uint8_t*)0x200007ed = 0; *(uint8_t*)0x200007ee = 0; *(uint8_t*)0x200007ef = 0; *(uint8_t*)0x200007f0 = 0; *(uint8_t*)0x200007f1 = 0; *(uint8_t*)0x200007f2 = 0; *(uint8_t*)0x200007f3 = 0; *(uint32_t*)0x200007f4 = 0; *(uint16_t*)0x200007f8 = 0x70; *(uint16_t*)0x200007fa = 0x98; *(uint32_t*)0x200007fc = 0; *(uint64_t*)0x20000800 = 0; *(uint64_t*)0x20000808 = 0; *(uint16_t*)0x20000810 = 0x28; memcpy((void*)0x20000812, "\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000", 29); *(uint8_t*)0x2000082f = 0; *(uint32_t*)0x20000830 = 0x98; *(uint8_t*)0x20000838 = 0; *(uint8_t*)0x20000839 = 0; *(uint8_t*)0x2000083a = 0; *(uint8_t*)0x2000083b = 0; *(uint8_t*)0x2000083c = 0; *(uint8_t*)0x2000083d = 0; *(uint8_t*)0x2000083e = 0; *(uint8_t*)0x2000083f = 0; *(uint8_t*)0x20000840 = 0; *(uint8_t*)0x20000841 = 0; *(uint8_t*)0x20000842 = 0; *(uint8_t*)0x20000843 = 0; *(uint8_t*)0x20000844 = 0; *(uint8_t*)0x20000845 = 0; *(uint8_t*)0x20000846 = 0; *(uint8_t*)0x20000847 = 0; *(uint8_t*)0x20000848 = 0; *(uint8_t*)0x20000849 = 0; *(uint8_t*)0x2000084a = 0; *(uint8_t*)0x2000084b = 0; *(uint8_t*)0x2000084c = 0; *(uint8_t*)0x2000084d = 0; *(uint8_t*)0x2000084e = 0; *(uint8_t*)0x2000084f = 0; *(uint8_t*)0x20000850 = 0; *(uint8_t*)0x20000851 = 0; *(uint8_t*)0x20000852 = 0; *(uint8_t*)0x20000853 = 0; *(uint8_t*)0x20000854 = 0; *(uint8_t*)0x20000855 = 0; *(uint8_t*)0x20000856 = 0; *(uint8_t*)0x20000857 = 0; *(uint8_t*)0x20000858 = 0; *(uint8_t*)0x20000859 = 0; *(uint8_t*)0x2000085a = 0; *(uint8_t*)0x2000085b = 0; *(uint8_t*)0x2000085c = 0; *(uint8_t*)0x2000085d = 0; *(uint8_t*)0x2000085e = 0; *(uint8_t*)0x2000085f = 0; *(uint8_t*)0x20000860 = 0; *(uint8_t*)0x20000861 = 0; *(uint8_t*)0x20000862 = 0; *(uint8_t*)0x20000863 = 0; *(uint8_t*)0x20000864 = 0; *(uint8_t*)0x20000865 = 0; *(uint8_t*)0x20000866 = 0; *(uint8_t*)0x20000867 = 0; *(uint8_t*)0x20000868 = 0; *(uint8_t*)0x20000869 = 0; *(uint8_t*)0x2000086a = 0; *(uint8_t*)0x2000086b = 0; *(uint8_t*)0x2000086c = 0; *(uint8_t*)0x2000086d = 0; *(uint8_t*)0x2000086e = 0; *(uint8_t*)0x2000086f = 0; *(uint8_t*)0x20000870 = 0; *(uint8_t*)0x20000871 = 0; *(uint8_t*)0x20000872 = 0; *(uint8_t*)0x20000873 = 0; *(uint8_t*)0x20000874 = 0; *(uint8_t*)0x20000875 = 0; *(uint8_t*)0x20000876 = 0; *(uint8_t*)0x20000877 = 0; *(uint8_t*)0x20000878 = 0; *(uint8_t*)0x20000879 = 0; *(uint8_t*)0x2000087a = 0; *(uint8_t*)0x2000087b = 0; *(uint8_t*)0x2000087c = 0; *(uint8_t*)0x2000087d = 0; *(uint8_t*)0x2000087e = 0; *(uint8_t*)0x2000087f = 0; *(uint8_t*)0x20000880 = 0; *(uint8_t*)0x20000881 = 0; *(uint8_t*)0x20000882 = 0; *(uint8_t*)0x20000883 = 0; *(uint8_t*)0x20000884 = 0; *(uint8_t*)0x20000885 = 0; *(uint8_t*)0x20000886 = 0; *(uint8_t*)0x20000887 = 0; *(uint8_t*)0x20000888 = 0; *(uint8_t*)0x20000889 = 0; *(uint8_t*)0x2000088a = 0; *(uint8_t*)0x2000088b = 0; *(uint32_t*)0x2000088c = 0; *(uint16_t*)0x20000890 = 0x850; *(uint16_t*)0x20000892 = 0x878; *(uint32_t*)0x20000894 = 0; *(uint64_t*)0x20000898 = 0; *(uint64_t*)0x200008a0 = 0; *(uint16_t*)0x200008a8 = 0x7e0; memcpy((void*)0x200008aa, "u32\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000", 29); *(uint8_t*)0x200008c7 = 0; *(uint32_t*)0x200008c8 = 0; *(uint8_t*)0x200008cc = 0; *(uint32_t*)0x200008d0 = 0; *(uint8_t*)0x200008d4 = 0; *(uint32_t*)0x200008d8 = 0; *(uint8_t*)0x200008dc = 0; *(uint32_t*)0x200008e0 = 0; *(uint8_t*)0x200008e4 = 0; *(uint32_t*)0x200008e8 = 0; *(uint8_t*)0x200008ec = 0; *(uint32_t*)0x200008f0 = 0; *(uint8_t*)0x200008f4 = 0; *(uint32_t*)0x200008f8 = 0; *(uint8_t*)0x200008fc = 0; *(uint32_t*)0x20000900 = 0; *(uint8_t*)0x20000904 = 0; *(uint32_t*)0x20000908 = 0; *(uint8_t*)0x2000090c = 0; *(uint32_t*)0x20000910 = 0; *(uint8_t*)0x20000914 = 0; *(uint32_t*)0x20000918 = 0; *(uint8_t*)0x2000091c = 0; *(uint32_t*)0x20000920 = 0; *(uint32_t*)0x20000924 = 0; *(uint32_t*)0x20000928 = 0; *(uint32_t*)0x2000092c = 0; *(uint32_t*)0x20000930 = 0; *(uint32_t*)0x20000934 = 0; *(uint32_t*)0x20000938 = 0; *(uint32_t*)0x2000093c = 0; *(uint32_t*)0x20000940 = 0; *(uint32_t*)0x20000944 = 0; *(uint32_t*)0x20000948 = 0; *(uint32_t*)0x2000094c = 0; *(uint32_t*)0x20000950 = 0; *(uint32_t*)0x20000954 = 0; *(uint32_t*)0x20000958 = 0; *(uint32_t*)0x2000095c = 0; *(uint32_t*)0x20000960 = 0; *(uint32_t*)0x20000964 = 0; *(uint32_t*)0x20000968 = 0; *(uint32_t*)0x2000096c = 0; *(uint32_t*)0x20000970 = 0; *(uint32_t*)0x20000974 = 0; *(uint8_t*)0x20000978 = 0; *(uint8_t*)0x20000979 = 0; *(uint32_t*)0x2000097c = 0; *(uint8_t*)0x20000980 = 0; *(uint32_t*)0x20000984 = 0; *(uint8_t*)0x20000988 = 0; *(uint32_t*)0x2000098c = 0; *(uint8_t*)0x20000990 = 0; *(uint32_t*)0x20000994 = 0; *(uint8_t*)0x20000998 = 0; *(uint32_t*)0x2000099c = 0; *(uint8_t*)0x200009a0 = 0; *(uint32_t*)0x200009a4 = 0; *(uint8_t*)0x200009a8 = 0; *(uint32_t*)0x200009ac = 0; *(uint8_t*)0x200009b0 = 0; *(uint32_t*)0x200009b4 = 0; *(uint8_t*)0x200009b8 = 0; *(uint32_t*)0x200009bc = 0; *(uint8_t*)0x200009c0 = 0; *(uint32_t*)0x200009c4 = 0; *(uint8_t*)0x200009c8 = 0; *(uint32_t*)0x200009cc = 0; *(uint8_t*)0x200009d0 = 0; *(uint32_t*)0x200009d4 = 0; *(uint32_t*)0x200009d8 = 0; *(uint32_t*)0x200009dc = 0; *(uint32_t*)0x200009e0 = 0; *(uint32_t*)0x200009e4 = 0; *(uint32_t*)0x200009e8 = 0; *(uint32_t*)0x200009ec = 0; *(uint32_t*)0x200009f0 = 0; *(uint32_t*)0x200009f4 = 0; *(uint32_t*)0x200009f8 = 0; *(uint32_t*)0x200009fc = 0; *(uint32_t*)0x20000a00 = 0; *(uint32_t*)0x20000a04 = 0; *(uint32_t*)0x20000a08 = 0; *(uint32_t*)0x20000a0c = 0; *(uint32_t*)0x20000a10 = 0; *(uint32_t*)0x20000a14 = 0; *(uint32_t*)0x20000a18 = 0; *(uint32_t*)0x20000a1c = 0; *(uint32_t*)0x20000a20 = 0; *(uint32_t*)0x20000a24 = 0; *(uint32_t*)0x20000a28 = 0; *(uint8_t*)0x20000a2c = 0; *(uint8_t*)0x20000a2d = 0; *(uint32_t*)0x20000a30 = 0; *(uint8_t*)0x20000a34 = 0; *(uint32_t*)0x20000a38 = 0; *(uint8_t*)0x20000a3c = 0; *(uint32_t*)0x20000a40 = 0; *(uint8_t*)0x20000a44 = 0; *(uint32_t*)0x20000a48 = 0; *(uint8_t*)0x20000a4c = 0; *(uint32_t*)0x20000a50 = 0; *(uint8_t*)0x20000a54 = 0; *(uint32_t*)0x20000a58 = 0; *(uint8_t*)0x20000a5c = 0; *(uint32_t*)0x20000a60 = 0; *(uint8_t*)0x20000a64 = 0; *(uint32_t*)0x20000a68 = 0; *(uint8_t*)0x20000a6c = 0; *(uint32_t*)0x20000a70 = 0; *(uint8_t*)0x20000a74 = 0; *(uint32_t*)0x20000a78 = 0; *(uint8_t*)0x20000a7c = 0; *(uint32_t*)0x20000a80 = 0; *(uint8_t*)0x20000a84 = 0; *(uint32_t*)0x20000a88 = 0; *(uint32_t*)0x20000a8c = 0; *(uint32_t*)0x20000a90 = 0; *(uint32_t*)0x20000a94 = 0; *(uint32_t*)0x20000a98 = 0; *(uint32_t*)0x20000a9c = 0; *(uint32_t*)0x20000aa0 = 0; *(uint32_t*)0x20000aa4 = 0; *(uint32_t*)0x20000aa8 = 0; *(uint32_t*)0x20000aac = 0; *(uint32_t*)0x20000ab0 = 0; *(uint32_t*)0x20000ab4 = 0; *(uint32_t*)0x20000ab8 = 0; *(uint32_t*)0x20000abc = 0; *(uint32_t*)0x20000ac0 = 0; *(uint32_t*)0x20000ac4 = 0; *(uint32_t*)0x20000ac8 = 0; *(uint32_t*)0x20000acc = 0; *(uint32_t*)0x20000ad0 = 0; *(uint32_t*)0x20000ad4 = 0; *(uint32_t*)0x20000ad8 = 0; *(uint32_t*)0x20000adc = 0; *(uint8_t*)0x20000ae0 = 0; *(uint8_t*)0x20000ae1 = 0; *(uint32_t*)0x20000ae4 = 0; *(uint8_t*)0x20000ae8 = 0; *(uint32_t*)0x20000aec = 0; *(uint8_t*)0x20000af0 = 0; *(uint32_t*)0x20000af4 = 0; *(uint8_t*)0x20000af8 = 0; *(uint32_t*)0x20000afc = 0; *(uint8_t*)0x20000b00 = 0; *(uint32_t*)0x20000b04 = 0; *(uint8_t*)0x20000b08 = 0; *(uint32_t*)0x20000b0c = 0; *(uint8_t*)0x20000b10 = 0; *(uint32_t*)0x20000b14 = 0; *(uint8_t*)0x20000b18 = 0; *(uint32_t*)0x20000b1c = 0; *(uint8_t*)0x20000b20 = 0; *(uint32_t*)0x20000b24 = 0; *(uint8_t*)0x20000b28 = 0; *(uint32_t*)0x20000b2c = 0; *(uint8_t*)0x20000b30 = 0; *(uint32_t*)0x20000b34 = 0; *(uint8_t*)0x20000b38 = 0; *(uint32_t*)0x20000b3c = 0; *(uint32_t*)0x20000b40 = 0; *(uint32_t*)0x20000b44 = 0; *(uint32_t*)0x20000b48 = 0; *(uint32_t*)0x20000b4c = 0; *(uint32_t*)0x20000b50 = 0; *(uint32_t*)0x20000b54 = 0; *(uint32_t*)0x20000b58 = 0; *(uint32_t*)0x20000b5c = 0; *(uint32_t*)0x20000b60 = 0; *(uint32_t*)0x20000b64 = 0; *(uint32_t*)0x20000b68 = 0; *(uint32_t*)0x20000b6c = 0; *(uint32_t*)0x20000b70 = 0; *(uint32_t*)0x20000b74 = 0; *(uint32_t*)0x20000b78 = 0; *(uint32_t*)0x20000b7c = 0; *(uint32_t*)0x20000b80 = 0; *(uint32_t*)0x20000b84 = 0; *(uint32_t*)0x20000b88 = 0; *(uint32_t*)0x20000b8c = 0; *(uint32_t*)0x20000b90 = 0; *(uint8_t*)0x20000b94 = 0; *(uint8_t*)0x20000b95 = 0; *(uint32_t*)0x20000b98 = 0; *(uint8_t*)0x20000b9c = 0; *(uint32_t*)0x20000ba0 = 0; *(uint8_t*)0x20000ba4 = 0; *(uint32_t*)0x20000ba8 = 0; *(uint8_t*)0x20000bac = 0; *(uint32_t*)0x20000bb0 = 0; *(uint8_t*)0x20000bb4 = 0; *(uint32_t*)0x20000bb8 = 0; *(uint8_t*)0x20000bbc = 0; *(uint32_t*)0x20000bc0 = 0; *(uint8_t*)0x20000bc4 = 0; *(uint32_t*)0x20000bc8 = 0; *(uint8_t*)0x20000bcc = 0; *(uint32_t*)0x20000bd0 = 0; *(uint8_t*)0x20000bd4 = 0; *(uint32_t*)0x20000bd8 = 0; *(uint8_t*)0x20000bdc = 0; *(uint32_t*)0x20000be0 = 0; *(uint8_t*)0x20000be4 = 0; *(uint32_t*)0x20000be8 = 0; *(uint8_t*)0x20000bec = 0; *(uint32_t*)0x20000bf0 = 0; *(uint32_t*)0x20000bf4 = 0; *(uint32_t*)0x20000bf8 = 0; *(uint32_t*)0x20000bfc = 0; *(uint32_t*)0x20000c00 = 0; *(uint32_t*)0x20000c04 = 0; *(uint32_t*)0x20000c08 = 0; *(uint32_t*)0x20000c0c = 0; *(uint32_t*)0x20000c10 = 0; *(uint32_t*)0x20000c14 = 0; *(uint32_t*)0x20000c18 = 0; *(uint32_t*)0x20000c1c = 0; *(uint32_t*)0x20000c20 = 0; *(uint32_t*)0x20000c24 = 0; *(uint32_t*)0x20000c28 = 0; *(uint32_t*)0x20000c2c = 0; *(uint32_t*)0x20000c30 = 0; *(uint32_t*)0x20000c34 = 0; *(uint32_t*)0x20000c38 = 0; *(uint32_t*)0x20000c3c = 0; *(uint32_t*)0x20000c40 = 0; *(uint32_t*)0x20000c44 = 0; *(uint8_t*)0x20000c48 = 0; *(uint8_t*)0x20000c49 = 0; *(uint32_t*)0x20000c4c = 0; *(uint8_t*)0x20000c50 = 0; *(uint32_t*)0x20000c54 = 0; *(uint8_t*)0x20000c58 = 0; *(uint32_t*)0x20000c5c = 0; *(uint8_t*)0x20000c60 = 0; *(uint32_t*)0x20000c64 = 0; *(uint8_t*)0x20000c68 = 0; *(uint32_t*)0x20000c6c = 0; *(uint8_t*)0x20000c70 = 0; *(uint32_t*)0x20000c74 = 0; *(uint8_t*)0x20000c78 = 0; *(uint32_t*)0x20000c7c = 0; *(uint8_t*)0x20000c80 = 0; *(uint32_t*)0x20000c84 = 0; *(uint8_t*)0x20000c88 = 0; *(uint32_t*)0x20000c8c = 0; *(uint8_t*)0x20000c90 = 0; *(uint32_t*)0x20000c94 = 0; *(uint8_t*)0x20000c98 = 0; *(uint32_t*)0x20000c9c = 0; *(uint8_t*)0x20000ca0 = 0; *(uint32_t*)0x20000ca4 = 0; *(uint32_t*)0x20000ca8 = 0; *(uint32_t*)0x20000cac = 0; *(uint32_t*)0x20000cb0 = 0; *(uint32_t*)0x20000cb4 = 0; *(uint32_t*)0x20000cb8 = 0; *(uint32_t*)0x20000cbc = 0; *(uint32_t*)0x20000cc0 = 0; *(uint32_t*)0x20000cc4 = 0; *(uint32_t*)0x20000cc8 = 0; *(uint32_t*)0x20000ccc = 0; *(uint32_t*)0x20000cd0 = 0; *(uint32_t*)0x20000cd4 = 0; *(uint32_t*)0x20000cd8 = 0; *(uint32_t*)0x20000cdc = 0; *(uint32_t*)0x20000ce0 = 0; *(uint32_t*)0x20000ce4 = 0; *(uint32_t*)0x20000ce8 = 0; *(uint32_t*)0x20000cec = 0; *(uint32_t*)0x20000cf0 = 0; *(uint32_t*)0x20000cf4 = 0; *(uint32_t*)0x20000cf8 = 0; *(uint8_t*)0x20000cfc = 0; *(uint8_t*)0x20000cfd = 0; *(uint32_t*)0x20000d00 = 0; *(uint8_t*)0x20000d04 = 0; *(uint32_t*)0x20000d08 = 0; *(uint8_t*)0x20000d0c = 0; *(uint32_t*)0x20000d10 = 0; *(uint8_t*)0x20000d14 = 0; *(uint32_t*)0x20000d18 = 0; *(uint8_t*)0x20000d1c = 0; *(uint32_t*)0x20000d20 = 0; *(uint8_t*)0x20000d24 = 0; *(uint32_t*)0x20000d28 = 0; *(uint8_t*)0x20000d2c = 0; *(uint32_t*)0x20000d30 = 0; *(uint8_t*)0x20000d34 = 0; *(uint32_t*)0x20000d38 = 0; *(uint8_t*)0x20000d3c = 0; *(uint32_t*)0x20000d40 = 0; *(uint8_t*)0x20000d44 = 0; *(uint32_t*)0x20000d48 = 0; *(uint8_t*)0x20000d4c = 0; *(uint32_t*)0x20000d50 = 0; *(uint8_t*)0x20000d54 = 0; *(uint32_t*)0x20000d58 = 0; *(uint32_t*)0x20000d5c = 0; *(uint32_t*)0x20000d60 = 0; *(uint32_t*)0x20000d64 = 0; *(uint32_t*)0x20000d68 = 0; *(uint32_t*)0x20000d6c = 0; *(uint32_t*)0x20000d70 = 0; *(uint32_t*)0x20000d74 = 0; *(uint32_t*)0x20000d78 = 0; *(uint32_t*)0x20000d7c = 0; *(uint32_t*)0x20000d80 = 0; *(uint32_t*)0x20000d84 = 0; *(uint32_t*)0x20000d88 = 0; *(uint32_t*)0x20000d8c = 0; *(uint32_t*)0x20000d90 = 0; *(uint32_t*)0x20000d94 = 0; *(uint32_t*)0x20000d98 = 0; *(uint32_t*)0x20000d9c = 0; *(uint32_t*)0x20000da0 = 0; *(uint32_t*)0x20000da4 = 0; *(uint32_t*)0x20000da8 = 0; *(uint32_t*)0x20000dac = 0; *(uint8_t*)0x20000db0 = 0; *(uint8_t*)0x20000db1 = 0; *(uint32_t*)0x20000db4 = 0; *(uint8_t*)0x20000db8 = 0; *(uint32_t*)0x20000dbc = 0; *(uint8_t*)0x20000dc0 = 0; *(uint32_t*)0x20000dc4 = 0; *(uint8_t*)0x20000dc8 = 0; *(uint32_t*)0x20000dcc = 0; *(uint8_t*)0x20000dd0 = 0; *(uint32_t*)0x20000dd4 = 0; *(uint8_t*)0x20000dd8 = 0; *(uint32_t*)0x20000ddc = 0; *(uint8_t*)0x20000de0 = 0; *(uint32_t*)0x20000de4 = 0; *(uint8_t*)0x20000de8 = 0; *(uint32_t*)0x20000dec = 0; *(uint8_t*)0x20000df0 = 0; *(uint32_t*)0x20000df4 = 0; *(uint8_t*)0x20000df8 = 0; *(uint32_t*)0x20000dfc = 0; *(uint8_t*)0x20000e00 = 0; *(uint32_t*)0x20000e04 = 0; *(uint8_t*)0x20000e08 = 0; *(uint32_t*)0x20000e0c = 0; *(uint32_t*)0x20000e10 = 0; *(uint32_t*)0x20000e14 = 0; *(uint32_t*)0x20000e18 = 0; *(uint32_t*)0x20000e1c = 0; *(uint32_t*)0x20000e20 = 0; *(uint32_t*)0x20000e24 = 0; *(uint32_t*)0x20000e28 = 0; *(uint32_t*)0x20000e2c = 0; *(uint32_t*)0x20000e30 = 0; *(uint32_t*)0x20000e34 = 0; *(uint32_t*)0x20000e38 = 0; *(uint32_t*)0x20000e3c = 0; *(uint32_t*)0x20000e40 = 0; *(uint32_t*)0x20000e44 = 0; *(uint32_t*)0x20000e48 = 0; *(uint32_t*)0x20000e4c = 0; *(uint32_t*)0x20000e50 = 0; *(uint32_t*)0x20000e54 = 0; *(uint32_t*)0x20000e58 = 0; *(uint32_t*)0x20000e5c = 0; *(uint32_t*)0x20000e60 = 0; *(uint8_t*)0x20000e64 = 0; *(uint8_t*)0x20000e65 = 0; *(uint32_t*)0x20000e68 = 0; *(uint8_t*)0x20000e6c = 0; *(uint32_t*)0x20000e70 = 0; *(uint8_t*)0x20000e74 = 0; *(uint32_t*)0x20000e78 = 0; *(uint8_t*)0x20000e7c = 0; *(uint32_t*)0x20000e80 = 0; *(uint8_t*)0x20000e84 = 0; *(uint32_t*)0x20000e88 = 0; *(uint8_t*)0x20000e8c = 0; *(uint32_t*)0x20000e90 = 0; *(uint8_t*)0x20000e94 = 0; *(uint32_t*)0x20000e98 = 0; *(uint8_t*)0x20000e9c = 0; *(uint32_t*)0x20000ea0 = 0; *(uint8_t*)0x20000ea4 = 0; *(uint32_t*)0x20000ea8 = 0; *(uint8_t*)0x20000eac = 0; *(uint32_t*)0x20000eb0 = 0; *(uint8_t*)0x20000eb4 = 0; *(uint32_t*)0x20000eb8 = 0; *(uint8_t*)0x20000ebc = 0; *(uint32_t*)0x20000ec0 = 0; *(uint32_t*)0x20000ec4 = 0; *(uint32_t*)0x20000ec8 = 0; *(uint32_t*)0x20000ecc = 0; *(uint32_t*)0x20000ed0 = 0; *(uint32_t*)0x20000ed4 = 0; *(uint32_t*)0x20000ed8 = 0; *(uint32_t*)0x20000edc = 0; *(uint32_t*)0x20000ee0 = 0; *(uint32_t*)0x20000ee4 = 0; *(uint32_t*)0x20000ee8 = 0; *(uint32_t*)0x20000eec = 0; *(uint32_t*)0x20000ef0 = 0; *(uint32_t*)0x20000ef4 = 0; *(uint32_t*)0x20000ef8 = 0; *(uint32_t*)0x20000efc = 0; *(uint32_t*)0x20000f00 = 0; *(uint32_t*)0x20000f04 = 0; *(uint32_t*)0x20000f08 = 0; *(uint32_t*)0x20000f0c = 0; *(uint32_t*)0x20000f10 = 0; *(uint32_t*)0x20000f14 = 0; *(uint8_t*)0x20000f18 = 0; *(uint8_t*)0x20000f19 = 0; *(uint32_t*)0x20000f1c = 0; *(uint8_t*)0x20000f20 = 0; *(uint32_t*)0x20000f24 = 0; *(uint8_t*)0x20000f28 = 0; *(uint32_t*)0x20000f2c = 0; *(uint8_t*)0x20000f30 = 0; *(uint32_t*)0x20000f34 = 0; *(uint8_t*)0x20000f38 = 0; *(uint32_t*)0x20000f3c = 0; *(uint8_t*)0x20000f40 = 0; *(uint32_t*)0x20000f44 = 0; *(uint8_t*)0x20000f48 = 0; *(uint32_t*)0x20000f4c = 0; *(uint8_t*)0x20000f50 = 0; *(uint32_t*)0x20000f54 = 0; *(uint8_t*)0x20000f58 = 0; *(uint32_t*)0x20000f5c = 0; *(uint8_t*)0x20000f60 = 0; *(uint32_t*)0x20000f64 = 0; *(uint8_t*)0x20000f68 = 0; *(uint32_t*)0x20000f6c = 0; *(uint8_t*)0x20000f70 = 0; *(uint32_t*)0x20000f74 = 0; *(uint32_t*)0x20000f78 = 0; *(uint32_t*)0x20000f7c = 0; *(uint32_t*)0x20000f80 = 0; *(uint32_t*)0x20000f84 = 0; *(uint32_t*)0x20000f88 = 0; *(uint32_t*)0x20000f8c = 0; *(uint32_t*)0x20000f90 = 0; *(uint32_t*)0x20000f94 = 0; *(uint32_t*)0x20000f98 = 0; *(uint32_t*)0x20000f9c = 0; *(uint32_t*)0x20000fa0 = 0; *(uint32_t*)0x20000fa4 = 0; *(uint32_t*)0x20000fa8 = 0; *(uint32_t*)0x20000fac = 0; *(uint32_t*)0x20000fb0 = 0; *(uint32_t*)0x20000fb4 = 0; *(uint32_t*)0x20000fb8 = 0; *(uint32_t*)0x20000fbc = 0; *(uint32_t*)0x20000fc0 = 0; *(uint32_t*)0x20000fc4 = 0; *(uint32_t*)0x20000fc8 = 0; *(uint8_t*)0x20000fcc = 0; *(uint8_t*)0x20000fcd = 0; *(uint32_t*)0x20000fd0 = 0; *(uint8_t*)0x20000fd4 = 0; *(uint32_t*)0x20000fd8 = 0; *(uint8_t*)0x20000fdc = 0; *(uint32_t*)0x20000fe0 = 0; *(uint8_t*)0x20000fe4 = 0; *(uint32_t*)0x20000fe8 = 0; *(uint8_t*)0x20000fec = 0; *(uint32_t*)0x20000ff0 = 0; *(uint8_t*)0x20000ff4 = 0; *(uint32_t*)0x20000ff8 = 0; *(uint8_t*)0x20000ffc = 0; *(uint32_t*)0x20001000 = 0; *(uint8_t*)0x20001004 = 0; *(uint32_t*)0x20001008 = 0; *(uint8_t*)0x2000100c = 0; *(uint32_t*)0x20001010 = 0; *(uint8_t*)0x20001014 = 0; *(uint32_t*)0x20001018 = 0; *(uint8_t*)0x2000101c = 0; *(uint32_t*)0x20001020 = 0; *(uint8_t*)0x20001024 = 0; *(uint32_t*)0x20001028 = 0; *(uint32_t*)0x2000102c = 0; *(uint32_t*)0x20001030 = 0; *(uint32_t*)0x20001034 = 0; *(uint32_t*)0x20001038 = 0; *(uint32_t*)0x2000103c = 0; *(uint32_t*)0x20001040 = 0; *(uint32_t*)0x20001044 = 0; *(uint32_t*)0x20001048 = 0; *(uint32_t*)0x2000104c = 0; *(uint32_t*)0x20001050 = 0; *(uint32_t*)0x20001054 = 0; *(uint32_t*)0x20001058 = 0; *(uint32_t*)0x2000105c = 0; *(uint32_t*)0x20001060 = 0; *(uint32_t*)0x20001064 = 0; *(uint32_t*)0x20001068 = 0; *(uint32_t*)0x2000106c = 0; *(uint32_t*)0x20001070 = 0; *(uint32_t*)0x20001074 = 0; *(uint32_t*)0x20001078 = 0; *(uint32_t*)0x2000107c = 0; *(uint8_t*)0x20001080 = 0; *(uint8_t*)0x20001081 = 0; *(uint8_t*)0x20001084 = 0; *(uint8_t*)0x20001085 = 0; *(uint16_t*)0x20001088 = 0x28; memcpy((void*)0x2000108a, "NFQUEUE\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000" "\000", 29); *(uint8_t*)0x200010a7 = 3; *(uint16_t*)0x200010a8 = 0; *(uint16_t*)0x200010aa = 1; *(uint16_t*)0x200010ac = 0; *(uint8_t*)0x200010b0 = 0; *(uint8_t*)0x200010b1 = 0; *(uint8_t*)0x200010b2 = 0; *(uint8_t*)0x200010b3 = 0; *(uint8_t*)0x200010b4 = 0; *(uint8_t*)0x200010b5 = 0; *(uint8_t*)0x200010b6 = 0; *(uint8_t*)0x200010b7 = 0; *(uint8_t*)0x200010b8 = 0; *(uint8_t*)0x200010b9 = 0; *(uint8_t*)0x200010ba = 0; *(uint8_t*)0x200010bb = 0; *(uint8_t*)0x200010bc = 0; *(uint8_t*)0x200010bd = 0; *(uint8_t*)0x200010be = 0; *(uint8_t*)0x200010bf = 0; *(uint8_t*)0x200010c0 = 0; *(uint8_t*)0x200010c1 = 0; *(uint8_t*)0x200010c2 = 0; *(uint8_t*)0x200010c3 = 0; *(uint8_t*)0x200010c4 = 0; *(uint8_t*)0x200010c5 = 0; *(uint8_t*)0x200010c6 = 0; *(uint8_t*)0x200010c7 = 0; *(uint8_t*)0x200010c8 = 0; *(uint8_t*)0x200010c9 = 0; *(uint8_t*)0x200010ca = 0; *(uint8_t*)0x200010cb = 0; *(uint8_t*)0x200010cc = 0; *(uint8_t*)0x200010cd = 0; *(uint8_t*)0x200010ce = 0; *(uint8_t*)0x200010cf = 0; *(uint8_t*)0x200010d0 = 0; *(uint8_t*)0x200010d1 = 0; *(uint8_t*)0x200010d2 = 0; *(uint8_t*)0x200010d3 = 0; *(uint8_t*)0x200010d4 = 0; *(uint8_t*)0x200010d5 = 0; *(uint8_t*)0x200010d6 = 0; *(uint8_t*)0x200010d7 = 0; *(uint8_t*)0x200010d8 = 0; *(uint8_t*)0x200010d9 = 0; *(uint8_t*)0x200010da = 0; *(uint8_t*)0x200010db = 0; *(uint8_t*)0x200010dc = 0; *(uint8_t*)0x200010dd = 0; *(uint8_t*)0x200010de = 0; *(uint8_t*)0x200010df = 0; *(uint8_t*)0x200010e0 = 0; *(uint8_t*)0x200010e1 = 0; *(uint8_t*)0x200010e2 = 0; *(uint8_t*)0x200010e3 = 0; *(uint8_t*)0x200010e4 = 0; *(uint8_t*)0x200010e5 = 0; *(uint8_t*)0x200010e6 = 0; *(uint8_t*)0x200010e7 = 0; *(uint8_t*)0x200010e8 = 0; *(uint8_t*)0x200010e9 = 0; *(uint8_t*)0x200010ea = 0; *(uint8_t*)0x200010eb = 0; *(uint8_t*)0x200010ec = 0; *(uint8_t*)0x200010ed = 0; *(uint8_t*)0x200010ee = 0; *(uint8_t*)0x200010ef = 0; *(uint8_t*)0x200010f0 = 0; *(uint8_t*)0x200010f1 = 0; *(uint8_t*)0x200010f2 = 0; *(uint8_t*)0x200010f3 = 0; *(uint8_t*)0x200010f4 = 0; *(uint8_t*)0x200010f5 = 0; *(uint8_t*)0x200010f6 = 0; *(uint8_t*)0x200010f7 = 0; *(uint8_t*)0x200010f8 = 0; *(uint8_t*)0x200010f9 = 0; *(uint8_t*)0x200010fa = 0; *(uint8_t*)0x200010fb = 0; *(uint8_t*)0x200010fc = 0; *(uint8_t*)0x200010fd = 0; *(uint8_t*)0x200010fe = 0; *(uint8_t*)0x200010ff = 0; *(uint8_t*)0x20001100 = 0; *(uint8_t*)0x20001101 = 0; *(uint8_t*)0x20001102 = 0; *(uint8_t*)0x20001103 = 0; *(uint32_t*)0x20001104 = 0; *(uint16_t*)0x20001108 = 0x70; *(uint16_t*)0x2000110a = 0x98; *(uint32_t*)0x2000110c = 0; *(uint64_t*)0x20001110 = 0; *(uint64_t*)0x20001118 = 0; *(uint16_t*)0x20001120 = 0x28; memcpy((void*)0x20001122, "\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000", 29); *(uint8_t*)0x2000113f = 0; *(uint32_t*)0x20001140 = 0xfffffffe; syscall(__NR_setsockopt, r[1], 0, 0x40, 0x20000740ul, 0xa08ul); break; } } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); loop(); return 0; }