| // lost connection to test machine (3) |
| // https://syzkaller.appspot.com/bug?id=be2e39518462291fd049f665261632ded34b79fd |
| // status:fixed |
| // autogenerated by syzkaller (http://github.com/google/syzkaller) |
| |
| #define _GNU_SOURCE |
| #include <arpa/inet.h> |
| #include <dirent.h> |
| #include <endian.h> |
| #include <errno.h> |
| #include <errno.h> |
| #include <fcntl.h> |
| #include <fcntl.h> |
| #include <linux/futex.h> |
| #include <linux/if.h> |
| #include <linux/if_ether.h> |
| #include <linux/if_tun.h> |
| #include <linux/ip.h> |
| #include <linux/net.h> |
| #include <linux/tcp.h> |
| #include <net/if_arp.h> |
| #include <netinet/in.h> |
| #include <pthread.h> |
| #include <signal.h> |
| #include <stdarg.h> |
| #include <stdarg.h> |
| #include <stdbool.h> |
| #include <stdio.h> |
| #include <stdio.h> |
| #include <stdio.h> |
| #include <stdlib.h> |
| #include <stdlib.h> |
| #include <string.h> |
| #include <sys/ioctl.h> |
| #include <sys/mount.h> |
| #include <sys/prctl.h> |
| #include <sys/socket.h> |
| #include <sys/stat.h> |
| #include <sys/stat.h> |
| #include <sys/syscall.h> |
| #include <sys/time.h> |
| #include <sys/uio.h> |
| #include <sys/wait.h> |
| #include <time.h> |
| #include <unistd.h> |
| |
| __attribute__((noreturn)) static void doexit(int status) |
| { |
| volatile unsigned i; |
| syscall(__NR_exit_group, status); |
| for (i = 0;; i++) { |
| } |
| } |
| #include <errno.h> |
| #include <stdarg.h> |
| #include <stdint.h> |
| #include <stdio.h> |
| #include <stdlib.h> |
| #include <string.h> |
| #include <sys/stat.h> |
| |
| const int kFailStatus = 67; |
| const int kRetryStatus = 69; |
| |
| static void fail(const char* msg, ...) |
| { |
| int e = errno; |
| va_list args; |
| va_start(args, msg); |
| vfprintf(stderr, msg, args); |
| va_end(args); |
| fprintf(stderr, " (errno %d)\n", e); |
| doexit((e == ENOMEM || e == EAGAIN) ? kRetryStatus : kFailStatus); |
| } |
| |
| static void exitf(const char* msg, ...) |
| { |
| int e = errno; |
| va_list args; |
| va_start(args, msg); |
| vfprintf(stderr, msg, args); |
| va_end(args); |
| fprintf(stderr, " (errno %d)\n", e); |
| doexit(kRetryStatus); |
| } |
| |
| #define BITMASK_LEN(type, bf_len) (type)((1ull << (bf_len)) - 1) |
| |
| #define BITMASK_LEN_OFF(type, bf_off, bf_len) \ |
| (type)(BITMASK_LEN(type, (bf_len)) << (bf_off)) |
| |
| #define STORE_BY_BITMASK(type, addr, val, bf_off, bf_len) \ |
| if ((bf_off) == 0 && (bf_len) == 0) { \ |
| *(type*)(addr) = (type)(val); \ |
| } else { \ |
| type new_val = *(type*)(addr); \ |
| new_val &= ~BITMASK_LEN_OFF(type, (bf_off), (bf_len)); \ |
| new_val |= ((type)(val)&BITMASK_LEN(type, (bf_len))) << (bf_off); \ |
| *(type*)(addr) = new_val; \ |
| } |
| |
| static uint64_t current_time_ms() |
| { |
| struct timespec ts; |
| |
| if (clock_gettime(CLOCK_MONOTONIC, &ts)) |
| fail("clock_gettime failed"); |
| return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; |
| } |
| |
| static void use_temporary_dir() |
| { |
| char tmpdir_template[] = "./syzkaller.XXXXXX"; |
| char* tmpdir = mkdtemp(tmpdir_template); |
| if (!tmpdir) |
| fail("failed to mkdtemp"); |
| if (chmod(tmpdir, 0777)) |
| fail("failed to chmod"); |
| if (chdir(tmpdir)) |
| fail("failed to chdir"); |
| } |
| |
| static void vsnprintf_check(char* str, size_t size, const char* format, |
| va_list args) |
| { |
| int rv; |
| |
| rv = vsnprintf(str, size, format, args); |
| if (rv < 0) |
| fail("tun: snprintf failed"); |
| if ((size_t)rv >= size) |
| fail("tun: string '%s...' doesn't fit into buffer", str); |
| } |
| |
| static void snprintf_check(char* str, size_t size, const char* format, ...) |
| { |
| va_list args; |
| |
| va_start(args, format); |
| vsnprintf_check(str, size, format, args); |
| va_end(args); |
| } |
| |
| #define COMMAND_MAX_LEN 128 |
| #define PATH_PREFIX \ |
| "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin " |
| #define PATH_PREFIX_LEN (sizeof(PATH_PREFIX) - 1) |
| |
| static void execute_command(bool panic, const char* format, ...) |
| { |
| va_list args; |
| char command[PATH_PREFIX_LEN + COMMAND_MAX_LEN]; |
| int rv; |
| |
| va_start(args, format); |
| memcpy(command, PATH_PREFIX, PATH_PREFIX_LEN); |
| vsnprintf_check(command + PATH_PREFIX_LEN, COMMAND_MAX_LEN, format, args); |
| rv = system(command); |
| if (panic && rv != 0) |
| fail("tun: command \"%s\" failed with code %d", &command[0], rv); |
| |
| va_end(args); |
| } |
| |
| static int tunfd = -1; |
| static int tun_frags_enabled; |
| |
| #define SYZ_TUN_MAX_PACKET_SIZE 1000 |
| |
| #define MAX_PIDS 32 |
| #define ADDR_MAX_LEN 32 |
| |
| #define LOCAL_MAC "aa:aa:aa:aa:%02hx:aa" |
| #define REMOTE_MAC "aa:aa:aa:aa:%02hx:bb" |
| |
| #define LOCAL_IPV4 "172.20.%d.170" |
| #define REMOTE_IPV4 "172.20.%d.187" |
| |
| #define LOCAL_IPV6 "fe80::%02hx:aa" |
| #define REMOTE_IPV6 "fe80::%02hx:bb" |
| |
| #define IFF_NAPI 0x0010 |
| #define IFF_NAPI_FRAGS 0x0020 |
| |
| static void initialize_tun(int id) |
| { |
| if (id >= MAX_PIDS) |
| fail("tun: no more than %d executors", MAX_PIDS); |
| |
| tunfd = open("/dev/net/tun", O_RDWR | O_NONBLOCK); |
| if (tunfd == -1) { |
| printf("tun: can't open /dev/net/tun: please enable CONFIG_TUN=y\n"); |
| printf("otherwise fuzzing or reproducing might not work as intended\n"); |
| return; |
| } |
| |
| char iface[IFNAMSIZ]; |
| snprintf_check(iface, sizeof(iface), "syz%d", id); |
| |
| struct ifreq ifr; |
| memset(&ifr, 0, sizeof(ifr)); |
| strncpy(ifr.ifr_name, iface, IFNAMSIZ); |
| ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_NAPI | IFF_NAPI_FRAGS; |
| if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) { |
| ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
| if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) |
| fail("tun: ioctl(TUNSETIFF) failed"); |
| } |
| if (ioctl(tunfd, TUNGETIFF, (void*)&ifr) < 0) |
| fail("tun: ioctl(TUNGETIFF) failed"); |
| tun_frags_enabled = (ifr.ifr_flags & IFF_NAPI_FRAGS) != 0; |
| |
| char local_mac[ADDR_MAX_LEN]; |
| snprintf_check(local_mac, sizeof(local_mac), LOCAL_MAC, id); |
| char remote_mac[ADDR_MAX_LEN]; |
| snprintf_check(remote_mac, sizeof(remote_mac), REMOTE_MAC, id); |
| |
| char local_ipv4[ADDR_MAX_LEN]; |
| snprintf_check(local_ipv4, sizeof(local_ipv4), LOCAL_IPV4, id); |
| char remote_ipv4[ADDR_MAX_LEN]; |
| snprintf_check(remote_ipv4, sizeof(remote_ipv4), REMOTE_IPV4, id); |
| |
| char local_ipv6[ADDR_MAX_LEN]; |
| snprintf_check(local_ipv6, sizeof(local_ipv6), LOCAL_IPV6, id); |
| char remote_ipv6[ADDR_MAX_LEN]; |
| snprintf_check(remote_ipv6, sizeof(remote_ipv6), REMOTE_IPV6, id); |
| |
| execute_command(1, "sysctl -w net.ipv6.conf.%s.accept_dad=0", iface); |
| |
| execute_command(1, "sysctl -w net.ipv6.conf.%s.router_solicitations=0", |
| iface); |
| |
| execute_command(1, "ip link set dev %s address %s", iface, local_mac); |
| execute_command(1, "ip addr add %s/24 dev %s", local_ipv4, iface); |
| execute_command(1, "ip -6 addr add %s/120 dev %s", local_ipv6, iface); |
| execute_command(1, "ip neigh add %s lladdr %s dev %s nud permanent", |
| remote_ipv4, remote_mac, iface); |
| execute_command(1, "ip -6 neigh add %s lladdr %s dev %s nud permanent", |
| remote_ipv6, remote_mac, iface); |
| execute_command(1, "ip link set dev %s up", iface); |
| } |
| |
| #define DEV_IPV4 "172.20.%d.%d" |
| #define DEV_IPV6 "fe80::%02hx:%02hx" |
| #define DEV_MAC "aa:aa:aa:aa:%02hx:%02hx" |
| |
| static void initialize_netdevices(int id) |
| { |
| unsigned i; |
| const char* devtypes[] = {"ip6gretap", "bridge", "vcan"}; |
| const char* devnames[] = {"lo", "sit0", "bridge0", "vcan0", |
| "tunl0", "gre0", "gretap0", "ip_vti0", |
| "ip6_vti0", "ip6tnl0", "ip6gre0", "ip6gretap0", |
| "erspan0"}; |
| |
| for (i = 0; i < sizeof(devtypes) / (sizeof(devtypes[0])); i++) |
| execute_command(0, "ip link add dev %s0 type %s", devtypes[i], devtypes[i]); |
| for (i = 0; i < sizeof(devnames) / (sizeof(devnames[0])); i++) { |
| char addr[ADDR_MAX_LEN]; |
| snprintf_check(addr, sizeof(addr), DEV_IPV4, id, id + 10); |
| execute_command(0, "ip -4 addr add %s/24 dev %s", addr, devnames[i]); |
| snprintf_check(addr, sizeof(addr), DEV_IPV6, id, id + 10); |
| execute_command(0, "ip -6 addr add %s/120 dev %s", addr, devnames[i]); |
| snprintf_check(addr, sizeof(addr), DEV_MAC, id, id + 10); |
| execute_command(0, "ip link set dev %s address %s", devnames[i], addr); |
| execute_command(0, "ip link set dev %s up", devnames[i]); |
| } |
| } |
| |
| static void setup_tun(uint64_t pid, bool enable_tun) |
| { |
| if (enable_tun) { |
| initialize_tun(pid); |
| initialize_netdevices(pid); |
| } |
| } |
| |
| static int read_tun(char* data, int size) |
| { |
| if (tunfd < 0) |
| return -1; |
| |
| int rv = read(tunfd, data, size); |
| if (rv < 0) { |
| if (errno == EAGAIN) |
| return -1; |
| if (errno == EBADFD) |
| return -1; |
| fail("tun: read failed with %d", rv); |
| } |
| return rv; |
| } |
| |
| static void flush_tun() |
| { |
| char data[SYZ_TUN_MAX_PACKET_SIZE]; |
| while (read_tun(&data[0], sizeof(data)) != -1) |
| ; |
| } |
| |
| static uintptr_t syz_open_procfs(uintptr_t a0, uintptr_t a1) |
| { |
| |
| char buf[128]; |
| memset(buf, 0, sizeof(buf)); |
| if (a0 == 0) { |
| snprintf(buf, sizeof(buf), "/proc/self/%s", (char*)a1); |
| } else if (a0 == (uintptr_t)-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; |
| } |
| |
| struct ipt_getinfo { |
| char name[32]; |
| unsigned int valid_hooks; |
| unsigned int hook_entry[5]; |
| unsigned int underflow[5]; |
| unsigned int num_entries; |
| unsigned int size; |
| }; |
| |
| struct ipt_get_entries { |
| char name[32]; |
| unsigned int size; |
| void* entrytable[1024 / sizeof(void*)]; |
| }; |
| |
| struct xt_counters { |
| uint64_t pcnt, bcnt; |
| }; |
| |
| struct ipt_replace { |
| char name[32]; |
| unsigned int valid_hooks; |
| unsigned int num_entries; |
| unsigned int size; |
| unsigned int hook_entry[5]; |
| unsigned int underflow[5]; |
| unsigned int num_counters; |
| struct xt_counters* counters; |
| char entrytable[1024]; |
| }; |
| |
| struct ipt_table_desc { |
| const char* name; |
| struct ipt_getinfo info; |
| struct ipt_get_entries entries; |
| struct ipt_replace replace; |
| struct xt_counters counters[10]; |
| }; |
| |
| static struct ipt_table_desc ipv4_tables[] = { |
| {.name = "filter"}, {.name = "nat"}, {.name = "mangle"}, |
| {.name = "raw"}, {.name = "security"}, |
| }; |
| |
| #define IPT_BASE_CTL 64 |
| #define IPT_SO_SET_REPLACE (IPT_BASE_CTL) |
| #define IPT_SO_GET_INFO (IPT_BASE_CTL) |
| #define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1) |
| |
| static void checkpoint_net_namespace(void) |
| { |
| socklen_t optlen; |
| unsigned i; |
| int fd; |
| |
| fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
| if (fd == -1) |
| fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)"); |
| for (i = 0; i < sizeof(ipv4_tables) / sizeof(ipv4_tables[0]); i++) { |
| struct ipt_table_desc* table = &ipv4_tables[i]; |
| strcpy(table->info.name, table->name); |
| strcpy(table->entries.name, table->name); |
| strcpy(table->replace.name, table->name); |
| optlen = sizeof(table->info); |
| if (getsockopt(fd, SOL_IP, IPT_SO_GET_INFO, &table->info, &optlen)) { |
| switch (errno) { |
| case EPERM: |
| case ENOENT: |
| case ENOPROTOOPT: |
| continue; |
| } |
| fail("getsockopt(IPT_SO_GET_INFO)"); |
| } |
| if (table->info.size > sizeof(table->entries.entrytable)) |
| fail("table size is too large: %u", table->info.size); |
| if (table->info.num_entries > |
| sizeof(table->counters) / sizeof(table->counters[0])) |
| fail("too many counters: %u", table->info.num_entries); |
| table->entries.size = table->info.size; |
| optlen = sizeof(table->entries) - sizeof(table->entries.entrytable) + |
| table->info.size; |
| if (getsockopt(fd, SOL_IP, IPT_SO_GET_ENTRIES, &table->entries, &optlen)) |
| fail("getsockopt(IPT_SO_GET_ENTRIES)"); |
| table->replace.valid_hooks = table->info.valid_hooks; |
| table->replace.num_entries = table->info.num_entries; |
| table->replace.counters = table->counters; |
| table->replace.size = table->info.size; |
| memcpy(table->replace.hook_entry, table->info.hook_entry, |
| sizeof(table->replace.hook_entry)); |
| memcpy(table->replace.underflow, table->info.underflow, |
| sizeof(table->replace.underflow)); |
| memcpy(table->replace.entrytable, table->entries.entrytable, |
| table->info.size); |
| } |
| close(fd); |
| } |
| |
| static void reset_net_namespace(void) |
| { |
| struct ipt_get_entries entries; |
| struct ipt_getinfo info; |
| socklen_t optlen; |
| unsigned i; |
| int fd; |
| |
| memset(&info, 0, sizeof(info)); |
| memset(&entries, 0, sizeof(entries)); |
| fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
| if (fd == -1) |
| fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)"); |
| for (i = 0; i < sizeof(ipv4_tables) / sizeof(ipv4_tables[0]); i++) { |
| struct ipt_table_desc* table = &ipv4_tables[i]; |
| if (table->info.valid_hooks == 0) |
| continue; |
| strcpy(info.name, table->name); |
| optlen = sizeof(info); |
| if (getsockopt(fd, SOL_IP, IPT_SO_GET_INFO, &info, &optlen)) |
| fail("getsockopt(IPT_SO_GET_INFO)"); |
| if (memcmp(&table->info, &info, sizeof(table->info)) == 0) { |
| strcpy(entries.name, table->name); |
| entries.size = table->info.size; |
| optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size; |
| if (getsockopt(fd, SOL_IP, IPT_SO_GET_ENTRIES, &entries, &optlen)) |
| fail("getsockopt(IPT_SO_GET_ENTRIES)"); |
| if (memcmp(&table->entries, &entries, optlen) == 0) |
| continue; |
| } |
| table->replace.num_counters = info.num_entries; |
| optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + |
| table->replace.size; |
| if (setsockopt(fd, SOL_IP, IPT_SO_SET_REPLACE, &table->replace, optlen)) |
| fail("setsockopt(IPT_SO_SET_REPLACE)"); |
| } |
| close(fd); |
| } |
| |
| static void remove_dir(const char* dir) |
| { |
| DIR* dp; |
| struct dirent* ep; |
| int iter = 0; |
| retry: |
| dp = opendir(dir); |
| if (dp == NULL) { |
| if (errno == EMFILE) { |
| exitf("opendir(%s) failed due to NOFILE, exiting", dir); |
| } |
| exitf("opendir(%s) failed", dir); |
| } |
| while ((ep = readdir(dp))) { |
| if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) |
| continue; |
| char filename[FILENAME_MAX]; |
| snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); |
| struct stat st; |
| if (lstat(filename, &st)) |
| exitf("lstat(%s) failed", filename); |
| if (S_ISDIR(st.st_mode)) { |
| remove_dir(filename); |
| continue; |
| } |
| int i; |
| for (i = 0;; i++) { |
| if (unlink(filename) == 0) |
| break; |
| if (errno == EROFS) { |
| break; |
| } |
| if (errno != EBUSY || i > 100) |
| exitf("unlink(%s) failed", filename); |
| if (umount2(filename, MNT_DETACH)) |
| exitf("umount(%s) failed", filename); |
| } |
| } |
| closedir(dp); |
| int i; |
| for (i = 0;; i++) { |
| if (rmdir(dir) == 0) |
| break; |
| if (i < 100) { |
| if (errno == EROFS) { |
| break; |
| } |
| if (errno == EBUSY) { |
| if (umount2(dir, MNT_DETACH)) |
| exitf("umount(%s) failed", dir); |
| continue; |
| } |
| if (errno == ENOTEMPTY) { |
| if (iter < 100) { |
| iter++; |
| goto retry; |
| } |
| } |
| } |
| exitf("rmdir(%s) failed", dir); |
| } |
| } |
| |
| static void test(); |
| |
| void loop() |
| { |
| int iter; |
| checkpoint_net_namespace(); |
| for (iter = 0;; iter++) { |
| char cwdbuf[256]; |
| sprintf(cwdbuf, "./%d", iter); |
| if (mkdir(cwdbuf, 0777)) |
| fail("failed to mkdir"); |
| int pid = fork(); |
| if (pid < 0) |
| fail("loop fork failed"); |
| if (pid == 0) { |
| prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); |
| setpgrp(); |
| if (chdir(cwdbuf)) |
| fail("failed to chdir"); |
| flush_tun(); |
| test(); |
| doexit(0); |
| } |
| int status = 0; |
| uint64_t start = current_time_ms(); |
| for (;;) { |
| int res = waitpid(-1, &status, __WALL | WNOHANG); |
| if (res == pid) |
| break; |
| usleep(1000); |
| if (current_time_ms() - start > 5 * 1000) { |
| kill(-pid, SIGKILL); |
| kill(pid, SIGKILL); |
| while (waitpid(-1, &status, __WALL) != pid) { |
| } |
| break; |
| } |
| } |
| remove_dir(cwdbuf); |
| reset_net_namespace(); |
| } |
| } |
| |
| struct thread_t { |
| int created, running, call; |
| pthread_t th; |
| }; |
| |
| static struct thread_t threads[16]; |
| static void execute_call(int call); |
| static int running; |
| static int collide; |
| |
| static void* thr(void* arg) |
| { |
| struct thread_t* th = (struct thread_t*)arg; |
| for (;;) { |
| while (!__atomic_load_n(&th->running, __ATOMIC_ACQUIRE)) |
| syscall(SYS_futex, &th->running, FUTEX_WAIT, 0, 0); |
| execute_call(th->call); |
| __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); |
| __atomic_store_n(&th->running, 0, __ATOMIC_RELEASE); |
| syscall(SYS_futex, &th->running, FUTEX_WAKE); |
| } |
| return 0; |
| } |
| |
| static void execute(int num_calls) |
| { |
| int call, thread; |
| running = 0; |
| for (call = 0; call < num_calls; call++) { |
| for (thread = 0; thread < sizeof(threads) / sizeof(threads[0]); thread++) { |
| struct thread_t* th = &threads[thread]; |
| if (!th->created) { |
| th->created = 1; |
| pthread_attr_t attr; |
| pthread_attr_init(&attr); |
| pthread_attr_setstacksize(&attr, 128 << 10); |
| pthread_create(&th->th, &attr, thr, th); |
| } |
| if (!__atomic_load_n(&th->running, __ATOMIC_ACQUIRE)) { |
| th->call = call; |
| __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); |
| __atomic_store_n(&th->running, 1, __ATOMIC_RELEASE); |
| syscall(SYS_futex, &th->running, FUTEX_WAKE); |
| if (collide && call % 2) |
| break; |
| struct timespec ts; |
| ts.tv_sec = 0; |
| ts.tv_nsec = 20 * 1000 * 1000; |
| syscall(SYS_futex, &th->running, FUTEX_WAIT, 1, &ts); |
| if (running) |
| usleep((call == num_calls - 1) ? 10000 : 1000); |
| break; |
| } |
| } |
| } |
| } |
| |
| long r[4]; |
| void execute_call(int call) |
| { |
| switch (call) { |
| case 0: |
| syscall(__NR_mmap, 0x20000000, 0x18000, 3, 0x32, -1, 0); |
| break; |
| case 1: |
| syscall(__NR_mmap, 0x20018000, 0x1000, 3, 0x32, -1, 0); |
| break; |
| case 2: |
| syscall(__NR_mmap, 0x20019000, 0x1000, 3, 0x32, -1, 0); |
| break; |
| case 3: |
| memcpy((void*)0x20005ff0, "/selinux/policy", 16); |
| r[0] = syscall(__NR_openat, 0xffffffffffffff9c, 0x20005ff0, 0, 0); |
| break; |
| case 4: |
| *(uint32_t*)0x2000ef44 = 0x7ff; |
| *(uint32_t*)0x2000ef48 = 0; |
| memcpy((void*)0x2000ef4c, |
| "\x63\x6c\x69\x65\x6e\x74\x31\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\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", |
| 64); |
| *(uint32_t*)0x2000ef8c = 0x80000000; |
| memcpy((void*)0x2000ef90, "\x84\x72\x34\x95\x4a\x0e\x68\x49", 8); |
| memcpy((void*)0x2000ef98, "\x22\x2c\xb5\x24\xe7\x7f\x21\x6f\x05\x09\x9e\x90" |
| "\x64\xfd\x91\x29\xd5\xe3\x77\x47\x51\xb4\xbb\xbe" |
| "\x24\x27\x56\xb1\x4a\x12\x08\x6b", |
| 32); |
| *(uint32_t*)0x2000efb8 = 0x1ff; |
| *(uint32_t*)0x2000efbc = 3; |
| *(uint8_t*)0x2000efc0 = 0; |
| *(uint8_t*)0x2000efc1 = 0; |
| *(uint8_t*)0x2000efc2 = 0; |
| *(uint8_t*)0x2000efc3 = 0; |
| *(uint8_t*)0x2000efc4 = 0; |
| *(uint8_t*)0x2000efc5 = 0; |
| *(uint8_t*)0x2000efc6 = 0; |
| *(uint8_t*)0x2000efc7 = 0; |
| *(uint8_t*)0x2000efc8 = 0; |
| *(uint8_t*)0x2000efc9 = 0; |
| *(uint8_t*)0x2000efca = 0; |
| *(uint8_t*)0x2000efcb = 0; |
| *(uint8_t*)0x2000efcc = 0; |
| *(uint8_t*)0x2000efcd = 0; |
| *(uint8_t*)0x2000efce = 0; |
| *(uint8_t*)0x2000efcf = 0; |
| *(uint8_t*)0x2000efd0 = 0; |
| *(uint8_t*)0x2000efd1 = 0; |
| *(uint8_t*)0x2000efd2 = 0; |
| *(uint8_t*)0x2000efd3 = 0; |
| *(uint8_t*)0x2000efd4 = 0; |
| *(uint8_t*)0x2000efd5 = 0; |
| *(uint8_t*)0x2000efd6 = 0; |
| *(uint8_t*)0x2000efd7 = 0; |
| *(uint8_t*)0x2000efd8 = 0; |
| *(uint8_t*)0x2000efd9 = 0; |
| *(uint8_t*)0x2000efda = 0; |
| *(uint8_t*)0x2000efdb = 0; |
| *(uint8_t*)0x2000efdc = 0; |
| *(uint8_t*)0x2000efdd = 0; |
| *(uint8_t*)0x2000efde = 0; |
| *(uint8_t*)0x2000efdf = 0; |
| *(uint8_t*)0x2000efe0 = 0; |
| *(uint8_t*)0x2000efe1 = 0; |
| *(uint8_t*)0x2000efe2 = 0; |
| *(uint8_t*)0x2000efe3 = 0; |
| *(uint8_t*)0x2000efe4 = 0; |
| *(uint8_t*)0x2000efe5 = 0; |
| *(uint8_t*)0x2000efe6 = 0; |
| *(uint8_t*)0x2000efe7 = 0; |
| *(uint8_t*)0x2000efe8 = 0; |
| *(uint8_t*)0x2000efe9 = 0; |
| *(uint8_t*)0x2000efea = 0; |
| *(uint8_t*)0x2000efeb = 0; |
| *(uint8_t*)0x2000efec = 0; |
| *(uint8_t*)0x2000efed = 0; |
| *(uint8_t*)0x2000efee = 0; |
| *(uint8_t*)0x2000efef = 0; |
| *(uint8_t*)0x2000eff0 = 0; |
| *(uint8_t*)0x2000eff1 = 0; |
| *(uint8_t*)0x2000eff2 = 0; |
| *(uint8_t*)0x2000eff3 = 0; |
| *(uint8_t*)0x2000eff4 = 0; |
| *(uint8_t*)0x2000eff5 = 0; |
| *(uint8_t*)0x2000eff6 = 0; |
| *(uint8_t*)0x2000eff7 = 0; |
| *(uint8_t*)0x2000eff8 = 0; |
| *(uint8_t*)0x2000eff9 = 0; |
| *(uint8_t*)0x2000effa = 0; |
| *(uint8_t*)0x2000effb = 0; |
| *(uint8_t*)0x2000effc = 0; |
| *(uint8_t*)0x2000effd = 0; |
| *(uint8_t*)0x2000effe = 0; |
| *(uint8_t*)0x2000efff = 0; |
| syscall(__NR_ioctl, r[0], 0xc0bc5351, 0x2000ef44); |
| break; |
| case 5: |
| r[1] = syscall(__NR_socket, 2, 0x80005, 0); |
| break; |
| case 6: |
| syscall(__NR_ftruncate, r[1], 0xfffffffffffffff9); |
| break; |
| case 7: |
| memcpy((void*)0x20014bd0, "\x66\x69\x6c\x74\x65\x72\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", |
| 32); |
| *(uint32_t*)0x20014bf0 = 0xe; |
| *(uint32_t*)0x20014bf4 = 4; |
| *(uint32_t*)0x20014bf8 = 0xfffffccc; |
| *(uint32_t*)0x20014bfc = -1; |
| *(uint32_t*)0x20014c00 = 0; |
| *(uint32_t*)0x20014c04 = 0; |
| *(uint32_t*)0x20014c08 = 0; |
| *(uint32_t*)0x20014c0c = -1; |
| *(uint32_t*)0x20014c10 = -1; |
| *(uint32_t*)0x20014c14 = 0; |
| *(uint32_t*)0x20014c18 = 0; |
| *(uint32_t*)0x20014c1c = 0; |
| *(uint32_t*)0x20014c20 = -1; |
| *(uint32_t*)0x20014c24 = 4; |
| *(uint64_t*)0x20014c28 = 0x20001000; |
| *(uint8_t*)0x20014c30 = 0; |
| *(uint8_t*)0x20014c31 = 0; |
| *(uint8_t*)0x20014c32 = 0; |
| *(uint8_t*)0x20014c33 = 0; |
| *(uint8_t*)0x20014c34 = 0; |
| *(uint8_t*)0x20014c35 = 0; |
| *(uint8_t*)0x20014c36 = 0; |
| *(uint8_t*)0x20014c37 = 0; |
| *(uint8_t*)0x20014c38 = 0; |
| *(uint8_t*)0x20014c39 = 0; |
| *(uint8_t*)0x20014c3a = 0; |
| *(uint8_t*)0x20014c3b = 0; |
| *(uint8_t*)0x20014c3c = 0; |
| *(uint8_t*)0x20014c3d = 0; |
| *(uint8_t*)0x20014c3e = 0; |
| *(uint8_t*)0x20014c3f = 0; |
| *(uint8_t*)0x20014c40 = 0; |
| *(uint8_t*)0x20014c41 = 0; |
| *(uint8_t*)0x20014c42 = 0; |
| *(uint8_t*)0x20014c43 = 0; |
| *(uint8_t*)0x20014c44 = 0; |
| *(uint8_t*)0x20014c45 = 0; |
| *(uint8_t*)0x20014c46 = 0; |
| *(uint8_t*)0x20014c47 = 0; |
| *(uint8_t*)0x20014c48 = 0; |
| *(uint8_t*)0x20014c49 = 0; |
| *(uint8_t*)0x20014c4a = 0; |
| *(uint8_t*)0x20014c4b = 0; |
| *(uint8_t*)0x20014c4c = 0; |
| *(uint8_t*)0x20014c4d = 0; |
| *(uint8_t*)0x20014c4e = 0; |
| *(uint8_t*)0x20014c4f = 0; |
| *(uint8_t*)0x20014c50 = 0; |
| *(uint8_t*)0x20014c51 = 0; |
| *(uint8_t*)0x20014c52 = 0; |
| *(uint8_t*)0x20014c53 = 0; |
| *(uint8_t*)0x20014c54 = 0; |
| *(uint8_t*)0x20014c55 = 0; |
| *(uint8_t*)0x20014c56 = 0; |
| *(uint8_t*)0x20014c57 = 0; |
| *(uint8_t*)0x20014c58 = 0; |
| *(uint8_t*)0x20014c59 = 0; |
| *(uint8_t*)0x20014c5a = 0; |
| *(uint8_t*)0x20014c5b = 0; |
| *(uint8_t*)0x20014c5c = 0; |
| *(uint8_t*)0x20014c5d = 0; |
| *(uint8_t*)0x20014c5e = 0; |
| *(uint8_t*)0x20014c5f = 0; |
| *(uint8_t*)0x20014c60 = 0; |
| *(uint8_t*)0x20014c61 = 0; |
| *(uint8_t*)0x20014c62 = 0; |
| *(uint8_t*)0x20014c63 = 0; |
| *(uint8_t*)0x20014c64 = 0; |
| *(uint8_t*)0x20014c65 = 0; |
| *(uint8_t*)0x20014c66 = 0; |
| *(uint8_t*)0x20014c67 = 0; |
| *(uint8_t*)0x20014c68 = 0; |
| *(uint8_t*)0x20014c69 = 0; |
| *(uint8_t*)0x20014c6a = 0; |
| *(uint8_t*)0x20014c6b = 0; |
| *(uint8_t*)0x20014c6c = 0; |
| *(uint8_t*)0x20014c6d = 0; |
| *(uint8_t*)0x20014c6e = 0; |
| *(uint8_t*)0x20014c6f = 0; |
| *(uint8_t*)0x20014c70 = 0; |
| *(uint8_t*)0x20014c71 = 0; |
| *(uint8_t*)0x20014c72 = 0; |
| *(uint8_t*)0x20014c73 = 0; |
| *(uint8_t*)0x20014c74 = 0; |
| *(uint8_t*)0x20014c75 = 0; |
| *(uint8_t*)0x20014c76 = 0; |
| *(uint8_t*)0x20014c77 = 0; |
| *(uint8_t*)0x20014c78 = 0; |
| *(uint8_t*)0x20014c79 = 0; |
| *(uint8_t*)0x20014c7a = 0; |
| *(uint8_t*)0x20014c7b = 0; |
| *(uint8_t*)0x20014c7c = 0; |
| *(uint8_t*)0x20014c7d = 0; |
| *(uint8_t*)0x20014c7e = 0; |
| *(uint8_t*)0x20014c7f = 0; |
| *(uint8_t*)0x20014c80 = 0; |
| *(uint8_t*)0x20014c81 = 0; |
| *(uint8_t*)0x20014c82 = 0; |
| *(uint8_t*)0x20014c83 = 0; |
| *(uint32_t*)0x20014c84 = 0; |
| *(uint16_t*)0x20014c88 = 0x70; |
| *(uint16_t*)0x20014c8a = 0x98; |
| *(uint32_t*)0x20014c8c = 0; |
| *(uint64_t*)0x20014c90 = 0; |
| *(uint64_t*)0x20014c98 = 0; |
| *(uint16_t*)0x20014ca0 = 0x28; |
| memcpy((void*)0x20014ca2, "\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", |
| 29); |
| *(uint8_t*)0x20014cbf = 0; |
| *(uint32_t*)0x20014cc0 = 0xfffffffe; |
| *(uint32_t*)0x20014cc8 = htobe32(-1); |
| *(uint32_t*)0x20014ccc = htobe32(0xe0000001); |
| *(uint32_t*)0x20014cd0 = htobe32(-1); |
| *(uint32_t*)0x20014cd4 = htobe32(0xff000000); |
| memcpy((void*)0x20014cd8, |
| "\xfa\x5e\xa1\xe8\x53\x4f\x88\x6f\x89\xfd\xaf\xae\x6a\x8f\x7b\x2f", |
| 16); |
| memcpy((void*)0x20014ce8, |
| "\xb4\x41\x1f\x31\xd2\xb4\x73\x55\x74\xdc\xa3\xa5\x42\x23\x90\x2e", |
| 16); |
| *(uint8_t*)0x20014cf8 = -1; |
| *(uint8_t*)0x20014cf9 = 0; |
| *(uint8_t*)0x20014cfa = 0; |
| *(uint8_t*)0x20014cfb = 0; |
| *(uint8_t*)0x20014cfc = 0; |
| *(uint8_t*)0x20014cfd = 0; |
| *(uint8_t*)0x20014cfe = 0; |
| *(uint8_t*)0x20014cff = 0; |
| *(uint8_t*)0x20014d00 = 0; |
| *(uint8_t*)0x20014d01 = 0; |
| *(uint8_t*)0x20014d02 = 0; |
| *(uint8_t*)0x20014d03 = 0; |
| *(uint8_t*)0x20014d04 = 0; |
| *(uint8_t*)0x20014d05 = 0; |
| *(uint8_t*)0x20014d06 = 0; |
| *(uint8_t*)0x20014d07 = 0; |
| *(uint8_t*)0x20014d08 = -1; |
| *(uint8_t*)0x20014d09 = 0; |
| *(uint8_t*)0x20014d0a = 0; |
| *(uint8_t*)0x20014d0b = 0; |
| *(uint8_t*)0x20014d0c = 0; |
| *(uint8_t*)0x20014d0d = 0; |
| *(uint8_t*)0x20014d0e = 0; |
| *(uint8_t*)0x20014d0f = 0; |
| *(uint8_t*)0x20014d10 = 0; |
| *(uint8_t*)0x20014d11 = 0; |
| *(uint8_t*)0x20014d12 = 0; |
| *(uint8_t*)0x20014d13 = 0; |
| *(uint8_t*)0x20014d14 = 0; |
| *(uint8_t*)0x20014d15 = 0; |
| *(uint8_t*)0x20014d16 = 0; |
| *(uint8_t*)0x20014d17 = 0; |
| *(uint16_t*)0x20014d18 = 0x62; |
| *(uint8_t*)0x20014d1a = 0xc0; |
| *(uint8_t*)0x20014d1b = 2; |
| *(uint32_t*)0x20014d1c = 0; |
| *(uint16_t*)0x20014d20 = 0x70; |
| *(uint16_t*)0x20014d22 = 0x98; |
| *(uint32_t*)0x20014d24 = 0; |
| *(uint64_t*)0x20014d28 = 0; |
| *(uint64_t*)0x20014d30 = 0; |
| *(uint16_t*)0x20014d38 = 0x28; |
| memcpy((void*)0x20014d3a, "\x52\x45\x4a\x45\x43\x54\x00\x00\x00\x00\x00\x00" |
| "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" |
| "\x00\x00\x00\x00\x00", |
| 29); |
| *(uint8_t*)0x20014d57 = 0; |
| *(uint32_t*)0x20014d58 = 0; |
| *(uint8_t*)0x20014d60 = 0; |
| *(uint8_t*)0x20014d61 = 0; |
| *(uint8_t*)0x20014d62 = 0; |
| *(uint8_t*)0x20014d63 = 0; |
| *(uint8_t*)0x20014d64 = 0; |
| *(uint8_t*)0x20014d65 = 0; |
| *(uint8_t*)0x20014d66 = 0; |
| *(uint8_t*)0x20014d67 = 0; |
| *(uint8_t*)0x20014d68 = 0; |
| *(uint8_t*)0x20014d69 = 0; |
| *(uint8_t*)0x20014d6a = 0; |
| *(uint8_t*)0x20014d6b = 0; |
| *(uint8_t*)0x20014d6c = 0; |
| *(uint8_t*)0x20014d6d = 0; |
| *(uint8_t*)0x20014d6e = 0; |
| *(uint8_t*)0x20014d6f = 0; |
| *(uint8_t*)0x20014d70 = 0; |
| *(uint8_t*)0x20014d71 = 0; |
| *(uint8_t*)0x20014d72 = 0; |
| *(uint8_t*)0x20014d73 = 0; |
| *(uint8_t*)0x20014d74 = 0; |
| *(uint8_t*)0x20014d75 = 0; |
| *(uint8_t*)0x20014d76 = 0; |
| *(uint8_t*)0x20014d77 = 0; |
| *(uint8_t*)0x20014d78 = 0; |
| *(uint8_t*)0x20014d79 = 0; |
| *(uint8_t*)0x20014d7a = 0; |
| *(uint8_t*)0x20014d7b = 0; |
| *(uint8_t*)0x20014d7c = 0; |
| *(uint8_t*)0x20014d7d = 0; |
| *(uint8_t*)0x20014d7e = 0; |
| *(uint8_t*)0x20014d7f = 0; |
| *(uint8_t*)0x20014d80 = 0; |
| *(uint8_t*)0x20014d81 = 0; |
| *(uint8_t*)0x20014d82 = 0; |
| *(uint8_t*)0x20014d83 = 0; |
| *(uint8_t*)0x20014d84 = 0; |
| *(uint8_t*)0x20014d85 = 0; |
| *(uint8_t*)0x20014d86 = 0; |
| *(uint8_t*)0x20014d87 = 0; |
| *(uint8_t*)0x20014d88 = 0; |
| *(uint8_t*)0x20014d89 = 0; |
| *(uint8_t*)0x20014d8a = 0; |
| *(uint8_t*)0x20014d8b = 0; |
| *(uint8_t*)0x20014d8c = 0; |
| *(uint8_t*)0x20014d8d = 0; |
| *(uint8_t*)0x20014d8e = 0; |
| *(uint8_t*)0x20014d8f = 0; |
| *(uint8_t*)0x20014d90 = 0; |
| *(uint8_t*)0x20014d91 = 0; |
| *(uint8_t*)0x20014d92 = 0; |
| *(uint8_t*)0x20014d93 = 0; |
| *(uint8_t*)0x20014d94 = 0; |
| *(uint8_t*)0x20014d95 = 0; |
| *(uint8_t*)0x20014d96 = 0; |
| *(uint8_t*)0x20014d97 = 0; |
| *(uint8_t*)0x20014d98 = 0; |
| *(uint8_t*)0x20014d99 = 0; |
| *(uint8_t*)0x20014d9a = 0; |
| *(uint8_t*)0x20014d9b = 0; |
| *(uint8_t*)0x20014d9c = 0; |
| *(uint8_t*)0x20014d9d = 0; |
| *(uint8_t*)0x20014d9e = 0; |
| *(uint8_t*)0x20014d9f = 0; |
| *(uint8_t*)0x20014da0 = 0; |
| *(uint8_t*)0x20014da1 = 0; |
| *(uint8_t*)0x20014da2 = 0; |
| *(uint8_t*)0x20014da3 = 0; |
| *(uint8_t*)0x20014da4 = 0; |
| *(uint8_t*)0x20014da5 = 0; |
| *(uint8_t*)0x20014da6 = 0; |
| *(uint8_t*)0x20014da7 = 0; |
| *(uint8_t*)0x20014da8 = 0; |
| *(uint8_t*)0x20014da9 = 0; |
| *(uint8_t*)0x20014daa = 0; |
| *(uint8_t*)0x20014dab = 0; |
| *(uint8_t*)0x20014dac = 0; |
| *(uint8_t*)0x20014dad = 0; |
| *(uint8_t*)0x20014dae = 0; |
| *(uint8_t*)0x20014daf = 0; |
| *(uint8_t*)0x20014db0 = 0; |
| *(uint8_t*)0x20014db1 = 0; |
| *(uint8_t*)0x20014db2 = 0; |
| *(uint8_t*)0x20014db3 = 0; |
| *(uint32_t*)0x20014db4 = 0; |
| *(uint16_t*)0x20014db8 = 0x1c8; |
| *(uint16_t*)0x20014dba = 0x1f0; |
| *(uint32_t*)0x20014dbc = 0; |
| *(uint64_t*)0x20014dc0 = 0; |
| *(uint64_t*)0x20014dc8 = 0; |
| *(uint16_t*)0x20014dd0 = 0x158; |
| memcpy((void*)0x20014dd2, "\x68\x61\x73\x68\x6c\x69\x6d\x69\x74\x00\x00\x00" |
| "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" |
| "\x00\x00\x00\x00\x00", |
| 29); |
| *(uint8_t*)0x20014def = 3; |
| memcpy((void*)0x20014df0, |
| "\x69\x70\x36\x74\x6e\x6c\x30\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\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\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\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\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\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\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" |
| "\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", |
| 255); |
| *(uint64_t*)0x20014ef0 = 0x800; |
| *(uint64_t*)0x20014ef8 = 0; |
| *(uint32_t*)0x20014f00 = 0x51; |
| *(uint32_t*)0x20014f04 = 0; |
| *(uint32_t*)0x20014f08 = 0; |
| *(uint32_t*)0x20014f0c = 3; |
| *(uint32_t*)0x20014f10 = 0x81; |
| *(uint32_t*)0x20014f14 = 5; |
| *(uint8_t*)0x20014f18 = 0; |
| *(uint8_t*)0x20014f19 = 0; |
| *(uint64_t*)0x20014f20 = 0; |
| *(uint16_t*)0x20014f28 = 0x28; |
| memcpy((void*)0x20014f2a, "\x52\x45\x4a\x45\x43\x54\x00\x00\x00\x00\x00\x00" |
| "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" |
| "\x00\x00\x00\x00\x00", |
| 29); |
| *(uint8_t*)0x20014f47 = 0; |
| *(uint32_t*)0x20014f48 = 0; |
| *(uint8_t*)0x20014f50 = 0xac; |
| *(uint8_t*)0x20014f51 = 0x14; |
| *(uint8_t*)0x20014f52 = 0; |
| *(uint8_t*)0x20014f53 = 0; |
| *(uint32_t*)0x20014f54 = htobe32(0xfd2); |
| *(uint32_t*)0x20014f58 = htobe32(0); |
| *(uint32_t*)0x20014f5c = htobe32(0); |
| *(uint8_t*)0x20014f60 = 0x73; |
| *(uint8_t*)0x20014f61 = 0x79; |
| *(uint8_t*)0x20014f62 = 0x7a; |
| *(uint8_t*)0x20014f63 = 0; |
| *(uint8_t*)0x20014f64 = 0; |
| *(uint8_t*)0x20014f70 = 0x73; |
| *(uint8_t*)0x20014f71 = 0x79; |
| *(uint8_t*)0x20014f72 = 0x7a; |
| *(uint8_t*)0x20014f73 = 0; |
| *(uint8_t*)0x20014f74 = 0; |
| *(uint8_t*)0x20014f80 = 0; |
| *(uint8_t*)0x20014f81 = 0; |
| *(uint8_t*)0x20014f82 = 0; |
| *(uint8_t*)0x20014f83 = 0; |
| *(uint8_t*)0x20014f84 = 0; |
| *(uint8_t*)0x20014f85 = 0; |
| *(uint8_t*)0x20014f86 = 0; |
| *(uint8_t*)0x20014f87 = 0; |
| *(uint8_t*)0x20014f88 = 0; |
| *(uint8_t*)0x20014f89 = 0; |
| *(uint8_t*)0x20014f8a = 0; |
| *(uint8_t*)0x20014f8b = 0; |
| *(uint8_t*)0x20014f8c = 0; |
| *(uint8_t*)0x20014f8d = 0; |
| *(uint8_t*)0x20014f8e = 0; |
| *(uint8_t*)0x20014f8f = 0; |
| *(uint8_t*)0x20014f90 = 0; |
| *(uint8_t*)0x20014f91 = 0; |
| *(uint8_t*)0x20014f92 = 0; |
| *(uint8_t*)0x20014f93 = 0; |
| *(uint8_t*)0x20014f94 = 0; |
| *(uint8_t*)0x20014f95 = 0; |
| *(uint8_t*)0x20014f96 = 0; |
| *(uint8_t*)0x20014f97 = 0; |
| *(uint8_t*)0x20014f98 = 0; |
| *(uint8_t*)0x20014f99 = 0; |
| *(uint8_t*)0x20014f9a = 0; |
| *(uint8_t*)0x20014f9b = 0; |
| *(uint8_t*)0x20014f9c = 0; |
| *(uint8_t*)0x20014f9d = 0; |
| *(uint8_t*)0x20014f9e = 0; |
| *(uint8_t*)0x20014f9f = 0; |
| *(uint16_t*)0x20014fa0 = 0; |
| *(uint8_t*)0x20014fa2 = 0; |
| *(uint8_t*)0x20014fa3 = 0; |
| *(uint32_t*)0x20014fa4 = 0; |
| *(uint16_t*)0x20014fa8 = 0x70; |
| *(uint16_t*)0x20014faa = 0xb0; |
| *(uint32_t*)0x20014fac = 0; |
| *(uint64_t*)0x20014fb0 = 0; |
| *(uint64_t*)0x20014fb8 = 0; |
| *(uint16_t*)0x20014fc0 = 0x40; |
| memcpy((void*)0x20014fc2, "\x52\x41\x54\x45\x45\x53\x54\x00\x00\x00\x00\x00" |
| "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" |
| "\x00\x00\x00\x00\x00", |
| 29); |
| *(uint8_t*)0x20014fdf = 0; |
| memcpy((void*)0x20014fe0, |
| "\x73\x79\x7a\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", |
| 16); |
| *(uint8_t*)0x20014ff0 = 1; |
| *(uint8_t*)0x20014ff1 = 0x19; |
| *(uint64_t*)0x20014ff8 = 8; |
| *(uint64_t*)0x20001000 = 0; |
| *(uint64_t*)0x20001008 = 0; |
| *(uint64_t*)0x20001010 = 0; |
| *(uint64_t*)0x20001018 = 0; |
| *(uint64_t*)0x20001020 = 0; |
| *(uint64_t*)0x20001028 = 0; |
| *(uint64_t*)0x20001030 = 0; |
| *(uint64_t*)0x20001038 = 0; |
| syscall(__NR_setsockopt, r[1], 0, 0x40, 0x20014bd0, 0x430); |
| break; |
| case 8: |
| syscall(__NR_mmap, 0x20019000, 0x1000, 3, 0x32, -1, 0); |
| break; |
| case 9: |
| syscall(__NR_mmap, 0x20019000, 0x1000, 3, 0x32, -1, 0); |
| break; |
| case 10: |
| syscall(__NR_ioctl, r[0], 0x541d); |
| break; |
| case 11: |
| syscall(__NR_mmap, 0x20019000, 0x1000, 3, 0x32, -1, 0); |
| break; |
| case 12: |
| *(uint64_t*)0x20019fc0 = 0x20019000; |
| *(uint64_t*)0x20019fc8 = 0x2000c000; |
| *(uint64_t*)0x20019fd0 = 0x20019000; |
| *(uint64_t*)0x20019fd8 = 0x20005000; |
| *(uint32_t*)0x20019fe0 = 3; |
| *(uint32_t*)0x20019fe4 = 6; |
| *(uint32_t*)0x20019fe8 = 5; |
| *(uint32_t*)0x20019fec = 3; |
| *(uint32_t*)0x20019ff0 = 0; |
| *(uint32_t*)0x20019ff4 = 0; |
| *(uint32_t*)0x20019ff8 = 0; |
| *(uint32_t*)0x20019ffc = 0; |
| syscall(__NR_ioctl, r[0], 0xc04064a0, 0x20019fc0); |
| break; |
| case 13: |
| r[2] = syscall(__NR_socket, 0x10, 3, 0xc); |
| break; |
| case 14: |
| syscall(__NR_mmap, 0x2001a000, 0x1000, 3, 0x32, -1, 0); |
| break; |
| case 15: |
| syscall(__NR_mmap, 0x20000000, 0xfff000, 3, 0x32, -1, 0); |
| break; |
| case 16: |
| memcpy((void*)0x209aa000, "net/softnet_stat", 17); |
| r[3] = syz_open_procfs(0, 0x209aa000); |
| break; |
| case 17: |
| *(uint32_t*)0x2025c000 = 2; |
| *(uint32_t*)0x2025c004 = 0x6d; |
| *(uint8_t*)0x2025c008 = 0xe3; |
| *(uint8_t*)0x2025c009 = 0; |
| *(uint8_t*)0x2025c00a = 0; |
| *(uint8_t*)0x2025c00b = 0; |
| *(uint32_t*)0x2025c00c = 0; |
| *(uint64_t*)0x2025c010 = 0; |
| *(uint64_t*)0x2025c018 = 0; |
| *(uint64_t*)0x2025c020 = 0; |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 0, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 1, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 2, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 3, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 4, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0xffff7fffffffffff, 5, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 6, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 7, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 8, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 9, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 10, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 11, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 12, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 13, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 14, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 15, 2); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 17, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 18, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 19, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 20, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 21, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 22, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 23, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 24, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 25, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 26, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 27, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 28, 1); |
| STORE_BY_BITMASK(uint64_t, 0x2025c028, 0, 29, 35); |
| *(uint32_t*)0x2025c030 = 0; |
| *(uint32_t*)0x2025c034 = 0; |
| *(uint64_t*)0x2025c038 = 0x20000000; |
| *(uint64_t*)0x2025c040 = 0; |
| *(uint64_t*)0x2025c048 = 0; |
| *(uint64_t*)0x2025c050 = 0; |
| *(uint64_t*)0x2025c058 = 0; |
| *(uint32_t*)0x2025c060 = 0; |
| *(uint64_t*)0x2025c068 = 0; |
| *(uint32_t*)0x2025c070 = 0; |
| *(uint16_t*)0x2025c074 = 0; |
| *(uint16_t*)0x2025c076 = 0; |
| syscall(__NR_perf_event_open, 0x2025c000, 0, 0, -1, 0); |
| break; |
| case 18: |
| *(uint64_t*)0x2055ff80 = 0x202f0f89; |
| *(uint64_t*)0x2055ff88 = 0xcc; |
| syscall(__NR_preadv, r[3], 0x2055ff80, 1, 0); |
| break; |
| case 19: |
| syscall(__NR_read, r[2], 0x2001a000, 0x84); |
| break; |
| } |
| } |
| |
| void test() |
| { |
| memset(r, -1, sizeof(r)); |
| execute(20); |
| collide = 1; |
| execute(20); |
| } |
| |
| int main() |
| { |
| char* cwd = get_current_dir_name(); |
| for (;;) { |
| if (chdir(cwd)) |
| fail("failed to chdir"); |
| use_temporary_dir(); |
| setup_tun(0, true); |
| loop(); |
| } |
| } |