// https://syzkaller.appspot.com/bug?id=7edd241cabcd5edb0c4b670567286ce6a1ac0b56 // 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 #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 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 static long syz_genetlink_get_family_id(volatile long name, volatile long sock_arg) { int fd = sock_arg; if (fd < 0) { fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (fd == -1) { return -1; } } struct nlmsg nlmsg_tmp; int ret = netlink_query_family_id(&nlmsg_tmp, fd, (char*)name, false); if ((int)sock_arg < 0) close(fd); if (ret < 0) { return -1; } return ret; } //% 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"); } else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) { strcat(opts, ",errors=withdraw"); } 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; } #define XT_TABLE_SIZE 1536 #define XT_MAX_ENTRIES 10 struct xt_counters { uint64_t pcnt, bcnt; }; 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; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; 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; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct ipt_table_desc { const char* name; struct ipt_getinfo info; struct ipt_replace replace; }; static struct ipt_table_desc ipv4_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "mangle"}, {.name = "raw"}, {.name = "security"}, }; static struct ipt_table_desc ipv6_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) struct arpt_getinfo { char name[32]; unsigned int valid_hooks; unsigned int hook_entry[3]; unsigned int underflow[3]; unsigned int num_entries; unsigned int size; }; struct arpt_get_entries { char name[32]; unsigned int size; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct arpt_replace { char name[32]; unsigned int valid_hooks; unsigned int num_entries; unsigned int size; unsigned int hook_entry[3]; unsigned int underflow[3]; unsigned int num_counters; struct xt_counters* counters; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct arpt_table_desc { const char* name; struct arpt_getinfo info; struct arpt_replace replace; }; static struct arpt_table_desc arpt_tables[] = { {.name = "filter"}, }; #define ARPT_BASE_CTL 96 #define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL) #define ARPT_SO_GET_INFO (ARPT_BASE_CTL) #define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1) static void checkpoint_iptables(struct ipt_table_desc* tables, int num_tables, int family, int level) { int fd = socket(family, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (int i = 0; i < num_tables; i++) { struct ipt_table_desc* table = &tables[i]; strcpy(table->info.name, table->name); strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->info); if (getsockopt(fd, level, IPT_SO_GET_INFO, &table->info, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->info.size > sizeof(table->replace.entrytable)) exit(1); if (table->info.num_entries > XT_MAX_ENTRIES) exit(1); struct ipt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + table->info.size; if (getsockopt(fd, level, IPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); table->replace.valid_hooks = table->info.valid_hooks; table->replace.num_entries = table->info.num_entries; 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, entries.entrytable, table->info.size); } close(fd); } static void reset_iptables(struct ipt_table_desc* tables, int num_tables, int family, int level) { int fd = socket(family, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (int i = 0; i < num_tables; i++) { struct ipt_table_desc* table = &tables[i]; if (table->info.valid_hooks == 0) continue; struct ipt_getinfo info; memset(&info, 0, sizeof(info)); strcpy(info.name, table->name); socklen_t optlen = sizeof(info); if (getsockopt(fd, level, IPT_SO_GET_INFO, &info, &optlen)) exit(1); if (memcmp(&table->info, &info, sizeof(table->info)) == 0) { struct ipt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size; if (getsockopt(fd, level, IPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); if (memcmp(table->replace.entrytable, entries.entrytable, table->info.size) == 0) continue; } struct xt_counters counters[XT_MAX_ENTRIES]; table->replace.num_counters = info.num_entries; table->replace.counters = counters; optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size; if (setsockopt(fd, level, IPT_SO_SET_REPLACE, &table->replace, optlen)) exit(1); } close(fd); } static void checkpoint_arptables(void) { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (unsigned i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) { struct arpt_table_desc* table = &arpt_tables[i]; strcpy(table->info.name, table->name); strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->info); if (getsockopt(fd, SOL_IP, ARPT_SO_GET_INFO, &table->info, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->info.size > sizeof(table->replace.entrytable)) exit(1); if (table->info.num_entries > XT_MAX_ENTRIES) exit(1); struct arpt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + table->info.size; if (getsockopt(fd, SOL_IP, ARPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); table->replace.valid_hooks = table->info.valid_hooks; table->replace.num_entries = table->info.num_entries; 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, entries.entrytable, table->info.size); } close(fd); } static void reset_arptables() { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (unsigned i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) { struct arpt_table_desc* table = &arpt_tables[i]; if (table->info.valid_hooks == 0) continue; struct arpt_getinfo info; memset(&info, 0, sizeof(info)); strcpy(info.name, table->name); socklen_t optlen = sizeof(info); if (getsockopt(fd, SOL_IP, ARPT_SO_GET_INFO, &info, &optlen)) exit(1); if (memcmp(&table->info, &info, sizeof(table->info)) == 0) { struct arpt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size; if (getsockopt(fd, SOL_IP, ARPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); if (memcmp(table->replace.entrytable, entries.entrytable, table->info.size) == 0) continue; } else { } struct xt_counters counters[XT_MAX_ENTRIES]; table->replace.num_counters = info.num_entries; table->replace.counters = counters; optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size; if (setsockopt(fd, SOL_IP, ARPT_SO_SET_REPLACE, &table->replace, optlen)) exit(1); } close(fd); } #define NF_BR_NUMHOOKS 6 #define EBT_TABLE_MAXNAMELEN 32 #define EBT_CHAIN_MAXNAMELEN 32 #define EBT_BASE_CTL 128 #define EBT_SO_SET_ENTRIES (EBT_BASE_CTL) #define EBT_SO_GET_INFO (EBT_BASE_CTL) #define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO + 1) #define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES + 1) #define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO + 1) struct ebt_replace { char name[EBT_TABLE_MAXNAMELEN]; unsigned int valid_hooks; unsigned int nentries; unsigned int entries_size; struct ebt_entries* hook_entry[NF_BR_NUMHOOKS]; unsigned int num_counters; struct ebt_counter* counters; char* entries; }; struct ebt_entries { unsigned int distinguisher; char name[EBT_CHAIN_MAXNAMELEN]; unsigned int counter_offset; int policy; unsigned int nentries; char data[0] __attribute__((aligned(__alignof__(struct ebt_replace)))); }; struct ebt_table_desc { const char* name; struct ebt_replace replace; char entrytable[XT_TABLE_SIZE]; }; static struct ebt_table_desc ebt_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "broute"}, }; static void checkpoint_ebtables(void) { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (size_t i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) { struct ebt_table_desc* table = &ebt_tables[i]; strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->replace); if (getsockopt(fd, SOL_IP, EBT_SO_GET_INIT_INFO, &table->replace, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->replace.entries_size > sizeof(table->entrytable)) exit(1); table->replace.num_counters = 0; table->replace.entries = table->entrytable; optlen = sizeof(table->replace) + table->replace.entries_size; if (getsockopt(fd, SOL_IP, EBT_SO_GET_INIT_ENTRIES, &table->replace, &optlen)) exit(1); } close(fd); } static void reset_ebtables() { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (unsigned i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) { struct ebt_table_desc* table = &ebt_tables[i]; if (table->replace.valid_hooks == 0) continue; struct ebt_replace replace; memset(&replace, 0, sizeof(replace)); strcpy(replace.name, table->name); socklen_t optlen = sizeof(replace); if (getsockopt(fd, SOL_IP, EBT_SO_GET_INFO, &replace, &optlen)) exit(1); replace.num_counters = 0; table->replace.entries = 0; for (unsigned h = 0; h < NF_BR_NUMHOOKS; h++) table->replace.hook_entry[h] = 0; if (memcmp(&table->replace, &replace, sizeof(table->replace)) == 0) { char entrytable[XT_TABLE_SIZE]; memset(&entrytable, 0, sizeof(entrytable)); replace.entries = entrytable; optlen = sizeof(replace) + replace.entries_size; if (getsockopt(fd, SOL_IP, EBT_SO_GET_ENTRIES, &replace, &optlen)) exit(1); if (memcmp(table->entrytable, entrytable, replace.entries_size) == 0) continue; } for (unsigned j = 0, h = 0; h < NF_BR_NUMHOOKS; h++) { if (table->replace.valid_hooks & (1 << h)) { table->replace.hook_entry[h] = (struct ebt_entries*)table->entrytable + j; j++; } } table->replace.entries = table->entrytable; optlen = sizeof(table->replace) + table->replace.entries_size; if (setsockopt(fd, SOL_IP, EBT_SO_SET_ENTRIES, &table->replace, optlen)) exit(1); } close(fd); } static void checkpoint_net_namespace(void) { checkpoint_ebtables(); checkpoint_arptables(); checkpoint_iptables(ipv4_tables, sizeof(ipv4_tables) / sizeof(ipv4_tables[0]), AF_INET, SOL_IP); checkpoint_iptables(ipv6_tables, sizeof(ipv6_tables) / sizeof(ipv6_tables[0]), AF_INET6, SOL_IPV6); } static void reset_net_namespace(void) { reset_ebtables(); reset_arptables(); reset_iptables(ipv4_tables, sizeof(ipv4_tables) / sizeof(ipv4_tables[0]), AF_INET, SOL_IP); reset_iptables(ipv6_tables, sizeof(ipv6_tables) / sizeof(ipv6_tables[0]), AF_INET6, SOL_IPV6); } 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/newroot/syz-inputs", 0700)) exit(1); if (mount("/syz-inputs", "./syz-tmp/newroot/syz-inputs", NULL, bind_mount_flags | MS_RDONLY, 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 setup_loop() { checkpoint_net_namespace(); } 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); } reset_net_namespace(); } 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); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { setup_loop(); 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(); close_fds(); 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[3] = {0x0, 0xffffffffffffffff, 0x0}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$exfat arguments: [ // fs: ptr[in, buffer] { // buffer: {65 78 66 61 74 00} (length 0x6) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: mount_flags = 0x2000084c (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {61 6c 6c 6f 77 5f 75 74 69 6d 65 3d 30 30 30 30 // 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 31 2c 64 69 // 73 63 61 72 64 2c 64 6d 61 73 6b 3d 30 30 30 30 30 30 30 30 30 30 // 30 30 30 30 30 30 30 30 30 30 30 30 37 2c 75 69 64 3d} (length // 0x4e) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {2c 64 6d 61 73 6b 3d 30 30 30 30 30 30 30 30 30 // 30 30 30 30 30 30 30 30 30 30 30 31 35 33 2c 69 6f 63 68 61 72 73 // 65 74 3d 6d 61 63 63 72 6f 61 74 69 61 6e 2c 67 69 64 3d} (length // 0x39) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {2c 75 69 64 3d} (length 0x5) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {2c 64 69 73 63 11 a6 83 ad 9b 89 61 72 64 2c 00} // (length 0x10) // } // } // } // chdir: int8 = 0x81 (1 bytes) // size: len = 0x14f2 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x14f2) // } // ] // returns fd_dir memcpy((void*)0x2000000000c0, "exfat\000", 6); memcpy((void*)0x200000000240, "./file1\000", 8); memcpy((void*)0x200000000e80, "allow_utime=00000000000000000000001,discard,dmask=" "00000000000000000000007,uid=", 78); sprintf((char*)0x200000000ece, "0x%016llx", (long long)0); memcpy((void*)0x200000000ee0, ",dmask=00000000000000000000153,iocharset=maccroatian,gid=", 57); sprintf((char*)0x200000000f19, "0x%016llx", (long long)0); memcpy((void*)0x200000000f2b, ",uid=", 5); sprintf((char*)0x200000000f30, "0x%016llx", (long long)0xee00); memcpy((void*)0x200000000f42, "\x2c\x64\x69\x73\x63\x11\xa6\x83\xad\x9b\x89\x61\x72\x64\x2c\x00", 16); memcpy( (void*)0x200000001580, "\x78\x9c\xec\xdc\x0b\x98\xce\xd5\xda\x30\xf0\x75\xaf\xb5\xfe\x8c\x69\xd2" "\xd3\x24\x87\x61\xdd\xeb\xfe\xf3\xa4\xc1\x32\x49\x92\x43\x42\x0e\x49\x92" "\x24\x49\x4e\x09\x49\x93\x24\x09\x89\x21\xa7\xa4\x21\x09\x39\x4e\x92\xc3" "\x10\x92\xc3\x34\x26\x8d\xf3\xf9\x90\x73\xd2\x64\x4b\x93\x24\x21\x39\x85" "\xf5\x5d\xda\xfb\x7d\xed\xfd\xb6\xdf\xb7\xfd\x7e\x7b\x7f\x9f\xeb\xda\x73" "\xff\xae\x6b\x5d\xd6\xed\xff\xdc\xf7\x73\xaf\xb9\xe7\x9a\xe7\xff\x3c\xd7" "\x35\xf3\x43\xcf\x51\xf5\x5a\xd4\xaf\xdd\x8c\x88\xc4\x3f\x05\xfe\xfc\x4f" "\x8a\x10\x22\x46\x08\x31\x4c\x08\x71\x83\x10\x22\x10\x42\x54\x8a\xaf\x14" "\x7f\xe5\x7a\x01\x05\x29\xff\xdc\x93\xb0\x7f\xad\x47\xd3\xaf\x75\x07\xec" "\x5a\xe2\xf9\xe7\x6d\x3c\xff\xbc\x8d\xe7\x9f\xb7\xf1\xfc\xf3\x36\x9e\x7f" "\xde\xc6\xf3\xcf\xdb\x78\xfe\x79\x1b\xcf\x9f\xb1\xbc\x6c\xfb\x9c\x62\x37" "\xf2\xca\xbb\x8b\x3f\xff\xcf\xcb\xf8\xf5\xff\xdf\x48\x6e\xf9\xc9\xdf\x6c" "\x2c\x7f\x73\xaf\xff\x45\x0a\xcf\x3f\x6f\xe3\xf9\xe7\x6d\x3c\xff\xbc\x8d" "\xe7\x9f\xb7\xf1\xfc\xf3\x36\x9e\xff\xbf\xbf\x5a\xff\xc3\x35\x9e\x7f\xde" "\xc6\xf3\x67\x2c\x2f\xbb\xd6\x9f\x3f\xf3\xba\xb6\xeb\x5a\x7f\xff\x31\xc6" "\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c" "\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18" "\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31" "\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63" "\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6" "\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c" "\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18" "\xcb\x1b\xce\xf9\xab\xb4\x10\xe2\x3f\xf6\xd7\xba\x2f\xc6\x18\x63\x8c\x31" "\xc6\x18\x63\x8c\xfd\xeb\xf8\xfc\xd7\xba\x03\xc6\x18\x63\x8c\x31\xc6\x18" "\x63\x8c\xfd\xbf\x07\x42\x0a\x25\xb4\x08\x44\x3e\x91\x5f\xc4\x88\x02\x22" "\x56\x5c\x27\xe2\xc4\xf5\xa2\xa0\xb8\x41\x44\xc4\x8d\x22\x5e\xdc\x24\x0a" "\x89\x9b\x45\x61\x51\x44\x14\x15\xc5\x44\x82\x28\x2e\x4a\x08\x23\x50\x58" "\x41\x22\x14\x25\x45\x29\x11\x15\xb7\x88\xd2\xe2\x56\x91\x28\xca\x88\xb2" "\xa2\x9c\x70\xa2\xbc\x48\x12\xb7\x89\x0a\xe2\x76\x51\x51\xdc\x21\x2a\x89" "\x3b\x45\x65\x71\x97\xa8\x22\xaa\x8a\x6a\xa2\xba\xb8\x5b\xd4\x10\xf7\x88" "\x9a\xa2\x96\xa8\x2d\xee\x15\x75\x44\x5d\x51\x4f\xd4\x17\xf7\x89\x06\xe2" "\x7e\xd1\x50\x3c\x20\x1a\x89\x07\x45\x63\xf1\x90\x68\x22\x1e\x16\x4d\xc5" "\x23\xa2\x99\x78\x54\x34\x17\x8f\x89\x16\xe2\x71\xd1\x52\x3c\x21\x5a\x89" "\xd6\xa2\x8d\x68\x2b\xda\xfd\x5f\xe5\xbf\x22\xfa\x8a\x57\x45\x3f\xd1\x5f" "\xa4\x88\x01\x62\xa0\x78\x4d\x0c\x12\x83\xc5\x10\x31\x54\x0c\x13\xaf\x8b" "\xe1\xe2\x0d\x31\x42\xbc\x29\x52\xc5\x48\x31\x4a\xbc\x25\x46\x8b\xb7\xc5" "\x18\xf1\x8e\x18\x2b\xc6\x89\xf1\xe2\x5d\x31\x41\x4c\x14\x93\xc4\x64\x31" "\x45\x4c\x15\x69\xe2\x3d\x31\x4d\xbc\x2f\xa6\x8b\x0f\xc4\x0c\x31\x53\xcc" "\x12\xb3\x45\xba\x98\x23\xe6\x8a\x0f\xc5\x3c\x31\x5f\x2c\x10\x1f\x89\x85" "\xe2\x63\xb1\x48\x2c\x16\x4b\xc4\x52\x91\x21\x3e\x11\x99\x62\x99\xc8\x12" "\x9f\x8a\xe5\xe2\x33\x91\x2d\x56\x88\x95\x62\x95\x58\x2d\xd6\x88\xb5\x62" "\x9d\x58\x2f\x36\x88\x8d\x62\x93\xd8\x2c\xb6\x88\xad\x62\x9b\xd8\x2e\x3e" "\x17\x3b\xc4\x4e\xb1\x4b\xec\x16\x7b\xc4\x5e\xb1\x4f\x7c\x21\xf6\x8b\x2f" "\xc5\x01\xf1\x95\xc8\x11\x5f\xff\x2f\xf3\xcf\xfe\x97\xfc\x5e\x20\x40\x80" "\x04\x09\x1a\x34\xe4\x83\x7c\x10\x03\x31\x10\x0b\xb1\x10\x07\x71\x50\x10" "\x0a\x42\x04\x22\x10\x0f\xf1\x50\x08\x0a\x41\x61\x28\x0c\x45\xa1\x28\x24" "\x40\x02\x94\x80\x12\x80\x80\x40\x40\x50\x12\x4a\x42\x14\xa2\x50\x1a\x4a" "\x43\x22\x24\x42\x59\x28\x0b\x0e\x1c\x24\x41\x12\x54\x80\xdb\xa1\x22\x54" "\x84\x4a\x50\x09\x2a\x43\x65\xa8\x02\x55\xa1\x2a\x54\x87\xea\x50\x03\x6a" "\x40\x4d\xa8\x09\xb5\xa1\x36\xd4\x81\x3a\x50\x0f\xea\xc1\x7d\x70\x1f\xdc" "\x0f\x0d\xa1\x21\x34\x82\x46\xd0\x18\x1a\x43\x13\x68\x02\x4d\xa1\x29\x34" "\x83\x66\xd0\x1c\x9a\x43\x0b\x68\x01\x2d\xa1\x25\xb4\x82\x56\xd0\x06\xda" "\x40\x3b\x68\x07\xed\xa1\x3d\x74\x80\x0e\xd0\x09\x3a\x41\x67\xe8\x0c\x5d" "\xa0\x0b\x24\x43\x32\x74\x85\xae\xd0\x0d\xba\x41\x77\xe8\x0e\x3d\xa0\x07" "\xf4\x84\x9e\xd0\x0b\x7a\x43\x6f\x78\x05\x5e\x81\x57\xe1\x55\xe8\x0f\x75" "\xe4\x00\x18\x08\x03\x61\x10\x0c\x82\x21\x30\x14\x86\xc2\xeb\x30\x1c\xde" "\x80\x37\xe0\x4d\x48\x85\x91\x30\x0a\xde\x82\xb7\xe0\x6d\x18\x03\x67\x60" "\x2c\x8c\x83\xf1\x30\x1e\x6a\xc8\x89\x30\x09\x26\x03\xc9\xa9\x90\x06\x69" "\x30\x0d\xa6\xc1\x74\x98\x0e\x33\x60\x26\xcc\x84\xd9\x90\x0e\x73\x60\x2e" "\xcc\x85\x79\x30\x1f\xe6\xc3\x47\xb0\x10\x3e\x86\x8f\x61\x31\x2c\x86\xa5" "\x90\x01\x19\x90\x09\xcb\x20\x0b\xb2\x60\x39\x9c\x85\x6c\x58\x01\x2b\x61" "\x15\xac\x86\x35\xb0\x1a\xd6\xc1\x7a\x58\x07\x1b\x61\x13\x6c\x84\x2d\xb0" "\x05\xb6\xc1\x36\xf8\x1c\x3e\x87\x9d\xb0\x13\x76\xc3\x6e\xd8\x0b\x7b\xe1" "\x0b\xf8\x02\xbe\x84\x2f\x21\x15\x72\x20\x07\x0e\xc2\x41\x38\x04\x87\xe0" "\x30\x1c\x86\x5c\xc8\x85\x23\x70\x04\x8e\xc2\x51\x38\x06\xc7\xe0\x38\x1c" "\x87\x13\x70\x12\x4e\xc1\x49\x38\x0d\xa7\xe1\x0c\x9c\x85\x73\x70\x0e\x2e" "\xc0\x05\xb8\x08\x2f\x25\x7c\xd7\x7c\x6f\x99\x0d\xa9\x42\x5e\xa1\xa5\x96" "\xf9\x64\x3e\x19\x23\x63\x64\xac\x8c\x95\x71\x32\x4e\x16\x94\x05\x65\x44" "\x46\x64\xbc\x8c\x97\x85\x64\x21\x59\x58\x16\x96\x45\x65\x51\x99\x20\x13" "\x64\x09\x59\x42\xa2\x44\x49\x32\x94\x25\x65\x49\x19\x95\x51\x59\x5a\x96" "\x96\x89\x32\x51\x96\x95\x65\xa5\x93\x4e\x26\xc9\x24\x59\x41\x56\x90\x15" "\x65\x45\x59\x49\xde\x29\x2b\xcb\xbb\x64\x15\x59\x55\x76\x74\xd5\x65\x75" "\x59\x43\x76\x72\x35\x65\x2d\x59\x5b\xd6\x96\x75\x64\x5d\x59\x4f\xd6\x97" "\xf5\x65\x03\xd9\x40\x36\x94\x0d\x65\x23\xd9\x48\x36\x96\x8d\x65\x13\xf9" "\xb0\x6c\x2a\x07\xc0\x10\x78\x54\x5e\x99\x4c\x0b\x39\x12\x5a\xca\x51\xd0" "\x4a\xb6\x96\x6d\x64\x5b\xf9\x36\x3c\x29\xdb\xcb\x31\xd0\x41\x76\x94\x9d" "\xe4\xd3\x72\x1c\x8c\x85\x2e\xb2\xbd\x4b\x96\xcf\xc9\xae\x72\x12\x74\x93" "\x2f\xc8\xc9\xf0\xa2\xec\x21\xa7\x42\x4f\xf9\xb2\xec\x25\x7b\xcb\x3e\xf2" "\x15\xd9\x57\x76\x70\xfd\x64\x7f\x39\x03\x06\xc8\x81\x72\x36\x0c\x92\x83" "\xe5\x10\x39\x54\xce\x83\xba\xf2\xca\xc4\xea\xc9\x37\x65\xaa\x1c\x29\x47" "\xc9\xb7\xe4\x52\x78\x5b\x8e\x91\xef\xc8\xb1\x72\x9c\x1c\x2f\xdf\x95\x13" "\xe4\x44\x39\x49\x4e\x96\x53\xe4\x54\x99\x26\xdf\x93\xd3\xe4\xfb\x72\xba" "\xfc\x40\xce\x90\x33\xe5\x2c\x39\x5b\xa6\xcb\x39\x72\xae\xfc\x50\xce\x93" "\xf3\xe5\x02\xf9\x91\x5c\x28\x3f\x96\x8b\xe4\x62\xb9\x44\x2e\x95\x19\xf2" "\x13\x99\x29\x97\xc9\x2c\xf9\xa9\x5c\x2e\x3f\x93\xd9\x72\x85\x5c\x29\x57" "\xc9\xd5\x72\x8d\x5c\x2b\xd7\xc9\xf5\x72\x83\xdc\x28\x37\xc9\xcd\x72\x8b" "\xdc\x2a\xb7\xc9\xed\xf2\x73\xb9\x43\xee\x94\xbb\xe4\x6e\xb9\x47\xee\x95" "\xfb\xe4\x17\x72\xbf\xfc\x52\x1e\x90\x5f\xc9\x1c\xf9\xb5\x3c\x28\xff\x24" "\x0f\xc9\x6f\xe4\x61\xf9\xad\xcc\x95\xdf\xc9\x23\xf2\x7b\x79\x54\xfe\x20" "\x8f\xc9\x1f\xe5\x71\xf9\x93\x3c\x21\x4f\xca\x53\xf2\x67\x79\x5a\xfe\x22" "\xcf\xc8\xb3\xf2\x9c\x3c\x2f\x2f\xc8\x5f\xe5\x45\x79\x49\x5e\x96\x5e\x0a" "\x05\x4a\x2a\xa5\xb4\x0a\x54\x3e\x95\x5f\xc5\xa8\x02\x2a\x56\x5d\xa7\xe2" "\xd4\xf5\xaa\xa0\xba\x41\x45\xd4\x8d\x2a\x5e\xdd\xa4\x0a\xa9\x9b\x55\x61" "\x55\x44\x15\x55\xc5\x54\x82\x2a\xae\x4a\x28\xa3\x50\x59\x45\x2a\x54\x25" "\x55\x29\x15\x55\xb7\xa8\xd2\xea\x56\x95\xa8\xca\xa8\xb2\xaa\x9c\x72\xaa" "\xbc\x4a\x52\xb7\xa9\x0a\xea\x76\x55\x51\xdd\xa1\x2a\xa9\x3b\x55\x65\x75" "\x97\xaa\xa2\xaa\xaa\x6a\xaa\xba\xba\x5b\xd5\x50\xf7\xa8\x9a\xaa\x96\xaa" "\xad\xee\x55\x75\x54\x5d\x55\x4f\xd5\x57\xf7\xa9\x06\xea\x7e\xd5\x50\x3d" "\xa0\x1a\xa9\x07\x55\x63\xf5\x90\x6a\xa2\x1e\x56\x4d\xd5\x23\xaa\x99\x7a" "\x54\x35\x57\x8f\xa9\x16\xea\x71\xd5\x52\x3d\xa1\x5a\xa9\xd6\xaa\x8d\x6a" "\xab\xda\xa9\x27\x55\x7b\xf5\x94\xea\xa0\x3a\xaa\x4e\xea\x69\xd5\x59\x3d" "\xa3\xba\xa8\x67\x55\xb2\x7a\x4e\x75\x55\xcf\xab\x6e\xea\x05\xd5\x5d\xbd" "\xa8\x7a\xa8\x97\x54\x4f\xf5\xb2\xea\xa5\x7a\xab\x3e\xea\x92\xba\xac\xbc" "\xea\xa7\xfa\xab\x14\x35\x40\x0d\x54\xaf\xa9\x41\x6a\xb0\x1a\xa2\x86\xaa" "\x61\xea\x75\x35\x5c\xbd\xa1\x46\xa8\x37\x55\xaa\x1a\xa9\x46\xa9\xb7\xd4" "\x68\xf5\xb6\x1a\xa3\xde\x51\x63\xd5\x38\x35\x5e\xbd\xab\x26\xa8\x89\x6a" "\x92\x9a\xac\xa6\xa8\xa9\x2a\x4d\xbd\xa7\xa6\xa9\xf7\xd5\x74\xf5\x81\x9a" "\xa1\x66\xaa\x59\x6a\xb6\x4a\x57\x73\xd4\x90\xbf\x54\x5a\xf0\x0f\xe4\xbf" "\xff\x77\xf2\x47\xfc\xf6\xec\xdb\xd4\x76\xf5\xb9\xda\xa1\x76\xaa\x5d\x6a" "\xb7\xda\xa3\xf6\xaa\x7d\x6a\x9f\xda\xaf\xf6\xab\x03\xea\x80\xca\x51\x39" "\xea\xa0\x3a\xa8\x0e\xa9\x43\xea\xb0\x3a\xac\x72\x55\xae\x3a\xa2\x8e\xa8" "\xa3\xea\xa8\x3a\xa6\x8e\xa9\xe3\xea\xb8\x3a\xa1\x4e\xaa\xf3\xea\x67\x75" "\x5a\xfd\xa2\xce\xa8\xb3\xea\xac\x3a\xaf\x2e\xa8\x0b\xea\xe2\x5f\xbe\x06" "\x42\x83\x96\x5a\x69\xad\x03\x9d\x4f\xe7\xd7\x31\xba\x80\x8e\xd5\xd7\xe9" "\x38\x7d\xbd\x2e\xa8\x6f\xd0\x11\x7d\xa3\x8e\xd7\x37\xe9\x42\xfa\x66\x5d" "\x58\x17\xd1\x45\x75\x31\x9d\xa0\x8b\xeb\x12\xda\x68\xd4\x56\x93\x0e\x75" "\x49\x5d\x4a\x47\xf5\x2d\xba\xb4\xbe\x55\x27\xea\x32\xba\xac\x2e\xa7\x9d" "\x2e\xaf\x93\xf4\x6d\xff\x74\xfe\x1f\xf5\xd7\x4e\xb7\xd3\xed\x75\x7b\xdd" "\x41\x77\xd0\x9d\x74\x27\xdd\x59\x77\xd6\x5d\x74\x17\x9d\xac\x93\x75\x57" "\xdd\x55\x77\xd3\xdd\x74\x77\xdd\x5d\xf7\xd0\x3d\x74\x4f\xdd\x53\xf7\xd2" "\xbd\x74\x1f\xdd\x47\xf7\xd5\x7d\x75\x3f\xdd\x4f\xa7\xe8\x14\x3d\x50\xbf" "\xa6\x07\xe9\xc1\x7a\x88\x1e\xaa\x87\xe9\xd7\xf5\x70\x3d\x5c\x8f\xd0\x23" "\x74\xaa\x4e\xd5\xa3\xf4\x28\x3d\x5a\x8f\xd6\x63\xf4\x18\x3d\x56\x8f\xd5" "\xe3\xf5\x78\x3d\x41\x4f\xd0\x93\xf4\x24\x3d\x45\x4f\xd1\x69\x3a\x4d\x4f" "\xd3\xd3\xf4\x74\x3d\x5d\xcf\xd0\x33\xf4\x2c\x3d\x4b\xa7\xeb\x74\x3d\x57" "\xcf\xd5\xf3\xf4\x3c\xbd\x40\x2f\xd0\x0b\xf5\x42\xbd\x48\x2f\xd2\x4b\xf4" "\x12\x9d\xa1\x33\x74\xa6\xce\xd4\x59\x3a\x4b\x2f\xd7\xcb\x75\xb6\x5e\xa1" "\x57\xe8\x55\x7a\x95\x5e\xa3\xd7\xe8\x75\x7a\x9d\xde\xa0\x37\xe8\x4d\x7a" "\x93\xde\xa2\xb7\xe8\x6c\xbd\x5d\x6f\xd7\x3b\xf4\x0e\xbd\x4b\xef\xd2\x7b" "\xf4\x1e\xbd\x4f\xef\xd3\xfb\xf5\x7e\x7d\x40\x1f\xd0\x39\x3a\x47\x1f\xd4" "\x07\xf5\x21\x7d\x48\x1f\xd6\x87\x75\xae\xce\xd5\x47\xf4\x11\x7d\x54\x1f" "\xd5\xc7\xf4\x31\x7d\x5c\x1f\xd7\x27\xf4\x09\x7d\x4a\x9f\xd2\xa7\xf5\x69" "\x7d\x46\x9f\xd1\xe7\xf4\x39\x7d\x41\x5f\xd0\x17\xf5\x45\x7d\x59\x5f\xbe" "\x72\xdb\x17\xc8\x40\x06\x3a\xd0\x41\xbe\x20\x5f\x10\x13\xc4\x04\xb1\x41" "\x6c\x10\x17\xc4\x05\x05\x83\x82\x41\x24\x88\x04\xf1\x41\x7c\x50\x28\xb8" "\x39\x28\x1c\x14\x09\x8a\x06\xc5\x82\x84\xa0\x78\x50\x22\x30\x01\x06\x36" "\xa0\x20\x0c\x4a\x06\xa5\x82\x68\x70\x4b\x50\x3a\xb8\x35\x48\x0c\xca\x04" "\x65\x83\x72\x81\x0b\xca\x07\x49\xc1\x6d\x41\x85\xe0\xf6\xa0\x62\x70\x47" "\x50\x29\xb8\x33\xa8\x1c\xdc\x15\x54\x09\xaa\x06\xd5\x82\xea\xc1\xdd\x41" "\x8d\xe0\x9e\xa0\x66\x50\x2b\xa8\x1d\xdc\x1b\xd4\x09\xea\x06\xf5\x82\xfa" "\xc1\x7d\x41\x83\xe0\xfe\xa0\x61\xf0\x40\xd0\x28\x78\x30\x68\x1c\x3c\x14" "\x34\x09\x1e\x0e\x9a\x06\x8f\x04\xcd\x82\x47\x83\xe6\xc1\x63\x41\x8b\xe0" "\xf1\xa0\x65\xf0\x44\xd0\x2a\x68\x1d\xb4\x09\xda\x06\xed\xfe\xa5\xf5\xbd" "\x3f\x53\xe4\x29\xd7\xcf\xf4\x37\x29\x66\x80\x19\x68\x5e\x33\x83\xcc\x60" "\x33\xc4\x0c\x35\xc3\xcc\xeb\x66\xb8\x79\xc3\x8c\x30\x6f\x9a\x54\x33\xd2" "\x8c\x32\x6f\x99\xd1\xe6\x6d\x33\xc6\xbc\x63\xc6\x9a\x71\x66\xbc\x79\xd7" "\x4c\x30\x13\xcd\x24\x33\xd9\x4c\x31\x53\x4d\x9a\x79\xcf\x4c\x33\xef\x9b" "\xe9\xe6\x03\x33\xc3\xcc\x34\xb3\xcc\x6c\x93\x6e\xe6\x98\xb9\xe6\x43\x33" "\xcf\xcc\x37\x0b\xcc\x47\x66\xa1\xf9\xd8\x2c\x32\x8b\xcd\x12\xb3\xd4\x64" "\x98\x4f\x4c\xa6\x59\x66\xb2\xcc\xa7\x66\xb9\xf9\xcc\x64\x9b\x15\x66\xa5" "\x59\x65\x56\x9b\x35\x66\xad\x59\x67\xd6\x9b\x0d\x66\xa3\xd9\x64\x36\x9b" "\x2d\x66\xab\xd9\x66\xb6\x9b\xcf\xcd\x0e\xb3\xd3\xec\x32\xbb\xcd\x1e\xb3" "\xd7\xec\x33\x5f\x98\xfd\xe6\x4b\x73\xc0\x7c\x65\x72\xcc\xd7\xe6\xa0\xf9" "\x93\x39\x64\xbe\x31\x87\xcd\xb7\x26\xd7\x7c\x67\x8e\x98\xef\xcd\x51\xf3" "\x83\x39\x66\x7e\x34\xc7\xcd\x4f\xe6\x84\x39\x69\x4e\x99\x9f\xcd\x69\xf3" "\x8b\x39\x63\xce\x9a\x73\xe6\xbc\xb9\x60\x7e\x35\x17\xcd\x25\x73\xd9\xf8" "\x2b\x37\xf7\x57\x5e\xde\x51\xa3\xc6\x7c\x98\x0f\x63\x30\x06\x63\x31\x16" "\xe3\x30\x0e\x0b\x62\x41\x8c\x60\x04\xe3\x31\x1e\x0b\x61\x21\x2c\x8c\x85" "\xb1\x28\x16\xc5\x04\x4c\xc0\x12\x58\x02\xaf\x20\x24\x2c\x89\x25\x31\x8a" "\x51\x2c\x8d\xa5\x31\x11\x13\xb1\x2c\x96\x45\x87\x0e\x93\x30\x09\x2b\x60" "\x05\xac\x88\x15\xb1\x12\x56\xc2\xca\x58\x19\xab\x60\x15\xac\x86\xd5\xf0" "\x6e\xbc\x1b\xef\xc1\x7b\xb0\x16\xd6\xc2\x7b\xf1\x5e\xac\x8b\x75\xb1\x3e" "\xd6\xc7\x06\xd8\x00\x1b\x62\x43\x6c\x84\x8d\xb0\x31\x36\xc6\x26\xd8\x04" "\x9b\x62\x53\x6c\x86\xcd\xb0\x39\x36\xc7\x16\xd8\x02\x5b\x62\x4b\x6c\x85" "\xad\xb0\x0d\xb6\xc1\x76\xd8\x0e\xdb\x63\x7b\xec\x80\x1d\xb0\x13\x76\xc2" "\xce\xd8\x19\xbb\x60\x17\x4c\xc6\x64\xec\x8a\x5d\xb1\x1b\x76\xc3\xee\xd8" "\x1d\x7b\x60\x0f\xec\x89\x3d\xb1\x17\xf6\xc2\x3e\xd8\x07\xfb\x62\x5f\xec" "\x87\xfd\x30\x05\x53\x70\x20\x0e\xc4\x41\x38\x08\x87\xe0\x10\x1c\x86\xc3" "\x70\x38\x0e\xc7\x11\x38\x02\x53\x31\x15\x47\xe1\x28\x1c\x8d\xa3\x71\x0c" "\x8e\xc1\xb1\x38\x0e\xc7\xe3\xbb\x38\x01\x27\xe2\x24\x9c\x8c\x53\x70\x2a" "\xa6\x61\x1a\x4e\xc3\x69\x38\x1d\xa7\xe3\x0c\x9c\x81\xb3\x70\x16\xa6\x63" "\x3a\xce\xc5\xb9\x38\x0f\xe7\xe1\x02\x5c\x80\x0b\x71\x21\x2e\xc2\x45\xb8" "\x04\x97\x60\x06\x66\x60\x26\x66\x62\x16\x66\xe1\x72\x5c\x8e\xd9\x98\x8d" "\x2b\x71\x25\xae\xc6\xd5\xb8\x16\xd7\xe2\x7a\x5c\x8f\x1b\x71\x23\x6e\xc6" "\xcd\xb8\x15\xb7\xe2\x76\xdc\x8e\x3b\x70\x07\xee\xc2\x5d\xb8\x07\xf7\xe0" "\x3e\xdc\x87\xfb\x71\x3f\x1e\xc0\x03\x98\x83\x39\x78\x10\x0f\xe2\x21\x3c" "\x84\x87\xf1\x30\xe6\x62\x2e\x1e\xc1\x23\x78\x14\x8f\xe2\x31\x3c\x86\xc7" "\xf1\x38\x9e\xc0\x13\x78\x0a\x4f\xe1\x69\x3c\x8d\x67\xf0\x0c\x9e\xc3\x73" "\x78\x01\x7f\xc5\x8b\x78\x09\x2f\xa3\xc7\x18\x2b\x45\xac\xbd\xce\xc6\xd9" "\xeb\x6d\x41\x7b\x83\x8d\xb1\x05\xec\x5f\xc7\x45\x6d\x31\x9b\x60\x8b\xdb" "\x12\xd6\xd8\xc2\xb6\xc8\xdf\xc4\x68\xad\x4d\xb4\x65\x6c\x59\x5b\xce\x3a" "\x5b\xde\x26\xd9\xdb\x7e\x17\x57\xb1\x55\x6d\x35\x5b\xdd\xde\x6d\x6b\xd8" "\x7b\x6c\xcd\xdf\xc5\x0d\xec\xfd\xb6\xa1\x7d\xc0\x36\xb2\x0f\xda\xfa\xf6" "\xbe\xbf\x89\x1b\xdb\x87\x6c\x13\xfb\xb8\x6d\x6a\x9f\xb0\xcd\x6c\x6b\xdb" "\xdc\xb6\xb5\x2d\xec\xe3\xb6\xa5\x7d\xc2\xb6\xb2\xad\x6d\x1b\xdb\xd6\x76" "\xb6\xcf\xd8\x2e\xf6\x59\x9b\x6c\x9f\xb3\x5d\xed\xf3\xbf\x8b\x33\xed\x32" "\xbb\xde\x6e\xb0\x1b\xed\x26\xbb\xdf\x7e\x69\xcf\xd9\xf3\xf6\xa8\xfd\xc1" "\x5e\xb0\xbf\xda\x7e\xb6\xbf\x1d\x66\x5f\xb7\xc3\xed\x1b\x76\x84\x7d\xd3" "\xa6\xda\x91\xbf\x8b\xc7\xdb\x77\xed\x04\x3b\xd1\x4e\xb2\x93\xed\x14\x3b" "\xf5\x77\xf1\x2c\x3b\xdb\xa6\xdb\x39\x76\xae\xfd\xd0\xce\xb3\xf3\x7f\x17" "\x67\xd8\x4f\xec\x42\x9b\x65\x17\xd9\xc5\x76\x89\x5d\xfa\x5b\x7c\xa5\xa7" "\x2c\xfb\xa9\x5d\x6e\x3f\xb3\xd9\x76\x85\x5d\x69\x57\xd9\xd5\x76\x8d\x5d" "\x6b\xd7\xfd\x67\xaf\xab\xec\x16\xbb\xd5\x6e\xb3\xfb\xec\x17\x76\x87\xdd" "\x69\x77\xd9\xdd\x76\x8f\xdd\xfb\x5b\x7c\xe5\x1c\x07\xec\x57\x36\xc7\x7e" "\x6d\x8f\xd8\xef\xed\x21\xfb\x8d\x3d\x6c\x8f\xd9\x5c\xfb\xdd\x6f\xf1\x95" "\xf3\x1d\xb3\x3f\xda\xe3\xf6\x27\x7b\xc2\x9e\xb4\xa7\xec\xcf\xf6\xb4\xfd" "\xc5\x9e\xb1\x67\x7f\x3b\xff\x95\xb3\xff\x6c\x2f\xd9\xcb\xd6\x5b\x41\x40" "\x92\x14\x69\x0a\x28\x1f\xe5\xa7\x18\x2a\x40\xb1\x74\x1d\xc5\xd1\xf5\x54" "\x90\x6e\xa0\x08\xdd\x48\xf1\x74\x13\x15\xa2\x9b\xa9\x30\x15\xa1\xa2\x54" "\x8c\x12\xa8\x38\x95\x20\x43\x48\x96\x88\x42\x2a\x49\xa5\x28\x4a\xb7\x50" "\x69\xba\x95\x12\xa9\x0c\x95\xa5\x72\xe4\xa8\x3c\x25\xd1\x6d\x54\x81\x6e" "\xa7\x8a\x74\x07\x55\xa2\x3b\xa9\x32\xdd\x45\x55\xa8\x2a\x55\xa3\xea\x74" "\x37\xd5\xa0\x7b\xa8\x26\xd5\xa2\xda\x74\x2f\xd5\xa1\xba\x54\x8f\xea\xd3" "\x7d\xd4\x80\xee\xa7\x86\xf4\x00\x35\xa2\x07\xa9\x31\x3d\x44\x4d\xe8\x61" "\x6a\x4a\x8f\x50\x33\x7a\x94\x9a\xd3\x63\xd4\x82\x1e\xa7\x96\xf4\x04\xb5" "\xa2\xd6\xd4\x86\xda\x52\x3b\x7a\x92\xda\xd3\x53\xd4\x81\x3a\x52\x27\x7a" "\x9a\x3a\xd3\x33\xd4\x85\x9e\xa5\x64\x7a\x8e\xba\xd2\xf3\xd4\x8d\x5e\xa0" "\xee\xf4\x22\xf5\xa0\x97\xa8\x27\xbd\x4c\xbd\xa8\x37\xf5\xa1\x57\xa8\x2f" "\xbd\x4a\xfd\xa8\x3f\xa5\xd0\x00\x1a\x48\xaf\xd1\x20\x1a\x4c\x43\x68\x28" "\x0d\xa3\xd7\x69\x38\xbd\x41\x23\xe8\x4d\x4a\xa5\x91\x34\x8a\xde\xa2\xd1" "\xf4\x36\x8d\xa1\x77\x68\x2c\x8d\xa3\xf1\xf4\x2e\x4d\xa0\x89\x34\x89\x26" "\xd3\x14\x9a\x4a\x69\xf4\x1e\x4d\xa3\xf7\x69\x3a\x7d\x40\x33\x68\x26\xcd" "\xa2\xd9\x94\x4e\x73\x68\x2e\x7d\x48\xf3\x68\x3e\x2d\xa0\x8f\x68\x21\x7d" "\x4c\x8b\x68\x31\x2d\xa1\xa5\x94\x41\x9f\x50\x26\x2d\xa3\x2c\xfa\x94\x96" "\xd3\x67\x94\x4d\x2b\x68\x25\xad\xa2\xd5\xb4\x86\xd6\xd2\x3a\x5a\x4f\x1b" "\x68\x23\x6d\xa2\xcd\xb4\x85\xb6\xd2\x36\xda\x4e\x9f\xd3\x0e\xda\x49\xbb" "\x68\x37\xed\xa1\xbd\xb4\x8f\xbe\xa0\xfd\xf4\x25\x1d\xa0\xaf\x28\x87\xbe" "\xa6\x83\xf4\x27\x3a\x44\xdf\xd0\x61\xfa\x96\x72\xe9\x3b\x3a\x42\xdf\xd3" "\x51\xfa\x81\x8e\xd1\x8f\x74\x9c\x7e\xa2\x13\x74\x92\x4e\xd1\xcf\x74\x9a" "\x7e\xa1\x33\x74\x96\xce\xd1\x79\xba\x40\xbf\xd2\x45\xba\x44\x97\xc9\x93" "\x08\x21\x94\xa1\x0a\x75\x18\x84\xf9\xc2\xfc\x61\x4c\x58\x20\x8c\x0d\xaf" "\x0b\xe3\xc2\xeb\xc3\x82\xe1\x0d\x61\x24\xbc\x31\x8c\x0f\x6f\x0a\x0b\x85" "\x37\x87\x85\xc3\x22\x61\xd1\xb0\x58\x98\x10\x16\x0f\x4b\x84\x26\xc4\xd0" "\x86\x14\x86\x61\xc9\xb0\x54\x18\x0d\x6f\x09\x4b\x87\xb7\x86\x89\x61\x99" "\xb0\x6c\x58\x2e\x74\x61\xf9\x30\x29\xbc\x2d\xac\x10\xde\x1e\x56\x0c\xef" "\x08\x2b\x85\x77\x86\x95\xc3\xbb\xc2\x2a\x61\xd5\xf0\xf1\x07\xab\x87\x77" "\x87\x35\xc2\x7b\xc2\x9a\x61\xad\xb0\x76\x78\x6f\x58\x27\xac\x1b\xd6\x0b" "\xeb\x87\xf7\x85\x0d\xc2\xfb\xc3\x86\xe1\x03\x61\xa3\xf0\xc1\xb0\x62\xf8" "\x50\xd8\x24\x7c\x38\x6c\x1a\x3e\x12\x36\x0b\x1f\x0d\x9b\x87\x8f\x85\x2d" "\xc2\xc7\xc3\x96\xe1\x13\x61\xab\xb0\x75\xd8\x26\x6c\x1b\xb6\x0b\x9f\x0c" "\xdb\x87\x4f\x85\x1d\xc2\x8e\x61\xa7\xf0\xe9\xb0\x73\xf8\x4c\xd8\x25\x7c" "\x36\x4c\x0e\x9f\x0b\xbb\x86\xcf\xff\xe1\xf5\x94\x70\x40\x38\x30\x7c\x2d" "\x7c\x2d\xf4\xfe\x01\xb5\x24\xba\x34\x9a\x11\xfd\x24\x9a\x19\x5d\x16\xcd" "\x8a\x7e\x1a\x5d\x1e\xfd\x2c\x9a\x1d\x5d\x11\x5d\x19\x5d\x15\x5d\x1d\x5d" "\x13\x5d\x1b\x5d\x17\x5d\x1f\xdd\x10\xdd\x18\xdd\x14\xdd\x1c\xdd\x12\xdd" "\x1a\xdd\x16\xf5\xbe\x7e\x7e\xe1\xc0\x49\xa7\x9c\x76\x81\xcb\xe7\xf2\xbb" "\x18\x57\xc0\xc5\xba\xeb\x5c\x9c\xbb\xde\x15\x74\x37\xb8\x88\xbb\xd1\xc5" "\xbb\x9b\x5c\x21\x77\xb3\x2b\xec\x8a\xb8\xa2\xae\x98\x4b\x70\xc5\x5d\x09" "\x67\x1c\x3a\xeb\xc8\x85\xae\xa4\x2b\xe5\xa2\xee\x16\x57\xda\xdd\xea\x12" "\x5d\x19\x57\xd6\x95\x73\xce\x95\x77\x49\xae\xad\x6b\xe7\xda\xb9\xf6\xee" "\x29\xd7\xc1\x75\x74\x9d\xdc\xd3\xee\x69\xf7\x8c\x7b\xc6\x3d\xeb\x9e\x75" "\xcf\xb9\xae\xee\x79\xd7\xcd\xbd\xe0\xba\xbb\x17\x5d\x0f\xf7\x92\x7b\xc9" "\xbd\xec\x7a\xb9\xde\xae\x8f\x7b\xc5\xf5\x75\xaf\xba\x7e\xae\xbf\x4b\x71" "\x29\x6e\xa0\x1b\xe8\x06\xb9\x41\x6e\x88\x1b\xe2\x86\xb9\x61\x6e\xb8\x1b" "\xee\x46\xb8\x11\x2e\xd5\xa5\xba\x51\x6e\x94\x1b\xed\x46\xbb\x31\x6e\x8c" "\x1b\xeb\xc6\xba\xf1\x6e\xbc\x9b\xe0\x26\xb8\x49\x6e\x92\x9b\xe2\xa6\xb8" "\x34\x97\xe6\xa6\xb9\x69\x6e\xba\x9b\xee\x66\xb8\x19\x6e\x96\x9b\xe5\xd2" "\x5d\xba\x9b\xeb\xe6\xba\x79\x6e\x9e\x5b\xe0\x16\xb8\x85\x89\x0b\xdd\x22" "\xb7\xc8\x2d\x71\x4b\x5c\x86\xcb\x70\x99\x2e\xd3\x65\xb9\x2c\xb7\xdc\x2d" "\x77\xd9\x2e\xdb\xad\x74\x2b\xdd\x6a\xb7\xda\xad\x75\x6b\xdd\x7a\xb7\xde" "\x6d\x74\x1b\xdd\x66\xb7\xd9\x6d\x75\x5b\xdd\x76\xb7\xdd\xed\x70\x3b\xdc" "\x2e\xb7\xcb\xed\x71\x7b\xdc\x3e\xb7\xcf\xed\x77\xfb\xdd\x01\x77\xc0\xe5" "\xb8\x1c\x77\xd0\x1d\x74\x87\xdc\x21\x77\xd8\x7d\xeb\x72\xdd\x77\xee\x88" "\xfb\xde\x1d\x75\x3f\xb8\x63\xee\x47\x77\xdc\xfd\xe4\x4e\xb8\x93\xee\x94" "\xfb\xd9\x9d\x76\xbf\xb8\x33\xee\xac\x3b\xe7\xce\xbb\x0b\xee\x57\x77\xd1" "\x5d\x72\x97\x9d\x77\x69\x91\xf7\x22\xd3\x22\xef\x47\xa6\x47\x3e\x88\xcc" "\x88\xcc\x8c\xcc\x8a\xcc\x8e\xa4\x47\xe6\x44\xe6\x46\x3e\x8c\xcc\x8b\xcc" "\x8f\x2c\x88\x7c\x14\x59\x18\xf9\x38\xb2\x28\xb2\x38\xb2\x24\xb2\x34\x92" "\x11\xf9\x24\x92\x19\x59\x16\xc9\x8a\x7c\x1a\x59\x1e\xf9\x2c\x92\x1d\x59" "\x11\x59\x19\x59\x15\x59\x1d\x59\x13\xf1\xbe\xf8\x8e\xd0\x97\xf4\xa5\x7c" "\xd4\xdf\xe2\x4b\xfb\x5b\x7d\xa2\x2f\xe3\xcb\xfa\x72\xde\xf9\xf2\x3e\xc9" "\xdf\xe6\x2b\xf8\xdb\x7d\x45\x7f\x87\xaf\xe4\xef\xf4\x95\xfd\x5d\xbe\x8a" "\xaf\xea\xab\xf9\x27\x7c\x2b\xdf\xda\xb7\xf1\x6d\x7d\x3b\xff\xa4\x6f\xef" "\x9f\xf2\x1d\x7c\x47\xdf\xc9\x3f\xed\x3b\xfb\x67\x7c\x17\xff\xac\x4f\xf6" "\xcf\xf9\xae\xfe\x79\xdf\xcd\xbf\xe0\xbb\xfb\x17\x7d\x0f\xff\x92\xef\xe9" "\x5f\xf6\xbd\x7c\x6f\xdf\xc7\xbf\xe2\xfb\xfa\x57\x7d\x3f\xdf\xdf\xa7\xf8" "\x01\x7e\xa0\x7f\xcd\x0f\xf2\x83\xfd\x10\x3f\xd4\x0f\xf3\xaf\xfb\xe1\xfe" "\x0d\x3f\xc2\xbf\xe9\x53\xfd\x48\x3f\xca\xbf\xe5\x47\xfb\xb7\xfd\x18\xff" "\x8e\x1f\xeb\xc7\xf9\xf1\xfe\x5d\x3f\xc1\x4f\xf4\x93\xfc\x64\x3f\xc5\x4f" "\xf5\x69\xfe\x3d\x3f\xcd\xbf\xef\xa7\xfb\x0f\xfc\x0c\x3f\xd3\xcf\xf2\xb3" "\x7d\xba\x9f\xe3\xe7\xfa\x0f\xfd\x3c\x3f\xdf\x2f\xf0\x1f\xf9\x85\xfe\x63" "\xbf\xc8\x2f\xf6\x4b\xfc\x52\x9f\xe1\x3f\xf1\x99\x7e\x99\xcf\xf2\x9f\xfa" "\xe5\xfe\x33\x9f\xed\x57\xf8\x95\x7e\x95\x5f\xed\xd7\xf8\xb5\x7e\x9d\x5f" "\xef\x37\xf8\x8d\x7e\x93\xdf\xec\xb7\xf8\xad\x7e\x9b\xdf\xee\x3f\xf7\x3b" "\xfc\x4e\xbf\xcb\xef\xf6\x7b\xfc\x5e\xbf\xcf\x7f\xe1\xf7\xfb\x2f\xfd\x01" "\xff\x95\xcf\xf1\x5f\xfb\x83\xfe\x4f\xfe\x90\xff\xc6\x1f\xf6\xdf\xfa\x5c" "\xff\x9d\x3f\xe2\xbf\xf7\x47\xfd\x0f\xfe\x98\xff\xd1\x1f\xf7\x3f\xf9\x13" "\xfe\xa4\x3f\xe5\x7f\xf6\xa7\xfd\x2f\xfe\x8c\x3f\xeb\xcf\xf9\xf3\xfe\x82" "\xff\xd5\x5f\xf4\x97\xfc\x65\xfe\x9d\x35\xc6\x18\x63\x8c\xb1\x7f\x88\xfa" "\x83\xeb\x03\xfe\xce\xff\xc9\xbf\xac\x2b\x06\x0a\x21\xae\xdf\x59\x2c\xf7" "\xbf\xd6\xdc\x5c\xf8\xcf\xfb\xc1\x32\xa1\x73\x44\x08\xf1\x5c\xff\x9e\x8f" "\xfe\xc7\xaa\x53\x27\x25\x25\xe5\x2f\x8f\xcd\x56\x22\x28\xb5\x58\x08\x11" "\xb9\x9a\x9f\x4f\x5c\x8d\x57\x88\x4e\xe2\x19\x91\x2c\x3a\x8a\x0a\x7f\xb7" "\xbf\xc1\xb2\xf7\x05\xfa\x83\xfa\xd1\x3b\x85\x88\xfd\xab\x9c\x18\x71\x35" "\xbe\x5a\xff\xf6\xff\xa6\xfe\x93\x4f\x8f\xcf\xac\x1c\x9e\x8b\xff\x1f\xea" "\x2f\x16\x22\xb1\xd4\xd5\x9c\x02\xe2\x6a\x7c\xb5\x7e\xc5\xff\xa6\x7e\x91" "\xf6\x7f\xd0\x7f\x81\x6f\xd2\x84\xe8\xf0\x57\x39\x71\xe2\x6a\x7c\xb5\x7e" "\x92\x78\x4a\x3c\x2f\x92\xff\xe6\x91\x8c\x31\xc6\x18\x63\x8c\x31\xc6\xd8" "\x9f\x0d\x96\xd5\xba\xeb\x7f\xe0\xfd\x79\x82\xbe\x9a\x93\x5f\x5c\x8d\xff" "\xe8\xfd\x39\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\xae\xbd\x17\x7b\xf7\x79" "\xf6\xc9\xe4\xe4\x8e\xdd\x79\xc3\x1b\xde\xf0\xe6\x3f\x37\xd7\xfa\x27\x13" "\x63\x8c\x31\xc6\x18\x63\xec\x5f\xed\xea\x4d\xff\xb5\xee\x84\x31\xc6\x18" "\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31" "\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\xcb" "\xbb\xfe\x7f\xfc\x39\xb1\x6b\x7d\x46\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c" "\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18" "\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31" "\xc6\x18\x63\xec\x5a\xfb\x3f\x01\x00\x00\xff\xff\x08\x3a\x3c\x17", 5362); syz_mount_image( /*fs=*/0x2000000000c0, /*dir=*/0x200000000240, /*flags=MS_NOEXEC|MS_NODIRATIME|MS_NODEV|MS_MANDLOCK|0x20000000*/ 0x2000084c, /*opts=*/0x200000000e80, /*chdir=*/0x81, /*size=*/0x14f2, /*img=*/0x200000001580); // prlimit64 arguments: [ // pid: pid (resource) // res: rlimit_type = 0xe (8 bytes) // new: ptr[in, rlimit] { // rlimit { // soft: intptr = 0x8 (8 bytes) // hard: intptr = 0x20002000000000 (8 bytes) // } // } // old: nil // ] *(uint64_t*)0x200000000140 = 8; *(uint64_t*)0x200000000148 = 0x20002000000000; syscall(__NR_prlimit64, /*pid=*/0, /*res=RLIMIT_RTPRIO*/ 0xeul, /*new=*/0x200000000140ul, /*old=*/0ul); // sendmsg$TIPC_CMD_ENABLE_BEARER arguments: [ // fd: sock_nl_generic (resource) // msg: nil // f: send_flags = 0x0 (8 bytes) // ] syscall(__NR_sendmsg, /*fd=*/(intptr_t)-1, /*msg=*/0ul, /*f=*/0ul); // sched_setscheduler arguments: [ // pid: pid (resource) // policy: sched_policy = 0x2 (8 bytes) // prio: ptr[in, int32] { // int32 = 0x4 (4 bytes) // } // ] *(uint32_t*)0x200000000200 = 4; syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_RR*/ 2ul, /*prio=*/0x200000000200ul); // mmap arguments: [ // addr: VMA[0xb36000] // len: len = 0xb36000 (8 bytes) // prot: mmap_prot = 0xb635773f06ebbeee (8 bytes) // flags: mmap_flags = 0x8031 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0xb36000ul, /*prot=PROT_GROWSUP|PROT_SEM|PROT_WRITE|PROT_EXEC|0xb635773f04ebbee0*/ 0xb635773f06ebbeeeul, /*flags=MAP_POPULATE|MAP_FIXED|MAP_ANONYMOUS|MAP_SHARED*/ 0x8031ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); // socketpair$unix arguments: [ // domain: const = 0x1 (8 bytes) // type: unix_socket_type = 0x2 (8 bytes) // proto: const = 0x0 (4 bytes) // fds: nil // ] syscall(__NR_socketpair, /*domain=*/1ul, /*type=SOCK_DGRAM*/ 2ul, /*proto=*/0, /*fds=*/0ul); // sendmmsg$unix arguments: [ // fd: sock_unix (resource) // mmsg: nil // vlen: len = 0x0 (8 bytes) // f: send_flags = 0x0 (8 bytes) // ] syscall(__NR_sendmmsg, /*fd=*/(intptr_t)-1, /*mmsg=*/0ul, /*vlen=*/0ul, /*f=*/0ul); // syz_genetlink_get_family_id$nl80211 arguments: [ // name: ptr[in, buffer] { // buffer: {6e 6c 38 30 32 31 31 00} (length 0x8) // } // fd: sock_nl_generic (resource) // ] // returns nl80211_family_id memcpy((void*)0x2000000014c0, "nl80211\000", 8); res = -1; res = syz_genetlink_get_family_id(/*name=*/0x2000000014c0, /*fd=*/-1); if (res != -1) r[0] = res; // socket$nl_generic arguments: [ // domain: const = 0x10 (8 bytes) // type: const = 0x3 (8 bytes) // proto: const = 0x10 (4 bytes) // ] // returns sock_nl_generic res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0x10); if (res != -1) r[1] = res; // ioctl$sock_SIOCGIFINDEX_80211 arguments: [ // fd: sock (resource) // cmd: const = 0x8933 (4 bytes) // arg: ptr[out, ifreq_dev_t[nl80211_devnames, nl80211_ifindex]] { // ifreq_dev_t[nl80211_devnames, nl80211_ifindex] { // ifr_ifrn: buffer: {77 6c 61 6e 31 00 00 00 00 00 00 00 00 00 00 00} // (length 0x10) elem: nl80211_ifindex (resource) pad = 0x0 (20 bytes) // } // } // ] memcpy((void*)0x2000000003c0, "wlan1\000\000\000\000\000\000\000\000\000\000\000", 16); res = syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x8933, /*arg=*/0x2000000003c0ul); if (res != -1) r[2] = *(uint32_t*)0x2000000003d0; // sendmsg$NL80211_CMD_CHANNEL_SWITCH arguments: [ // fd: sock_nl_generic (resource) // msg: ptr[in, msghdr_netlink[netlink_msg_t[nl80211_family_id, // msg_nl80211_payload[NL80211_CMD_CHANNEL_SWITCH, nl80211_wdev_payload], // nl80211_policy$chsw]]] { // msghdr_netlink[netlink_msg_t[nl80211_family_id, // msg_nl80211_payload[NL80211_CMD_CHANNEL_SWITCH, nl80211_wdev_payload], // nl80211_policy$chsw]] { // addr: nil // addrlen: len = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // vec: ptr[in, iovec[in, netlink_msg_t[nl80211_family_id, // msg_nl80211_payload[NL80211_CMD_CHANNEL_SWITCH, // nl80211_wdev_payload], nl80211_policy$chsw]]] { // iovec[in, netlink_msg_t[nl80211_family_id, // msg_nl80211_payload[NL80211_CMD_CHANNEL_SWITCH, // nl80211_wdev_payload], nl80211_policy$chsw]] { // addr: ptr[in, netlink_msg_t[nl80211_family_id, // msg_nl80211_payload[NL80211_CMD_CHANNEL_SWITCH, // nl80211_wdev_payload], nl80211_policy$chsw]] { // netlink_msg_t[nl80211_family_id, // msg_nl80211_payload[NL80211_CMD_CHANNEL_SWITCH, // nl80211_wdev_payload], nl80211_policy$chsw] { // len: len = 0x2c (4 bytes) // type: nl80211_family_id (resource) // flags: netlink_msg_flags = 0x1 (2 bytes) // seq: int32 = 0x0 (4 bytes) // pid: int32 = 0x0 (4 bytes) // payload: msg_nl80211_payload[NL80211_CMD_CHANNEL_SWITCH, // nl80211_wdev_payload] { // genl_hdr: genlmsghdr_t[NL80211_CMD_CHANNEL_SWITCH] { // cmd: const = 0x66 (1 bytes) // version: const = 0x0 (1 bytes) // reserved: const = 0x0 (2 bytes) // } // payload: nl80211_wdev_payload { // NL80211_ATTR_IFINDEX: union // optional[nlattr[NL80211_ATTR_IFINDEX, nl80211_ifindex]] // { // val: nlattr_t[const[NL80211_ATTR_IFINDEX, int16], // nl80211_ifindex] { // nla_len: offsetof = 0x8 (2 bytes) // nla_type: const = 0x3 (2 bytes) // payload: nl80211_ifindex (resource) // size: buffer: {} (length 0x0) // } // } // NL80211_ATTR_WDEV: union // optional[nlattr[NL80211_ATTR_WDEV, nl80211_wdev]] { // void: buffer: {} (length 0x0) // } // } // } // attrs: array[nl80211_policy$chsw] { // union nl80211_policy$chsw { // chandef_params: array[nl80211_policy$chandef_params] { // union nl80211_policy$chandef_params { // NL80211_ATTR_WIPHY_FREQ: // nlattr_t[const[NL80211_ATTR_WIPHY_FREQ, int16], // ieee80211_frequency_mhz[int32]] { // nla_len: offsetof = 0x8 (2 bytes) // nla_type: const = 0x26 (2 bytes) // payload: union ieee80211_frequency_mhz[int32] { // random: ieee80211_channel_freq_mhz = 0x994 (4 // bytes) // } // size: buffer: {} (length 0x0) // } // } // } // } // union nl80211_policy$chsw { // NL80211_ATTR_CH_SWITCH_COUNT: // nlattr_t[const[NL80211_ATTR_CH_SWITCH_COUNT, int16], // int32[0:255]] { // nla_len: offsetof = 0x8 (2 bytes) // nla_type: const = 0xb7 (2 bytes) // payload: int32 = 0x78 (4 bytes) // size: buffer: {} (length 0x0) // } // } // } // } // } // len: len = 0x2c (8 bytes) // } // } // vlen: const = 0x1 (8 bytes) // ctrl: const = 0x0 (8 bytes) // ctrllen: const = 0x0 (8 bytes) // f: send_flags = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // } // } // f: send_flags = 0x40880 (8 bytes) // ] *(uint64_t*)0x200000000200 = 0; *(uint32_t*)0x200000000208 = 0; *(uint64_t*)0x200000000210 = 0x2000000001c0; *(uint64_t*)0x2000000001c0 = 0x200000000000; *(uint32_t*)0x200000000000 = 0x2c; *(uint16_t*)0x200000000004 = r[0]; *(uint16_t*)0x200000000006 = 1; *(uint32_t*)0x200000000008 = 0; *(uint32_t*)0x20000000000c = 0; *(uint8_t*)0x200000000010 = 0x66; *(uint8_t*)0x200000000011 = 0; *(uint16_t*)0x200000000012 = 0; *(uint16_t*)0x200000000014 = 8; *(uint16_t*)0x200000000016 = 3; *(uint32_t*)0x200000000018 = r[2]; *(uint16_t*)0x20000000001c = 8; *(uint16_t*)0x20000000001e = 0x26; *(uint32_t*)0x200000000020 = 0x994; *(uint16_t*)0x200000000024 = 8; *(uint16_t*)0x200000000026 = 0xb7; *(uint32_t*)0x200000000028 = 0x78; *(uint64_t*)0x2000000001c8 = 0x2c; *(uint64_t*)0x200000000218 = 1; *(uint64_t*)0x200000000220 = 0; *(uint64_t*)0x200000000228 = 0; *(uint32_t*)0x200000000230 = 0; syscall(__NR_sendmsg, /*fd=*/r[1], /*msg=*/0x200000000200ul, /*f=MSG_BATCH|MSG_EOR|MSG_CONFIRM*/ 0x40880ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; for (procid = 0; procid < 5; procid++) { if (fork() == 0) { use_temporary_dir(); do_sandbox_none(); } } sleep(1000000); return 0; }