// https://syzkaller.appspot.com/bug?id=da0d8a51e89e8a43bbe9f97163f12296725c796c // 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef __NR_memfd_create #define __NR_memfd_create 319 #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 void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } 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; } struct nlmsg { char* pos; int nesting; struct nlattr* nested[8]; char buf[4096]; }; static void netlink_init(struct nlmsg* nlmsg, int typ, int flags, const void* data, int size) { memset(nlmsg, 0, sizeof(*nlmsg)); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_type = typ; hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags; memcpy(hdr + 1, data, size); nlmsg->pos = (char*)(hdr + 1) + NLMSG_ALIGN(size); } static void netlink_attr(struct nlmsg* nlmsg, int typ, const void* data, int size) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_len = sizeof(*attr) + size; attr->nla_type = typ; if (size > 0) memcpy(attr + 1, data, size); nlmsg->pos += NLMSG_ALIGN(attr->nla_len); } static int netlink_send_ext(struct nlmsg* nlmsg, int sock, uint16_t reply_type, int* reply_len, bool dofail) { if (nlmsg->pos > nlmsg->buf + sizeof(nlmsg->buf) || nlmsg->nesting) exit(1); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_len = nlmsg->pos - nlmsg->buf; struct sockaddr_nl addr; memset(&addr, 0, sizeof(addr)); addr.nl_family = AF_NETLINK; ssize_t n = sendto(sock, nlmsg->buf, hdr->nlmsg_len, 0, (struct sockaddr*)&addr, sizeof(addr)); if (n != (ssize_t)hdr->nlmsg_len) { if (dofail) exit(1); return -1; } n = recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); if (reply_len) *reply_len = 0; if (n < 0) { if (dofail) exit(1); return -1; } if (n < (ssize_t)sizeof(struct nlmsghdr)) { errno = EINVAL; if (dofail) exit(1); return -1; } if (hdr->nlmsg_type == NLMSG_DONE) return 0; if (reply_len && hdr->nlmsg_type == reply_type) { *reply_len = n; return 0; } if (n < (ssize_t)(sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr))) { errno = EINVAL; if (dofail) exit(1); return -1; } if (hdr->nlmsg_type != NLMSG_ERROR) { errno = EINVAL; if (dofail) exit(1); return -1; } errno = -((struct nlmsgerr*)(hdr + 1))->error; return -errno; } static int netlink_send(struct nlmsg* nlmsg, int sock) { return netlink_send_ext(nlmsg, sock, 0, NULL, true); } static int netlink_query_family_id(struct nlmsg* nlmsg, int sock, const char* family_name, bool dofail) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = CTRL_CMD_GETFAMILY; netlink_init(nlmsg, GENL_ID_CTRL, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, CTRL_ATTR_FAMILY_NAME, family_name, strnlen(family_name, GENL_NAMSIZ - 1) + 1); int n = 0; int err = netlink_send_ext(nlmsg, sock, GENL_ID_CTRL, &n, dofail); if (err < 0) { return -1; } uint16_t id = 0; struct nlattr* attr = (struct nlattr*)(nlmsg->buf + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg->buf + n; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == CTRL_ATTR_FAMILY_ID) { id = *(uint16_t*)(attr + 1); break; } } if (!id) { errno = EINVAL; return -1; } recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); return id; } static struct nlmsg nlmsg; #define WIFI_INITIAL_DEVICE_COUNT 2 #define WIFI_MAC_BASE \ { \ 0x08, 0x02, 0x11, 0x00, 0x00, 0x00 \ } #define WIFI_IBSS_BSSID \ { \ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50 \ } #define WIFI_IBSS_SSID \ { \ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 \ } #define WIFI_DEFAULT_FREQUENCY 2412 #define WIFI_DEFAULT_SIGNAL 0 #define WIFI_DEFAULT_RX_RATE 1 #define HWSIM_CMD_REGISTER 1 #define HWSIM_CMD_FRAME 2 #define HWSIM_CMD_NEW_RADIO 4 #define HWSIM_ATTR_SUPPORT_P2P_DEVICE 14 #define HWSIM_ATTR_PERM_ADDR 22 #define IF_OPER_UP 6 struct join_ibss_props { int wiphy_freq; bool wiphy_freq_fixed; uint8_t* mac; uint8_t* ssid; int ssid_len; }; static int set_interface_state(const char* interface_name, int on) { struct ifreq ifr; int sock = socket(AF_INET, SOCK_DGRAM, 0); if (sock < 0) { return -1; } memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, interface_name); int ret = ioctl(sock, SIOCGIFFLAGS, &ifr); if (ret < 0) { close(sock); return -1; } if (on) ifr.ifr_flags |= IFF_UP; else ifr.ifr_flags &= ~IFF_UP; ret = ioctl(sock, SIOCSIFFLAGS, &ifr); close(sock); if (ret < 0) { return -1; } return 0; } static int nl80211_set_interface(struct nlmsg* nlmsg, int sock, int nl80211_family, uint32_t ifindex, uint32_t iftype, bool dofail) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL80211_CMD_SET_INTERFACE; netlink_init(nlmsg, nl80211_family, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, NL80211_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(nlmsg, NL80211_ATTR_IFTYPE, &iftype, sizeof(iftype)); int err = netlink_send_ext(nlmsg, sock, 0, NULL, dofail); if (err < 0) { } return err; } static int nl80211_join_ibss(struct nlmsg* nlmsg, int sock, int nl80211_family, uint32_t ifindex, struct join_ibss_props* props, bool dofail) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL80211_CMD_JOIN_IBSS; netlink_init(nlmsg, nl80211_family, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, NL80211_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(nlmsg, NL80211_ATTR_SSID, props->ssid, props->ssid_len); netlink_attr(nlmsg, NL80211_ATTR_WIPHY_FREQ, &(props->wiphy_freq), sizeof(props->wiphy_freq)); if (props->mac) netlink_attr(nlmsg, NL80211_ATTR_MAC, props->mac, ETH_ALEN); if (props->wiphy_freq_fixed) netlink_attr(nlmsg, NL80211_ATTR_FREQ_FIXED, NULL, 0); int err = netlink_send_ext(nlmsg, sock, 0, NULL, dofail); if (err < 0) { } return err; } static int get_ifla_operstate(struct nlmsg* nlmsg, int ifindex, bool dofail) { struct ifinfomsg info; memset(&info, 0, sizeof(info)); info.ifi_family = AF_UNSPEC; info.ifi_index = ifindex; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) { return -1; } netlink_init(nlmsg, RTM_GETLINK, 0, &info, sizeof(info)); int n; int err = netlink_send_ext(nlmsg, sock, RTM_NEWLINK, &n, dofail); close(sock); if (err) { return -1; } struct rtattr* attr = IFLA_RTA(NLMSG_DATA(nlmsg->buf)); for (; RTA_OK(attr, n); attr = RTA_NEXT(attr, n)) { if (attr->rta_type == IFLA_OPERSTATE) return *((int32_t*)RTA_DATA(attr)); } return -1; } static int await_ifla_operstate(struct nlmsg* nlmsg, char* interface, int operstate, bool dofail) { int ifindex = if_nametoindex(interface); while (true) { usleep(1000); int ret = get_ifla_operstate(nlmsg, ifindex, dofail); if (ret < 0) return ret; if (ret == operstate) return 0; } return 0; } static int nl80211_setup_ibss_interface(struct nlmsg* nlmsg, int sock, int nl80211_family_id, char* interface, struct join_ibss_props* ibss_props, bool dofail) { int ifindex = if_nametoindex(interface); if (ifindex == 0) { return -1; } int ret = nl80211_set_interface(nlmsg, sock, nl80211_family_id, ifindex, NL80211_IFTYPE_ADHOC, dofail); if (ret < 0) { return -1; } ret = set_interface_state(interface, 1); if (ret < 0) { return -1; } ret = nl80211_join_ibss(nlmsg, sock, nl80211_family_id, ifindex, ibss_props, dofail); if (ret < 0) { return -1; } return 0; } static int hwsim80211_create_device(struct nlmsg* nlmsg, int sock, int hwsim_family, uint8_t mac_addr[ETH_ALEN]) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = HWSIM_CMD_NEW_RADIO; netlink_init(nlmsg, hwsim_family, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, HWSIM_ATTR_SUPPORT_P2P_DEVICE, NULL, 0); netlink_attr(nlmsg, HWSIM_ATTR_PERM_ADDR, mac_addr, ETH_ALEN); int err = netlink_send(nlmsg, sock); if (err < 0) { } return err; } static void initialize_wifi_devices(void) { int rfkill = open("/dev/rfkill", O_RDWR); if (rfkill == -1) exit(1); struct rfkill_event event = {0}; event.type = RFKILL_TYPE_ALL; event.op = RFKILL_OP_CHANGE_ALL; if (write(rfkill, &event, sizeof(event)) != (ssize_t)(sizeof(event))) exit(1); close(rfkill); uint8_t mac_addr[6] = WIFI_MAC_BASE; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock < 0) exit(1); int hwsim_family_id = netlink_query_family_id(&nlmsg, sock, "MAC80211_HWSIM", true); int nl80211_family_id = netlink_query_family_id(&nlmsg, sock, "nl80211", true); if (hwsim_family_id < 0 || nl80211_family_id < 0) exit(1); uint8_t ssid[] = WIFI_IBSS_SSID; uint8_t bssid[] = WIFI_IBSS_BSSID; struct join_ibss_props ibss_props = {.wiphy_freq = WIFI_DEFAULT_FREQUENCY, .wiphy_freq_fixed = true, .mac = bssid, .ssid = ssid, .ssid_len = sizeof(ssid)}; for (int device_id = 0; device_id < WIFI_INITIAL_DEVICE_COUNT; device_id++) { mac_addr[5] = device_id; int ret = hwsim80211_create_device(&nlmsg, sock, hwsim_family_id, mac_addr); if (ret < 0) exit(1); char interface[6] = "wlan0"; interface[4] += device_id; if (nl80211_setup_ibss_interface(&nlmsg, sock, nl80211_family_id, interface, &ibss_props, true) < 0) exit(1); } for (int device_id = 0; device_id < WIFI_INITIAL_DEVICE_COUNT; device_id++) { char interface[6] = "wlan0"; interface[4] += device_id; int ret = await_ifla_operstate(&nlmsg, interface, IF_OPER_UP, true); if (ret < 0) exit(1); } close(sock); } #define MAX_FDS 30 //% This code is derived from puff.{c,h}, found in the zlib development. The //% original files come with the following copyright notice: //% Copyright (C) 2002-2013 Mark Adler, all rights reserved //% version 2.3, 21 Jan 2013 //% This software is provided 'as-is', without any express or implied //% warranty. In no event will the author be held liable for any damages //% arising from the use of this software. //% Permission is granted to anyone to use this software for any purpose, //% including commercial applications, and to alter it and redistribute it //% freely, subject to the following restrictions: //% 1. The origin of this software must not be misrepresented; you must not //% claim that you wrote the original software. If you use this software //% in a product, an acknowledgment in the product documentation would be //% appreciated but is not required. //% 2. Altered source versions must be plainly marked as such, and must not be //% misrepresented as being the original software. //% 3. This notice may not be removed or altered from any source distribution. //% Mark Adler madler@alumni.caltech.edu //% BEGIN CODE DERIVED FROM puff.{c,h} #define MAXBITS 15 #define MAXLCODES 286 #define MAXDCODES 30 #define MAXCODES (MAXLCODES + MAXDCODES) #define FIXLCODES 288 struct puff_state { unsigned char* out; unsigned long outlen; unsigned long outcnt; const unsigned char* in; unsigned long inlen; unsigned long incnt; int bitbuf; int bitcnt; jmp_buf env; }; static int puff_bits(struct puff_state* s, int need) { long val = s->bitbuf; while (s->bitcnt < need) { if (s->incnt == s->inlen) longjmp(s->env, 1); val |= (long)(s->in[s->incnt++]) << s->bitcnt; s->bitcnt += 8; } s->bitbuf = (int)(val >> need); s->bitcnt -= need; return (int)(val & ((1L << need) - 1)); } static int puff_stored(struct puff_state* s) { s->bitbuf = 0; s->bitcnt = 0; if (s->incnt + 4 > s->inlen) return 2; unsigned len = s->in[s->incnt++]; len |= s->in[s->incnt++] << 8; if (s->in[s->incnt++] != (~len & 0xff) || s->in[s->incnt++] != ((~len >> 8) & 0xff)) return -2; if (s->incnt + len > s->inlen) return 2; if (s->outcnt + len > s->outlen) return 1; for (; len--; s->outcnt++, s->incnt++) { if (s->in[s->incnt]) s->out[s->outcnt] = s->in[s->incnt]; } return 0; } struct puff_huffman { short* count; short* symbol; }; static int puff_decode(struct puff_state* s, const struct puff_huffman* h) { int first = 0; int index = 0; int bitbuf = s->bitbuf; int left = s->bitcnt; int code = first = index = 0; int len = 1; short* next = h->count + 1; while (1) { while (left--) { code |= bitbuf & 1; bitbuf >>= 1; int count = *next++; if (code - count < first) { s->bitbuf = bitbuf; s->bitcnt = (s->bitcnt - len) & 7; return h->symbol[index + (code - first)]; } index += count; first += count; first <<= 1; code <<= 1; len++; } left = (MAXBITS + 1) - len; if (left == 0) break; if (s->incnt == s->inlen) longjmp(s->env, 1); bitbuf = s->in[s->incnt++]; if (left > 8) left = 8; } return -10; } static int puff_construct(struct puff_huffman* h, const short* length, int n) { int len; for (len = 0; len <= MAXBITS; len++) h->count[len] = 0; int symbol; for (symbol = 0; symbol < n; symbol++) (h->count[length[symbol]])++; if (h->count[0] == n) return 0; int left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= h->count[len]; if (left < 0) return left; } short offs[MAXBITS + 1]; offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + h->count[len]; for (symbol = 0; symbol < n; symbol++) if (length[symbol] != 0) h->symbol[offs[length[symbol]]++] = symbol; return left; } static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode, const struct puff_huffman* distcode) { static const short lens[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; static const short dists[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static const short dext[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; int symbol; do { symbol = puff_decode(s, lencode); if (symbol < 0) return symbol; if (symbol < 256) { if (s->outcnt == s->outlen) return 1; if (symbol) s->out[s->outcnt] = symbol; s->outcnt++; } else if (symbol > 256) { symbol -= 257; if (symbol >= 29) return -10; int len = lens[symbol] + puff_bits(s, lext[symbol]); symbol = puff_decode(s, distcode); if (symbol < 0) return symbol; unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]); if (dist > s->outcnt) return -11; if (s->outcnt + len > s->outlen) return 1; while (len--) { if (dist <= s->outcnt && s->out[s->outcnt - dist]) s->out[s->outcnt] = s->out[s->outcnt - dist]; s->outcnt++; } } } while (symbol != 256); return 0; } static int puff_fixed(struct puff_state* s) { static int virgin = 1; static short lencnt[MAXBITS + 1], lensym[FIXLCODES]; static short distcnt[MAXBITS + 1], distsym[MAXDCODES]; static struct puff_huffman lencode, distcode; if (virgin) { lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; short lengths[FIXLCODES]; int symbol; for (symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; for (; symbol < 256; symbol++) lengths[symbol] = 9; for (; symbol < 280; symbol++) lengths[symbol] = 7; for (; symbol < FIXLCODES; symbol++) lengths[symbol] = 8; puff_construct(&lencode, lengths, FIXLCODES); for (symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 5; puff_construct(&distcode, lengths, MAXDCODES); virgin = 0; } return puff_codes(s, &lencode, &distcode); } static int puff_dynamic(struct puff_state* s) { static const short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; int nlen = puff_bits(s, 5) + 257; int ndist = puff_bits(s, 5) + 1; int ncode = puff_bits(s, 4) + 4; if (nlen > MAXLCODES || ndist > MAXDCODES) return -3; short lengths[MAXCODES]; int index; for (index = 0; index < ncode; index++) lengths[order[index]] = puff_bits(s, 3); for (; index < 19; index++) lengths[order[index]] = 0; short lencnt[MAXBITS + 1], lensym[MAXLCODES]; struct puff_huffman lencode = {lencnt, lensym}; int err = puff_construct(&lencode, lengths, 19); if (err != 0) return -4; index = 0; while (index < nlen + ndist) { int symbol; int len; symbol = puff_decode(s, &lencode); if (symbol < 0) return symbol; if (symbol < 16) lengths[index++] = symbol; else { len = 0; if (symbol == 16) { if (index == 0) return -5; len = lengths[index - 1]; symbol = 3 + puff_bits(s, 2); } else if (symbol == 17) symbol = 3 + puff_bits(s, 3); else symbol = 11 + puff_bits(s, 7); if (index + symbol > nlen + ndist) return -6; while (symbol--) lengths[index++] = len; } } if (lengths[256] == 0) return -9; err = puff_construct(&lencode, lengths, nlen); if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) return -7; short distcnt[MAXBITS + 1], distsym[MAXDCODES]; struct puff_huffman distcode = {distcnt, distsym}; err = puff_construct(&distcode, lengths + nlen, ndist); if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) return -8; return puff_codes(s, &lencode, &distcode); } static int puff(unsigned char* dest, unsigned long* destlen, const unsigned char* source, unsigned long sourcelen) { struct puff_state s = { .out = dest, .outlen = *destlen, .outcnt = 0, .in = source, .inlen = sourcelen, .incnt = 0, .bitbuf = 0, .bitcnt = 0, }; int err; if (setjmp(s.env) != 0) err = 2; else { int last; do { last = puff_bits(&s, 1); int type = puff_bits(&s, 2); err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1)); if (err != 0) break; } while (!last); } *destlen = s.outcnt; return err; } //% END CODE DERIVED FROM puff.{c,h} #define ZLIB_HEADER_WIDTH 2 static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd) { if (sourcelen < ZLIB_HEADER_WIDTH) return 0; source += ZLIB_HEADER_WIDTH; sourcelen -= ZLIB_HEADER_WIDTH; const unsigned long max_destlen = 132 << 20; void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); if (ret == MAP_FAILED) return -1; unsigned char* dest = (unsigned char*)ret; unsigned long destlen = max_destlen; int err = puff(dest, &destlen, source, sourcelen); if (err) { munmap(dest, max_destlen); errno = -err; return -1; } if (write(dest_fd, dest, destlen) != (ssize_t)destlen) { munmap(dest, max_destlen); return -1; } return munmap(dest, max_destlen); } static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p) { int err = 0, loopfd = -1; int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; goto error; } if (puff_zlib_to_file(data, size, memfd)) { err = errno; goto error_close_memfd; } loopfd = open(loopname, O_RDWR); if (loopfd == -1) { err = errno; goto error_close_memfd; } if (ioctl(loopfd, LOOP_SET_FD, memfd)) { if (errno != EBUSY) { err = errno; goto error_close_loop; } ioctl(loopfd, LOOP_CLR_FD, 0); usleep(1000); if (ioctl(loopfd, LOOP_SET_FD, memfd)) { err = errno; goto error_close_loop; } } close(memfd); *loopfd_p = loopfd; return 0; error_close_loop: close(loopfd); error_close_memfd: close(memfd); error: errno = err; return -1; } static void reset_loop_device(const char* loopname) { int loopfd = open(loopname, O_RDWR); if (loopfd == -1) { return; } if (ioctl(loopfd, LOOP_CLR_FD, 0)) { } close(loopfd); } static long syz_mount_image(volatile long fsarg, volatile long dir, volatile long flags, volatile long optsarg, volatile long change_dir, volatile unsigned long size, volatile long image) { unsigned char* data = (unsigned char*)image; int res = -1, err = 0, need_loop_device = !!size; char* mount_opts = (char*)optsarg; char* target = (char*)dir; char* fs = (char*)fsarg; char* source = NULL; char loopname[64]; if (need_loop_device) { int loopfd; memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; close(loopfd); source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) reset_loop_device(loopname); errno = err; return res; } static void setup_gadgetfs(); static void setup_binderfs(); static void setup_fusectl(); static void sandbox_common_mount_tmpfs(void) { write_file("/proc/sys/fs/mount-max", "100000"); if (mkdir("./syz-tmp", 0777)) exit(1); if (mount("", "./syz-tmp", "tmpfs", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot", 0777)) exit(1); if (mkdir("./syz-tmp/newroot/dev", 0700)) exit(1); unsigned bind_mount_flags = MS_BIND | MS_REC | MS_PRIVATE; if (mount("/dev", "./syz-tmp/newroot/dev", NULL, bind_mount_flags, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/proc", 0700)) exit(1); if (mount("syz-proc", "./syz-tmp/newroot/proc", "proc", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/selinux", 0700)) exit(1); const char* selinux_path = "./syz-tmp/newroot/selinux"; if (mount("/selinux", selinux_path, NULL, bind_mount_flags, NULL)) { if (errno != ENOENT) exit(1); if (mount("/sys/fs/selinux", selinux_path, NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); } if (mkdir("./syz-tmp/newroot/sys", 0700)) exit(1); if (mount("/sys", "./syz-tmp/newroot/sys", 0, bind_mount_flags, NULL)) exit(1); if (mount("/sys/kernel/debug", "./syz-tmp/newroot/sys/kernel/debug", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/sys/fs/smackfs", "./syz-tmp/newroot/sys/fs/smackfs", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/proc/sys/fs/binfmt_misc", "./syz-tmp/newroot/proc/sys/fs/binfmt_misc", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mkdir("./syz-tmp/pivot", 0777)) exit(1); if (syscall(SYS_pivot_root, "./syz-tmp", "./syz-tmp/pivot")) { if (chdir("./syz-tmp")) exit(1); } else { if (chdir("/")) exit(1); if (umount2("./pivot", MNT_DETACH)) exit(1); } if (chroot("./newroot")) exit(1); if (chdir("/")) exit(1); setup_gadgetfs(); setup_binderfs(); setup_fusectl(); } static void setup_gadgetfs() { if (mkdir("/dev/gadgetfs", 0777)) { } if (mount("gadgetfs", "/dev/gadgetfs", "gadgetfs", 0, NULL)) { } } static void setup_fusectl() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void setup_binderfs() { if (mkdir("/dev/binderfs", 0777)) { } if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); if (getppid() == 1) exit(1); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = (200 << 20); setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 136 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 128 << 20; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); if (unshare(CLONE_NEWNS)) { } if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } typedef struct { const char* name; const char* value; } sysctl_t; static const sysctl_t sysctls[] = { {"/proc/sys/kernel/shmmax", "16777216"}, {"/proc/sys/kernel/shmall", "536870912"}, {"/proc/sys/kernel/shmmni", "1024"}, {"/proc/sys/kernel/msgmax", "8192"}, {"/proc/sys/kernel/msgmni", "1024"}, {"/proc/sys/kernel/msgmnb", "1024"}, {"/proc/sys/kernel/sem", "1024 1048576 500 1024"}, }; unsigned i; for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++) write_file(sysctls[i].name, sysctls[i].value); } static int wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, __WALL) != pid) { } return WEXITSTATUS(status); } static void drop_caps(void) { struct __user_cap_header_struct cap_hdr = {}; struct __user_cap_data_struct cap_data[2] = {}; cap_hdr.version = _LINUX_CAPABILITY_VERSION_3; cap_hdr.pid = getpid(); if (syscall(SYS_capget, &cap_hdr, &cap_data)) exit(1); const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE); cap_data[0].effective &= ~drop; cap_data[0].permitted &= ~drop; cap_data[0].inheritable &= ~drop; if (syscall(SYS_capset, &cap_hdr, &cap_data)) exit(1); } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid != 0) return wait_for_loop(pid); sandbox_common(); drop_caps(); if (unshare(CLONE_NEWNET)) { } write_file("/proc/sys/net/ipv4/ping_group_range", "0 65535"); initialize_wifi_devices(); sandbox_common_mount_tmpfs(); loop(); exit(1); } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW; retry: while (umount2(dir, umount_flags) == 0) { } dp = opendir(dir); if (dp == NULL) { if (errno == EMFILE) { exit(1); } exit(1); } struct dirent* ep = 0; 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); while (umount2(filename, umount_flags) == 0) { } struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } int i; for (i = 0;; i++) { if (unlink(filename) == 0) break; if (errno == EPERM) { int fd = open(filename, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno != EBUSY || i > 100) exit(1); if (umount2(filename, umount_flags)) exit(1); } } closedir(dp); for (int i = 0;; i++) { if (rmdir(dir) == 0) break; if (i < 100) { if (errno == EPERM) { int fd = open(dir, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno == EBUSY) { if (umount2(dir, umount_flags)) exit(1); continue; } if (errno == ENOTEMPTY) { if (iter < 100) { iter++; goto retry; } } } exit(1); } } 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 reset_loop() { char buf[64]; snprintf(buf, sizeof(buf), "/dev/loop%llu", procid); int loopfd = open(buf, O_RDWR); if (loopfd != -1) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); if (symlink("/dev/binderfs", "./binderfs")) { } } static void close_fds() { for (int fd = 3; fd < MAX_FDS; fd++) close(fd); } 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 < 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); event_timedwait(&th->done, 50 + (call == 0 ? 4000 : 0)); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); close_fds(); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); 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; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x20000100, "udf\000", 4); memcpy((void*)0x20000140, ".\002\000", 3); memcpy( (void*)0x20000640, "\x6e\x6f\x76\x72\x73\x2c\x00\x51\x6d\xc1\x04\x00\x00\x00\x5f\xfd\x5f" "\xa7\x6c\x9b\xe9\x54\x1b\x6d\x02\xff\x20\xdf\x2d\xa9\xdf\xb5\xb7\x41" "\xd6\x7f\xb9\x48\xd1\x9d\x9b\x21\xfe\xe5\x06\x16\xe1\x92\x91\xf8\x48" "\xcf\x98\x81\x6c\x47\x74\xaa\x31\x96\x86\xc0\xe4\x5a\x1e\x65\xde\x31" "\x6e\x67\x8c\x7c\x47\x61\x88\xbb\xa0\xd7\x25\xd8\xb3\x57\x18\xda\xe5" "\x4c\x63\xd7\x95\xa2\x5b\x62\x13\x5b\xed\xe1\x7e\xdb\x03\x3e\x07\x00" "\x00\x00\x00\x00\x00\x00\xcb\xbe\x8f\xb1\x00\x3c\xc7\xc2\xc4\xbd\xbc" "\x7b\xb7\x67\x2d\xa6\x1f\x59\x87\x1b\xe8\xb7\x1e\xe3\x91\xb5\x48\x60" "\xf0\xc3\xc3\x21\xf3\x5d\x18\x0a\xd0\xbc\x0b\x30\xde\x00\x20\xea\x5f" "\x69\xc9\x3d\xb4\xc4\xfd\x44\x69\x6c\x00\x5c\xf8\xb7\x80\xf4\xa4\xfb" "\xd6\xb3\x31\x74\x69\xf3\x92\x03\x00\x00\x00\x00\x00\x09\x90\x56\xdb" "\xbf\x9b\x2f\x52\x19\x98\x86\x80\x31\x79\xf2\x6f\x7b\x73\x4a\xee\xc1" "\x07\x30\x9d\x88\xa1\x00\x6b\x0f\x43\x19\x3d\x41\x62\x84\xf7\x46\xf7" "\xd7\xd3\xcc\xf7\x08\x3a\x44\x10\xb8\x48\x14\x1e\x6e\xfc\x4d\x0b\xf8" "\x70\x19\x7a\x16\xab\x2b\x49\x69\x43\xe8\xb0\xb6\xff\x09\xf3\x0f\x35" "\x7d\x6b\xf5\x2e\x18\xa1\x51\x37\xeb\x35\xb8\x33\xff\x2d\xe2\xd5\xf2" "\xe4\x62\x45\x9b\x6e\xe5\xc4\xef\x34\x26\xab\x12\xf9\x21\xaf\x6b\x17" "\x7e\xc1\xda\x4f\x6b\x32\x87\x6f\x51\x59\xee\x8a\x30\x8f\xe9\x9b\x08" "\x00\x00\x00\x00\x04\x17\x62\x0f\x92\x50\x58\x13\x65\x01\x00\x00\xa1" "\xf2\x83\x4a\xd9\xa0\xfa\x9b\x00\xd5\xaa\xfa\x19\x24\x65\xe5\x7e\xe5" "\xf7\xad\x88\xb6\xd9\xa4\xfd\x6d\x98\x98\xfe\xac\xde\xad\x80\x1d\x09" "\x8e\x29\xa4\x36\x61\xa2\xc5\x88\x02\x97\xc0\x01\x37\x84\x71\x35\x99" "\xfe\x28\xfb\x60\x10\x4b\x95\x6c\x45\x1d\xb8\x8d\xa9\x31\x6c\xb8\xf6" "\x58\x42\x9e\x0f\x46\xda\xc8\x9c\xfa\x79\x00\x00\x00\x00\x00\xdc\xc3" "\xa7\xbf\xcc\x17\xed\x93\xa8\x13\x88\xca\xd5\x89\x12\xec\x61\x53\x3a" "\x71\x43\x8b\x52\xa5\xfa\xac\xf0\xf9\xff\xff\xff\xff\xff\xff\xff\xf8" "\x1b\x49\x00\x20\xcd\x31\xa9\x71\x98\xf9\xd1\x1a\x1e\x06\xaf\xb5\xdb" "\xab\x1a\xa6\xc5\x18\x91\x66\xc4\x48\x91\x8a\x25\x38\x52\xe7\xf8\x39" "\x6e\x2f\x52\xb5\x03\xe7\x2d\x9a\x5d\xfb\x47\x4e\xc5\xbf\xa4\x93\x48" "\x4e\x0c\xc8\x94\xc1\x62\x26\x0d\x21\xb6\xa0\x72\xa6\x7b\xa6\xb1\xa8" "\x25\x13\x8e\x7a\x7b\x46\x10\x3b\x68\x5d\x90\x36\xf7\x32\x89\xe7\xd8" "\x26\xfe\x3d\xef\x62\x4a\x73\xa4\xe0\x7a\x2b\x42\x08\xf7\x6b\xd2\x00" "\x25\xd4\x60\x91\x08\xcb\xad\x21\xb9\xca\xa1\x5b\x14\xdb\xd3\x6c\x61" "\x57\x36\xcd\xeb\xb1\x81\xd9\xca\xdc\x4c\x2f\x1e\x13\x1b\x10\xbb\xa5" "\x35\x86\xd1\x1d\x83\xca\x51\xa6\x2f\xd5\x30\x47\x75\x31\xbf\x33\x3b" "\xd2\x4d\xeb\x03\xb7\x28\x01\x53\xa8\x9c\xbc\x87\xed\x3b\x7c\x65\x8a" "\x0a\x05\x00\x00\x00\x00\x00\x00\x00\x1b\x61\xe9\x5b\x17\x75\xb8\x3e" "\x81\x6e\x46\x7e\x35\xe0\xf1\x69\xcb\xc7\x45\x9c\xdc\x6d\xf2\x03\xf3" "\xff\x00\x42\xdf\xeb\x55\xa8\xa6\x0f\x04\x74\xe6\xcc\xfc\x66\xc1\x04" "\x18\xf6\x0b\x57\x2e\x5a\x51\x52\xba\xe6\xca\x3e\x9a\xee\xae\x08\xcb" "\x9e\x43\xef\xbe\xd5\x5d\x9d\xb6\x42\x9e\x55\xc0\x32\xc0\x57\x95\x88" "\x15\x9b\xc8\xe0\x76\x0c\x09\x08\x07\x01\x31\x9d\xe3\x8c\xbb\x41\xee" "\x37\x57\x72\x00\x00\x00\x00\xb5\x89\x31\xdf\x98\xc8\xab\xa3\x66\x31" "\x6c\x0c\xb3\xdf\x8e\x04\x00\x00\x00\x00\x00\x00\x00\x80\xe6\x02\x06" "\x67\x73\x06\x17\xa9\x6a\x78\x53\xb0\xc2\xd2\x58\x13\xb8\x66\x8b\x7a" "\x16\xdb\x5c\x0a\x13\xf8\x91\x89\xde\x35\xfe\xdd\x9d\xfe\xe0\xd3\xf2" "\x35\xb8\x1d\x4b\x51\x89\xfb\xb4\x99\x4e\x6d\x3c\x78\xe9\x98\x28\x19" "\xe0\x84\xf3\xcd\x47\x83\xd1\x40\x6f\xad\x42\xfe\x5b\x25\xc9\xa9\x18" "\x95\xee\x6c\x93\xdf\x43\xed\xf2\x95\x52\xa1\xd5\x3f\xc6\x1d\xa3\x62" "\x44\xe9\x72\x3e\xfe\xe8\x43\xc9\xae\x20\x7c\xdb\x6e\x1d\x18\xeb\xb1" "\x6e\x1a\x3c\x5a\xa5\x06\x95\x24\xa5\x80\x89\xde\x2c\xdf\x5e\x23\x96" "\x06\x00\xbd\xed\xa6\x1a\x35\xc5\x24\x54\x69\x7a\x5a\xb4\xdb\xd4\x30" "\x53\x73\x01\x84\x3a\x17\x5f\x1a\xae\xaa\x7f\x7a\x6a\x62\xa3\x9a\xd4" "\x11\x05\xa0\x51\x98\x70\x8f\x8d\xbd\xe6\xd7\x91\x81\x72\x7c\x96\x9a" "\xdb\x41\x49\x1d\x9d\xc6\x78\x7b\x53\xf5\xaf\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa1\x10\xd3\x76\x30\x07\x3b" "\x32\x1f\xce\x61\x4c\xe6\x5c\x1e\x58\x0f\x86\xaa\x38\xe4\x1e\x5e\xeb" "\xc5\x02\x0e\x55\x49\x00\x21\x5c\xa1\xa8\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74" "\xa5\x19\xd4\xf2\x23\x0e\x71\x7c\x22\x1e\xa0\x5a\x50\xfa\x69\x73\xe3" "\x3b\xcc\x4c\x3d\x7f\x2e\x89\x07\xdd\x14\x44\xb9\xbe\xb4\xab\xd9\xf8" "\xae\x57\x74", 1040); memcpy( (void*)0x20002580, "\x78\x9c\xec\xdd\x5f\x68\x5c\xe9\x79\x3f\xf0\xe7\xd5\x91\xd6\x92\xf7" "\x97\x5f\x66\x37\x1b\xe7\x8f\x73\x31\xb0\x81\x6c\xbd\xd9\x45\xb2\xbc" "\x6b\x15\x6f\x40\x8e\x15\x91\x05\xe3\x35\x2b\x2b\x17\x0b\x05\x8d\x2d" "\xd9\x1d\x56\x9a\x91\x25\xb9\x78\x43\x09\x2e\x24\x94\x90\xb6\xb8\xe4" "\x22\x97\x35\x6c\x02\xbd\xab\xaf\x5a\x58\x1a\x70\xaf\xb6\x21\x04\x44" "\xaf\x4a\x2f\x8a\xdb\x6e\xcc\xf6\x6e\x12\x9a\xb6\xf4\x22\x2a\x67\xe6" "\x1d\x69\xa4\xb5\x2d\x75\x6d\x4b\xb2\xf7\xf3\x31\xf6\xf7\xcc\x99\xe7" "\xcc\xbc\x67\x56\xcf\xe8\xcc\xec\xbc\x73\x02\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x88\xf8\xfa\x37\x4e\x0e\x8f\xa4\xfb" "\x14\x0c\xec\xe2\x60\x00\x80\x5d\x71\x66\xea\xcd\xe1\xd1\xfb\xfd\xfe" "\x07\x00\x9e\x38\xe7\xb6\x7b\xfd\x0f\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x11\x29\x8a\xf8\x6e\xa4\x78\xf7\x07\xad\x34\xd3\xbe\xdc\x31\x78\xba" "\xde\xb8\x72\x75\x7a\x62\xf2\xee\x9b\x0d\xa5\x48\xd1\x17\x45\xbb\xbe" "\xfc\x3b\x38\x72\x74\xf4\xd8\x2b\xaf\x1e\x1f\xeb\xe6\xfd\xb7\x7f\xd8" "\xbe\x10\x6f\x4c\x9d\x3b\x59\x3d\xd5\x5c\x58\x5c\x9a\x5b\x5e\x9e\x9b" "\xad\x4e\x37\xea\x17\x9a\xb3\x73\x3b\xbe\x85\x07\xdd\x7e\xab\x23\xed" "\x07\xa0\xba\xf0\xf6\x95\xd9\x8b\x17\x97\xab\x47\x5f\x1e\xdd\x74\xf5" "\xd5\xca\x9d\x03\x4f\x1f\xaa\x9c\x18\x3b\x3c\xfa\x56\xb7\x76\x7a\x62" "\x72\x72\xaa\xa7\xa6\x7f\xe0\x63\xdf\xfb\x47\xa4\x87\x77\x53\x3c\x41" "\x9e\x8a\x22\xbe\x19\x29\xde\x7f\xe9\xc3\x54\x8b\x88\xbe\x78\xf0\x5e" "\xd8\xe6\xb9\xe3\x51\x1b\x8a\xfe\xb2\xff\xda\x3b\x31\x3d\x31\xd9\xde" "\x91\xf9\x7a\xad\xb1\x52\x5e\x99\xfa\x72\x55\x7f\x44\xa5\x67\xa3\xf1" "\x6e\x8f\xec\x42\x2f\x3e\x90\xf1\x88\x6b\xe5\x7f\xa7\x72\xc0\x47\xca" "\xdd\x9b\x5a\xac\x2d\xd5\xce\xcf\xcf\x55\xcf\xd6\x96\x56\xea\x2b\xf5" "\x66\x23\xf5\x75\x46\x5b\xee\x4f\x25\xfa\x62\x2c\x45\x2c\x46\x44\xab" "\xd8\xeb\xc1\xb3\xdf\x0c\x44\x11\xc7\x22\xc5\x9d\x5f\xb7\xd2\xf9\x88" "\x28\xba\x7d\xf0\xe2\x99\xa9\x37\x87\x47\xb7\xbf\x81\xfe\x5d\x18\xe4" "\x3d\xee\xb6\x52\x44\xac\xc6\x63\xd0\xb3\xb0\x4f\x1d\x88\x22\xfe\x3c" "\x52\xfc\x70\x66\x38\x2e\xe4\xbe\x6a\xb7\xcd\x07\x11\x5f\x29\xf3\xb5" "\x88\xcb\x65\xde\x4a\x71\x3d\x5f\x4e\xe5\x13\xc4\x58\xc4\xaf\xfc\x3e" "\x81\xc7\x5a\x7f\x14\xf1\x8b\x48\xd1\x4c\xad\x34\xdb\xed\xfd\xf6\x71" "\xe5\xe9\x6f\x55\x5f\x6f\x5c\x6c\xf6\xd4\x76\x8f\x2b\x1f\xfb\xd7\x07" "\xbb\xc9\xb1\x09\xfb\xd8\x60\x14\x71\xbe\x7d\xc4\xdf\x4a\x1f\xff\xcd" "\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\x77\x14\xf1\x5e\xa4" "\xb8\xb9\xf0\x42\x5a\x8c\xde\x39\xa5\xf5\xc6\xa5\xea\xb9\xda\xf9\xf9" "\xce\xa7\x82\xbb\x9f\xfd\xaf\xe6\xad\xd6\xd6\xd6\xd6\x2a\xa9\x93\xd5" "\x9c\xc3\x39\xc7\x73\x9e\xcd\x39\x93\x73\x31\xe7\xb5\x9c\xd7\x73\xde" "\xc8\x79\x33\xe7\xad\x9c\xab\x39\x6f\xe7\x6c\xe5\x8c\xbe\x7c\xff\x39" "\xab\x39\x87\x73\x8e\xe7\x3c\x9b\x73\x26\xe7\x62\xce\x6b\x39\xaf\xe7" "\xbc\x91\xf3\x66\xce\x5b\x39\x57\x73\xde\xce\xd9\xca\x19\xe6\x3d\x01" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x90\x0d" "\x45\x11\x93\x91\xe2\xc6\xbb\x7f\xd0\x3e\xaf\x74\xb4\xcf\x4b\xff\xe9" "\x13\x63\x67\x26\x9e\xeb\x3d\x67\xfc\xe7\xb6\xb9\x9d\xb2\xf6\xe5\x88" "\x78\x2f\x76\x76\x4e\xde\x81\x7c\xae\xf1\xd4\x57\xfe\x79\xf8\xfb\x05" "\x6c\x6f\x30\x8a\xf8\x4e\x3e\xff\xdf\x1f\xed\xf5\x60\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x80\x7d\xa1\x2f\x8a\xf8\x6e\xa4\xf8\xd1\x6f\x5a\x29\x52\x44" "\x8c\x47\xcc\x44\x27\x6f\x17\x7b\x3d\x3a\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xa0\x34\x98\x8a\x38\x15\x29\xfe\xfd\x1b\x83" "\xed\xcb\xab\x11\xf1\xc5\x88\xf8\xed\x5a\xf9\x27\xe2\xbf\xd7\xb6\xda" "\xeb\x11\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\xc0\x13\x28\x15\x71\x39\x52\xfc\xf8\xfd\x56\xaa\x44\xc4\xd5\xca\x9d" "\x03\x4f\x1f\xaa\x9c\x18\x3b\x3c\xfa\x56\x11\x45\xa4\xb2\xa4\xb7\xfe" "\x8d\xa9\x73\x27\xab\xa7\x9a\x0b\x8b\x4b\x73\xcb\xcb\x73\xb3\xd5\xe9" "\x46\xfd\x42\x73\x76\x6e\xa7\x77\x37\x78\xba\xde\xb8\x72\x75\x7a\x62" "\xf2\x91\xec\xcc\xb6\x86\x1e\xf1\xf8\x87\x06\x4f\x35\x17\xdf\x59\xaa" "\x5f\xfa\xfd\x95\xbb\x5e\x7f\x70\xf0\xe4\xf9\xe5\x95\xa5\xda\x85\xbb" "\x5f\x1d\x43\xd1\x1f\x31\xdc\xbb\xe6\x48\x7b\xc0\xd3\x13\x93\xed\x41" "\xcf\xd7\x6b\x8d\xf6\xa6\xa9\xef\x1e\x03\xec\x8f\xa8\xee\x74\x67\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd8\x37\x0e" "\xa6\x22\x26\x22\xc5\xf3\x3f\x3d\x96\xba\xf3\xc6\xfb\x3b\x73\xfe\x3f" "\xd5\xb9\x54\xac\xd7\xfe\xe4\x0f\x37\xbe\x0b\x60\x7e\x4b\x76\xf5\x7e" "\x7f\xc0\xc6\x72\x77\xb2\xfa\xd6\xf5\xa3\x6f\xa5\x9d\x0e\xf4\x48\x7b" "\xe2\x7d\x75\x7a\x62\x72\x72\xaa\x67\x75\xff\xc0\x47\x4b\xcb\x31\xa5" "\x54\xc4\x67\x23\xc5\xe1\xbf\xfd\x7c\x7b\x3e\x7c\x8a\x83\x77\x9d\x1b" "\x5f\xd6\xfd\x49\xa4\x18\xfb\x9f\x63\xb9\xae\x72\xb8\xac\x1b\xdf\x54" "\x35\x78\x64\x7a\x62\xb2\x7a\xa6\xd9\x78\xe9\xe4\xfc\x7c\xf3\x42\x6d" "\xa8\x76\x7e\x7e\xae\x3a\xb5\x58\xbb\xb0\xe3\x2f\x0e\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xfb\x38\x98\x8a\xf8" "\xd3\x48\x71\xec\xf5\xd5\xd4\x3d\xef\x7c\x9e\xff\xdf\xdf\xb9\xd4\x33" "\xff\xff\xb5\x88\xee\x4c\xfe\xc1\xb4\x39\xd7\xb5\xe7\xf6\xff\xff\xf6" "\xdc\xfe\xce\xf2\xa7\x4f\x8c\xbd\x7e\xf4\xf9\x7b\xad\x7f\x14\xf3\xff" "\xcb\x31\xa5\x54\xc4\x6f\x23\xc5\x33\x7f\xf1\xf9\xf6\xf9\xf4\xbb\xf3" "\xff\x87\xb7\xd4\x96\x75\x3f\x8e\x14\xbf\xf8\xde\x97\x72\x5d\xdf\x53" "\x65\xdd\x48\x77\x77\x3a\xb7\x78\xb1\x3e\x3f\x37\x5c\xd6\xbe\x18\x29" "\xbe\x7f\xb6\x5b\x1b\xed\xda\x57\x73\xed\x67\x36\x6a\x47\xca\xda\xbf" "\x8b\x14\xcf\xfe\xde\xe6\xda\xe3\xb9\xf6\xb9\x8d\xda\xa3\x65\xed\x9d" "\x48\x31\x79\xe6\xee\xb5\x9f\xdd\xa8\x1d\x2d\x6b\x87\x22\xc5\x57\xff" "\xb8\xda\xad\x3d\x58\xd6\x7e\x3d\xd7\x1e\xda\xa8\x7d\xf9\x42\x73\x7e" "\x76\xa7\x0f\x2f\x9f\x4c\x65\xff\xff\x73\xa4\xf8\xf2\xc8\x37\x53\xf7" "\x67\xfe\x9e\xfd\xdf\xf3\xfd\x1f\xd7\xb6\xe4\xba\x8f\xf4\xfc\xfd\x97" "\x1f\x56\xff\x57\x7a\xd6\x5d\xcb\x7d\xbd\x96\xfb\x7f\x64\x9b\xfe\xbf" "\x1c\x29\xfe\xec\xfa\x97\x72\x5d\xa7\xf7\x8e\xe6\xeb\x9f\x69\xff\xbb" "\xd1\xff\xdf\x8f\x14\xbf\xf3\xa9\xcd\xb5\xaf\xe4\xda\x67\x37\x6a\x47" "\x76\xba\x5b\xb0\x97\xca\xfe\xff\x59\xa4\x58\xbd\xfd\x8f\xeb\x3f\xf3" "\xb9\xff\x73\x67\x6d\x74\x68\x6f\xff\x7f\xb1\x7f\x73\x76\x8f\x0b\xf6" "\xaa\xff\x9f\xe9\x59\x57\xc9\xe3\x1a\xfd\x3f\x3e\x16\xf0\x49\xb3\xfc" "\xce\xb7\xdf\xae\xcd\xcf\xcf\x2d\x59\xb0\x60\xc1\xc2\xfa\xc2\x5e\x3f" "\x33\x01\x8f\x5a\x79\xfc\xff\x9f\x91\xe2\x6b\x97\x8b\xd4\x7d\x1d\x9b" "\x8f\xff\xff\x5f\xe7\xd2\xc6\xeb\xff\xff\xfa\xce\xc6\xf1\xff\x89\x2d" "\xb9\x6e\x8f\x8e\xff\x9f\xed\x59\x77\x22\xbf\x6a\x19\xe8\x8f\x18\x5c" "\x59\x58\x1c\xf8\x5c\xc4\xe0\xf2\x3b\xdf\x7e\xa9\xbe\x50\xbb\x34\x77" "\x69\xae\x31\x3a\x3a\x76\xfc\x77\x8f\x8d\x1c\x3d\x3e\x32\xf0\x54\xf7" "\xc5\xfd\xc6\xd2\x8e\x1f\x3b\x78\xdc\x95\xfd\xff\x76\xa4\xf8\xc9\x5f" "\xfd\xc3\xfa\xfb\xd8\x9b\x5f\xff\xdf\xfd\xfd\xbf\x83\x5b\x72\xdd\x1e" "\xf5\xff\x67\x7a\xf7\x69\xd3\xeb\x9a\x1d\x3f\x14\xf0\x89\x53\xf6\xff" "\x5f\x46\x8a\x7f\xba\xf1\xe1\xfa\xff\x6f\xba\xdf\xfb\x7f\xdd\xf7\xf9" "\x5e\x78\x7e\x73\x0e\x75\x8b\xf6\xa8\xff\x9f\xeb\x59\x57\xcd\xff\x8c" "\xf5\xac\x7b\xa1\x88\x38\xb9\xd3\xfb\x02\x00\x00\x00\x00\x00\x00\x00" "\x80\xc7\xc4\xc1\x54\xc4\x4f\x23\xc5\x5f\xb7\xfe\x7e\xfd\x9c\xf7\x9b" "\x3f\xff\x13\x5f\xee\xd6\xf6\x7e\xfe\xef\x5e\xee\x7e\xfe\xff\x7b\x2f" "\x3f\x8a\xf9\xff\x00\xc0\xfd\x95\xbf\xff\xa7\x22\xc5\xcf\x0f\x7e\x35" "\x75\xbf\x43\x66\x27\x9f\xff\x9f\xdd\x92\xeb\xf6\xe8\xf3\xbf\x87\x7a" "\xd6\xcd\xee\xd2\xbc\xe6\x1d\x3f\xc8\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x31\xa5\x28" "\xe2\x40\xa4\x78\xf7\x07\xad\x74\xbb\x28\x2f\x77\x0c\x9e\xae\x37\xae" "\x5c\x9d\x9e\x98\xbc\xfb\x66\xef\x35\x23\xa2\x2f\x8a\x76\x7d\xf9\x77" "\x70\xe4\xe8\xe8\xb1\x57\x5e\x3d\x3e\xd6\xcd\xfb\x6f\xff\xb0\x7d\x21" "\xde\x98\x3a\x77\xb2\x7a\xaa\xb9\xb0\xb8\x34\xb7\xbc\x3c\x37\x5b\x9d" "\x6e\xd4\x2f\x34\x67\xe7\x76\x7c\x0b\x0f\xba\xfd\x56\x47\xda\x0f\x40" "\x75\xe1\xed\x2b\xb3\x17\x2f\x2e\x57\x8f\xbe\x3c\xba\xe9\xea\xab\x95" "\x3b\x07\x9e\x3e\x54\x39\x31\x76\x78\xf4\xad\x6e\xed\xf4\xc4\xe4\xe4" "\x54\x4f\x4d\xff\xc0\xc7\xbe\xf7\x8f\x48\x0f\xef\xa6\x78\x82\x3c\x15" "\x45\xfc\x3c\x52\xbc\xff\xd2\x87\xe9\x5f\x8a\xb2\xa7\x1f\xbc\x17\xb6" "\x79\xee\x78\xd4\x86\xa2\xbf\xec\xbf\xf6\x4e\x4c\x4f\x4c\xb6\x77\x64" "\xbe\x5e\x6b\xac\x94\x57\xa6\xbe\x5c\xd5\x1f\x51\xe9\xd9\x68\xbc\xdb" "\x23\xbb\xd0\x8b\x0f\x64\x3c\xe2\x5a\xf9\xdc\x5b\x0e\xf8\x48\xb9\x7b" "\x53\x8b\xb5\xa5\xda\xf9\xf9\xb9\xea\xd9\xda\xd2\x4a\x7d\xa5\xde\x6c" "\xa4\xbe\xce\x68\xd3\xcf\xfe\x23\x2a\xd1\x17\x63\x29\x62\x31\x22\x5a" "\xc5\x5e\x0f\x9e\xfd\x66\x20\x8a\xf8\x9b\x48\x71\xe7\xd7\xad\xf4\xaf" "\x45\x44\xd1\xed\x83\x17\xcf\x4c\xbd\x39\x3c\xba\xfd\x0d\xf4\xef\xc2" "\x20\xef\x71\xb7\x95\x22\x62\x35\x1e\x83\x9e\x85\x7d\xea\x40\x14\xf1" "\x5c\xa4\xf8\xe1\xcc\x70\xfc\x5b\xd1\xe9\xab\x76\xdb\x7c\x10\xf1\x95" "\x32\x5f\x8b\xb8\x5c\xe6\xad\x14\xd7\xf3\xe5\x54\x3e\x41\x8c\x45\xfc" "\xca\xef\x13\x78\xac\xf5\x47\x11\x67\x23\x45\x33\xb5\xd2\x07\x45\xee" "\xfd\xf6\x71\xe5\xe9\x6f\x55\x5f\x6f\x5c\x6c\xf6\xd4\x76\x8f\x2b\x1f" "\xfb\xd7\x07\xbb\xc9\xb1\x09\xfb\xd8\x60\x14\xf1\xcb\xf6\x11\x7f\x2b" "\xfd\xd2\xef\x73\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd8\xe7\x8a" "\xf8\x5a\xa4\xb8\xb9\xf0\x42\x6a\xcf\x0f\x5d\x9f\x53\x5a\x6f\x5c\xaa" "\x9e\xab\x9d\x9f\xef\x7c\xac\xbf\xfb\xd9\xff\x6a\xde\x6a\x6d\x6d\x6d" "\xad\x92\x3a\x59\xcd\x39\x9c\x73\x3c\xe7\xd9\x9c\x33\x39\x17\x73\x5e" "\xcb\x79\x3d\xe7\x8d\x9c\x37\x73\xde\xca\xb9\x9a\xf3\x76\xce\x56\xce" "\xe8\xcb\xf7\x9f\xb3\x9a\x73\x38\xe7\x78\xce\xb3\x39\x67\x72\x2e\xe6" "\xbc\x96\xf3\x7a\xce\x1b\x39\x6f\xe6\xbc\x95\x73\x35\xe7\xed\x9c\xad" "\x9c\xe1\x73\xd2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x3c\x22\x7d\x51\xc4\xf7\x22\xc5\x8f\x7e\xd3\x4a\x6b\x45\xe7\xfc" "\xb2\x33\xd1\xc9\xdb\xe6\xb9\xc2\x13\xed\x7f\x03\x00\x00\xff\xff\xf3" "\x71\x47\x5a", 3131); syz_mount_image(/*fs=*/0x20000100, /*dir=*/0x20000140, /*flags=MS_REC|MS_SYNCHRONOUS*/ 0x4010, /*opts=*/0x20000640, /*chdir=*/1, /*size=*/0xc3b, /*img=*/0x20002580); break; case 1: memcpy((void*)0x20000040, "blkio.throttle.io_serviced\000", 27); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000040ul, /*flags=*/0x275a, /*mode=*/0); if (res != -1) r[0] = res; break; case 2: memcpy((void*)0x20000240, "#! ", 3); *(uint8_t*)0x20000243 = 0xa; syscall(__NR_write, /*fd=*/r[0], /*data=*/0x20000240ul, /*len=*/0x208e24bul); break; case 3: syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0xb36000ul, /*prot=*/0ul, /*flags=MAP_STACK|MAP_POPULATE|MAP_FIXED|MAP_SHARED*/ 0x28011ul, /*fd=*/r[0], /*offset=*/0ul); break; case 4: syscall(__NR_ftruncate, /*fd=*/r[0], /*len=*/0x13ul); break; } } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; for (procid = 0; procid < 6; procid++) { if (fork() == 0) { use_temporary_dir(); do_sandbox_none(); } } sleep(1000000); return 0; }