// https://syzkaller.appspot.com/bug?id=5608eec6b6533ced4380191fb86d41f55285b6cd // 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 #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 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; } } 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 void netlink_nest(struct nlmsg* nlmsg, int typ) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_type = typ; nlmsg->pos += sizeof(*attr); nlmsg->nested[nlmsg->nesting++] = attr; } static void netlink_done(struct nlmsg* nlmsg) { struct nlattr* attr = nlmsg->nested[--nlmsg->nesting]; attr->nla_len = nlmsg->pos - (char*)attr; } 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 void netlink_add_device_impl(struct nlmsg* nlmsg, const char* type, const char* name, bool up) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; netlink_init(nlmsg, RTM_NEWLINK, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); if (name) netlink_attr(nlmsg, IFLA_IFNAME, name, strlen(name)); netlink_nest(nlmsg, IFLA_LINKINFO); netlink_attr(nlmsg, IFLA_INFO_KIND, type, strlen(type)); } static void netlink_device_change(struct nlmsg* nlmsg, int sock, const char* name, bool up, const char* master, const void* mac, int macsize, const char* new_name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; hdr.ifi_index = if_nametoindex(name); netlink_init(nlmsg, RTM_NEWLINK, 0, &hdr, sizeof(hdr)); if (new_name) netlink_attr(nlmsg, IFLA_IFNAME, new_name, strlen(new_name)); if (master) { int ifindex = if_nametoindex(master); netlink_attr(nlmsg, IFLA_MASTER, &ifindex, sizeof(ifindex)); } if (macsize) netlink_attr(nlmsg, IFLA_ADDRESS, mac, macsize); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static struct nlmsg nlmsg; //% 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; } #define NL802154_CMD_SET_SHORT_ADDR 11 #define NL802154_ATTR_IFINDEX 3 #define NL802154_ATTR_SHORT_ADDR 10 static const char* setup_802154() { const char* error = NULL; int sock_generic = -1; int sock_route = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock_route == -1) { error = "socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE) failed"; goto fail; } sock_generic = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock_generic == -1) { error = "socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC) failed"; goto fail; } { int nl802154_family_id = netlink_query_family_id(&nlmsg, sock_generic, "nl802154", true); if (nl802154_family_id < 0) { error = "netlink_query_family_id failed"; goto fail; } for (int i = 0; i < 2; i++) { char devname[] = "wpan0"; devname[strlen(devname) - 1] += i; uint64_t hwaddr = 0xaaaaaaaaaaaa0002 + (i << 8); uint16_t shortaddr = 0xaaa0 + i; int ifindex = if_nametoindex(devname); struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL802154_CMD_SET_SHORT_ADDR; netlink_init(&nlmsg, nl802154_family_id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, NL802154_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(&nlmsg, NL802154_ATTR_SHORT_ADDR, &shortaddr, sizeof(shortaddr)); if (netlink_send(&nlmsg, sock_generic) < 0) { error = "NL802154_CMD_SET_SHORT_ADDR failed"; goto fail; } netlink_device_change(&nlmsg, sock_route, devname, true, 0, &hwaddr, sizeof(hwaddr), 0); if (i == 0) { netlink_add_device_impl(&nlmsg, "lowpan", "lowpan0", false); netlink_done(&nlmsg); netlink_attr(&nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); if (netlink_send(&nlmsg, sock_route) < 0) { error = "netlink: adding device lowpan0 type lowpan link wpan0"; goto fail; } } } } fail: close(sock_route); close(sock_generic); return error; } 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 loop(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 10; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); event_timedwait(&th->done, 50 + (call == 0 ? 4000 : 0) + (call == 1 ? 4000 : 0)); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); } uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x20000e00, "udf\000", 4); memcpy((void*)0x20000180, "./file0\000", 8); memcpy((void*)0x20000ec0, "volume", 6); *(uint8_t*)0x20000ec6 = 0x3d; sprintf((char*)0x20000ec7, "%020llu", (long long)0x3f); *(uint8_t*)0x20000edb = 0x2c; memcpy((void*)0x20000edc, "iocharset", 9); *(uint8_t*)0x20000ee5 = 0x3d; memcpy((void*)0x20000ee6, "cp864", 5); *(uint8_t*)0x20000eeb = 0x2c; memcpy((void*)0x20000eec, "session", 7); *(uint8_t*)0x20000ef3 = 0x3d; sprintf((char*)0x20000ef4, "%020llu", (long long)0); *(uint8_t*)0x20000f08 = 0x2c; memcpy((void*)0x20000f09, "uid=forget", 10); *(uint8_t*)0x20000f13 = 0x2c; memcpy((void*)0x20000f14, "undelete", 8); *(uint8_t*)0x20000f1c = 0x2c; memcpy((void*)0x20000f1d, "novrs", 5); *(uint8_t*)0x20000f22 = 0x2c; memcpy((void*)0x20000f23, "longad", 6); *(uint8_t*)0x20000f29 = 0x2c; memcpy((void*)0x20000f2a, "uid=forget", 10); *(uint8_t*)0x20000f34 = 0x2c; memcpy((void*)0x20000f35, "utf8", 4); *(uint8_t*)0x20000f39 = 0x2c; *(uint8_t*)0x20000f3a = 0; memcpy( (void*)0x200001c0, "\x78\x9c\xec\xdd\x4f\x6c\x1c\xd7\x7d\x07\xf0\xdf\x1b\x2d\xc5\x95\xdc" "\x56\x4c\xec\x28\x4e\x1a\x17\x9b\xb6\x48\x65\xc5\x72\xf5\x2f\xa6\x62" "\x15\xee\xaa\xa6\xd9\x06\x90\x65\x22\x14\x73\x0b\xc0\x15\x49\xa9\x0b" "\x53\x24\x41\x52\x8d\x6c\xa4\x05\xd3\x4b\x0f\x3d\x04\x28\x8a\x1e\x72" "\x22\xd0\x1a\x05\x52\x34\x30\x9a\x22\xe8\x91\x69\x5d\x20\xb9\xf8\x50" "\xe4\xd4\x13\xd1\xc2\x46\x50\xf4\xc0\x16\x01\x72\x0a\x18\xcc\xec\x5b" "\x71\x49\x91\x36\x2d\x8a\x12\x65\x7d\x3e\x36\xf5\xdd\x9d\x7d\x6f\xe6" "\xbd\x79\xeb\x19\x59\xd0\x9b\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x40\xc4\x1f\xbc\x72\xe9\xf4\x99\xf4\xb0\x5b\x01" "\x00\x3c\x48\x57\x46\xbf\x7a\xfa\xac\xfb\x3f\x00\x3c\x56\xae\xfa\xff" "\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\xe8\x52\x14\xf1" "\x64\xa4\x98\xbb\xb2\x96\xc6\xab\xf7\x1d\xf5\xcb\xed\xbe\x5b\xb7\xc7" "\x86\x86\xb7\xaf\x76\x24\x55\x35\x0f\x55\xe5\xcb\x9f\xfa\x99\xb3\xe7" "\xce\x7f\xe9\x85\xc1\x0b\xdd\xbc\xdc\x9e\xf9\x80\xfa\xf7\xdb\x67\xe3" "\xb5\xd1\xab\x97\x1a\x2f\xcf\xde\x9c\x9b\x9f\x5a\x58\x98\x9a\x6c\x8c" "\xcd\xb4\x27\x66\x27\xa7\x76\xbd\x87\xbd\xd6\xdf\xea\x64\x75\x02\x1a" "\x37\x5f\xbf\x35\x79\xfd\xfa\x42\xe3\xec\xf3\xe7\x36\x7d\x7c\x7b\xe0" "\xfd\xfe\x27\x8e\x0f\x5c\x1c\x7c\xf6\xd4\x33\xdd\xb2\x63\x43\xc3\xc3" "\xa3\x1b\x45\xea\xbd\xe5\x6b\xf7\xdc\x90\x8e\x9d\x66\x78\x1c\x8e\x22" "\x4e\x45\x8a\xe7\xbe\xf7\xd3\xd4\x8a\x88\x22\xf6\x7e\x2e\xea\x0f\x76" "\xec\xb7\x3a\x52\x75\xe2\x64\xd5\x89\xb1\xa1\xe1\xaa\x23\xd3\xed\xd6" "\xcc\x62\xf9\xe1\x48\xf7\x44\x14\x11\x8d\x9e\x4a\xcd\xee\x39\xda\x7e" "\x2c\xa2\xd6\xf7\x40\xfb\xb0\xb3\x66\xc4\x52\xd9\xfc\xb2\xc1\x27\xcb" "\xee\x8d\xce\xb5\xe6\x5b\xd7\xa6\xa7\x1a\x23\xad\xf9\xc5\xf6\x62\x7b" "\x76\x66\x24\x75\x5a\x5b\xf6\xa7\x11\x45\x5c\x48\x11\xcb\x11\xb1\xda" "\x7f\xf7\xee\xfa\xa2\x88\x5a\xa4\xf8\xce\xb1\xb5\x74\x2d\x22\x0e\x75" "\xcf\xc3\x17\xab\x89\xc1\x3b\xb7\xa3\xd8\xc7\x3e\xee\x42\xd9\xce\x46" "\x5f\xc4\x72\xf1\x08\x8c\xd9\x01\xd6\x1f\x45\xbc\x1a\x29\x7e\xf6\xce" "\x89\x98\xc8\xd7\x99\xea\x5a\xf3\x85\x88\x57\xcb\xfc\x41\xc4\x5b\x65" "\xbe\x14\x91\xca\x2f\xc6\xf9\x88\xf7\xb6\xf9\x1e\xf1\x68\xaa\x45\x11" "\x7f\x59\x8e\xff\xc5\xb5\x34\x59\x5d\x0f\xba\xd7\x95\xcb\x5f\x6b\x7c" "\x65\xe6\xfa\x6c\x4f\xd9\xee\x75\xe5\x23\xde\x1f\xee\xba\x52\x3c\xa4" "\xfb\xc3\x91\x2d\xf9\x60\x1c\xf0\x6b\x53\x3d\x8a\x68\x55\x57\xfc\xb5" "\x74\xef\xbf\xd9\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\xe0\x7e\x3b\x12\x45\x7c\x26\x52\xbc\xf2\x1f\x7f\x52\xcd\x2b\x8e\x6a" "\x5e\xfa\xb1\x8b\x83\x7f\x38\xf0\xab\xbd\x73\xc6\x9f\xfe\x90\xfd\x94" "\x65\x9f\x8f\x88\xa5\x62\x77\x73\x72\x0f\xe7\x89\x81\x23\x69\x24\xa5" "\x87\x3c\x97\xf8\x71\x56\x8f\x22\xfe\x34\xcf\xff\xfb\xd6\xc3\x6e\x0c" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x63\xad" "\x88\x9f\x44\x8a\x17\xdf\x3d\x91\x96\xa3\x77\x4d\xf1\xf6\xcc\x8d\xc6" "\xd5\xd6\xb5\xe9\xce\xaa\xb0\xdd\xb5\x7f\xbb\x6b\xa6\xaf\xaf\xaf\xaf" "\x37\x52\x27\x9b\x39\xc7\x73\x2e\xe5\x5c\xce\xb9\x92\x73\x35\x67\x14" "\xb9\x7e\xce\x66\xce\xf1\x9c\x4b\x39\x97\x73\xae\xe4\x5c\xcd\x19\x87" "\x72\xfd\x9c\xcd\x9c\xe3\x39\x97\x72\x2e\xe7\x5c\xc9\xb9\x9a\x33\x6a" "\xb9\x7e\xce\x66\xce\xf1\x9c\x4b\x39\x97\x73\xae\xe4\x5c\xcd\x19\x07" "\x64\xed\x5e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\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\x8f" "\x93\x22\x8a\xf8\x45\xa4\xf8\xf6\x37\xd6\x52\xa4\x88\x68\x46\x8c\x47" "\x27\x57\xfa\x1f\x76\xeb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\x52\x7f\x2a\xe2\xfb\x91\xa2\xf1\x47\xcd\x3b\xdb\x6a\x11" "\x91\xaa\x7f\x3b\x4e\x94\xbf\x9c\x8f\xe6\xe1\x32\x3f\x19\xcd\xc1\x32" "\x5f\x8a\xe6\xa5\x9c\xad\x2a\x6b\xcd\x6f\x3d\x84\xf6\xb3\x37\x7d\xa9" "\x88\x1f\x47\x8a\xfe\xfa\xdb\x77\x06\x3c\x8f\x7f\x5f\xe7\xdd\x9d\xaf" "\x41\xbc\xf5\xcd\x8d\x77\x9f\xad\x75\xf2\x50\xf7\xc3\x81\xf7\xfb\x9f" "\x38\x7e\xec\xe2\xe0\xf0\x6f\x3c\xbd\xd3\xeb\xb4\x5d\x03\x4e\x5e\x6e" "\xcf\xdc\xba\xdd\x18\x1b\x1a\x1e\x1e\xed\xd9\x5c\xcb\x47\xff\x64\xcf" "\xb6\x81\x7c\xdc\xe2\xfe\x74\x9d\x88\x58\x78\xe3\xcd\xd7\x5b\xd3\xd3" "\x53\xf3\xf7\xfe\xa2\xfc\x0a\xec\xa1\xfa\x23\xf4\x22\xd5\x1e\x97\x9e" "\x7a\x51\xbd\x88\xda\x81\x68\xc6\xc3\xe9\x3b\x8f\x81\xf2\xfe\xff\x5e" "\xa4\xf8\xdd\x77\xff\xb3\x7b\xc3\xef\xdc\xff\xeb\xf1\x2b\x9d\x77\x77" "\xee\xf0\xf1\xf3\x3f\xdb\xb8\xff\xbf\xb8\x75\x47\xbb\xbc\xff\xd7\xb6" "\xd6\xcb\xf7\xff\xf2\x9e\xbe\xdd\xfd\xff\xc9\x9e\x6d\x2f\xe6\xdf\x8d" "\xf4\xd5\x22\xea\x8b\x37\xe7\xfa\x8e\x47\xd4\x17\xde\x78\xf3\x54\xfb" "\x66\xeb\xc6\xd4\x8d\xa9\x99\xf3\xa7\x4f\x7f\x79\x70\xf0\xcb\xe7\x4e" "\xf7\x1d\x8e\xa8\x5f\x6f\x4f\x4f\xf5\xbc\xba\x2f\xa7\x0b\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xc1\x49\x45\xfc\x7e\xa4\x68" "\xfd\x78\x2d\x35\x22\xe2\x76\x35\x5f\x6b\xe0\xe2\xe0\xb3\xa7\x9e\x39" "\x14\x87\xaa\xf9\x56\x9b\xe6\x6d\xbf\x36\x7a\xf5\x52\xe3\xe5\xd9\x9b" "\x73\xf3\x53\x0b\x0b\x53\x93\x8d\xb1\x99\xf6\xc4\xec\xe4\xd4\x6e\x0f" "\x57\xaf\xa6\x7b\x8d\x0d\x0d\xef\x4b\x67\x3e\xd4\x91\x7d\x6e\xff\x91" "\xfa\xcb\xb3\x73\x6f\xcc\xb7\x6f\xfc\xf1\xe2\xb6\x9f\x1f\xad\x5f\xba" "\xb6\xb0\x38\xdf\x9a\xd8\xfe\xe3\x38\x12\x45\x44\xb3\x77\xcb\xc9\xaa" "\xc1\x63\x43\xc3\x55\xa3\xa7\xdb\xad\x99\xaa\xea\xc8\xb6\x93\xe9\x3f" "\xba\xbe\x54\xc4\x7f\x45\x8a\x89\xf3\x8d\xf4\xf9\xbc\x2d\xcf\xff\xdf" "\x3a\xc3\x7f\xd3\xfc\xff\xa5\xad\x3b\xda\xa7\xf9\xff\x9f\xe8\xd9\x56" "\x1e\x33\xa5\x22\x7e\x1e\x29\x7e\xe7\xaf\x9e\x8e\xcf\x57\xed\x3c\x1a" "\x77\x9d\xb3\x5c\xee\xef\x22\xc5\xc9\x0b\x9f\xcb\xe5\xe2\x70\x59\xae" "\xdb\x86\xce\x73\x05\x3a\x33\x03\xcb\xb2\xff\x17\x29\xfe\xe9\x17\x9b" "\xcb\x76\xe7\x43\x3e\xb9\x51\xf6\xcc\xae\x4f\xec\x23\xa2\x1c\xff\x63" "\x91\xe2\xfb\x7f\xf1\xdd\xf8\xcd\xbc\x6d\xf3\xf3\x1f\xb6\x1f\xff\xa3" "\x5b\x77\xb4\x4f\xe3\xff\x54\xcf\xb6\xa3\x9b\x9e\x57\xb0\xe7\xae\x93" "\xc7\xff\x54\xa4\x78\xe9\xc9\xb7\xe3\xb7\xf2\xb6\x0f\x7a\xfe\x47\xf7" "\xd9\x1b\x27\x72\xe1\x3b\xcf\xe7\xd8\xa7\xf1\xff\x54\xcf\xb6\x81\x7c" "\xdc\xdf\xbe\x3f\x5d\x07\x00\x00\x00\x00\x00\x00\x00\x00\x78\xa4\xf5" "\xa5\x22\xfe\x3e\x52\xfc\x70\xb8\x96\x5e\xc8\xdb\x76\xf3\xf7\xff\x26" "\xb7\xee\x68\x9f\xfe\xfe\xd7\xa7\x7b\xb6\x4d\xde\x9f\xf5\x8a\x3e\xf4" "\xc5\x9e\x4f\x2a\x00\x00\x00\x00\x1c\x10\x7d\xa9\x88\x9f\x44\x8a\x1b" "\x8b\x6f\xdf\x99\x43\xbd\x79\xfe\x77\xcf\xfc\xcf\xdf\xdb\x98\xff\x39" "\x94\xb6\x7c\x5a\xfd\x39\xdf\xaf\x55\xcf\x0d\xb8\x9f\x7f\xfe\xd7\x6b" "\x20\x1f\x77\x7c\xef\xdd\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x80\x03\x25\xa5\x22\x5e\xc8\xeb\xa9\x8f\x57\xf3\xf9" "\x27\x77\x5c\x4f\x7d\x25\x52\xbc\xf2\x3f\xcf\xe5\x72\xe9\x78\x59\xae" "\xbb\x0e\xfc\x40\xf5\x6b\xfd\xca\xec\xcc\xa9\x4b\xd3\xd3\xb3\x13\xad" "\xc5\xd6\xb5\xe9\xa9\xc6\xe8\x5c\x6b\x62\xaa\xac\xfb\x54\xa4\x58\xfb" "\xdb\xcf\xe5\xba\x45\xb5\xbe\x7a\x77\xbd\xf9\xce\x1a\xef\x1b\x6b\xb1" "\xcf\x47\x8a\xe1\x7f\xe8\x96\xed\xac\xc5\xde\x5d\x9b\xfc\xa9\x8d\xb2" "\x67\xca\xb2\x9f\x88\x14\xff\xfd\x8f\x9b\xcb\x76\xd7\xb1\xfe\xd4\x46" "\xd9\xb3\x65\xd9\xbf\x89\x14\x5f\xff\x97\xed\xcb\x1e\xdf\x28\x7b\xae" "\x2c\xfb\xdd\x48\xf1\xa3\xaf\x37\xba\x65\x8f\x96\x65\xbb\xcf\x47\xfd" "\xf4\x46\xd9\xe7\x27\x66\x8b\x7d\x18\x15\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x37\x7d\xa9\x88\x3f\x8f\x14\xff" "\x7b\x73\xf9\xce\x5c\xfe\xbc\xfe\x7f\x5f\xcf\xdb\xca\x5b\xdf\xec\x59" "\xef\x7f\x8b\xdb\xd5\x3a\xff\x03\xd5\xfa\xff\x3b\xbd\xbe\x97\xf5\xff" "\xab\xe7\x0a\x2c\xed\x74\x54\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\xf8\x78\x4a\x51\xc4\x9b\x91\x62\xee\xca\x5a\x5a\xe9" "\x2f\xdf\x77\xd4\x2f\xb7\x67\x6e\xdd\x1e\x1b\x1a\xde\xbe\xda\x91\x54" "\xd5\x3c\x54\x95\x2f\x7f\xea\x67\xce\x9e\x3b\xff\xa5\x17\x06\x2f\x74" "\xf3\x83\xeb\xdf\x6f\x9f\x89\xd7\x46\xaf\x5e\x6a\xbc\x3c\x7b\x73\x6e" "\x7e\x6a\x61\x61\x6a\xb2\x31\x36\xd3\x9e\x98\x9d\x9c\xda\xf5\x1e\xf6" "\x5a\x7f\xab\x93\xd5\x09\x68\xdc\x7c\xfd\xd6\xe4\xf5\xeb\x0b\x8d\xb3" "\xcf\x9f\xdb\xf4\xf1\xed\x81\xf7\xfb\x9f\x38\x3e\x70\x71\xf0\xd9\x53" "\xcf\x74\xcb\x8e\x0d\x0d\x0f\x8f\xf6\x94\xa9\xf5\xdd\xf3\xd1\xef\x92" "\x76\xd8\x7e\x38\x8a\xf8\xeb\x48\xf1\xdc\xf7\x7e\x9a\x7e\xd8\x1f\x51" "\xc4\xde\xcf\xc5\x87\x7c\x77\xf6\xdb\x91\xaa\x13\x27\xab\x4e\x8c\x0d" "\x0d\x57\x1d\x99\x6e\xb7\x66\x16\xcb\x0f\x47\xba\x27\xa2\x88\x68\xf4" "\x54\x6a\x76\xcf\xd1\x03\x18\x8b\x3d\x69\x46\x2c\x95\xcd\x2f\x1b\x7c" "\xb2\xec\xde\xe8\x5c\x6b\xbe\x75\x6d\x7a\xaa\x31\xd2\x9a\x5f\x6c\x2f" "\xb6\x67\x67\x46\x52\xa7\xb5\x65\x7f\x1a\x51\xc4\x85\x14\xb1\x1c\x11" "\xab\xfd\x77\xef\xae\x2f\x8a\x78\x3d\x52\x7c\xe7\xd8\x5a\xfa\xd7\xfe" "\x88\x43\xdd\xf3\xf0\xc5\x2b\xa3\x5f\x3d\x7d\x76\xe7\x76\x14\xfb\xd8" "\xc7\x5d\x28\xdb\xd9\xe8\x8b\x58\x2e\x1e\x81\x31\x3b\xc0\xfa\xa3\x88" "\x7f\x8e\x14\x3f\x7b\xe7\x44\xfc\x5b\x7f\x44\x2d\x3a\x3f\xf1\x85\x88" "\x57\xcb\xfc\x41\xc4\x5b\xd1\x19\xef\x54\x7e\x31\xce\x47\xbc\xb7\xcd" "\xf7\x88\x47\x53\x2d\x8a\xf8\xff\x72\xfc\x2f\xae\xa5\x77\xfa\xcb\xeb" "\x41\xf7\xba\x72\xf9\x6b\x8d\xaf\xcc\x5c\x9f\xed\x29\xdb\xbd\xae\x3c" "\xf2\xf7\x87\x07\xe9\x80\x5f\x9b\xea\x51\xc4\x8f\xaa\x2b\xfe\x5a\xfa" "\x77\xff\x5d\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c" "\x20\x45\xfc\x7a\xa4\x78\xf1\xdd\x13\xa9\x9a\x1f\x7c\x67\x4e\x71\x7b" "\xe6\x46\xe3\x6a\xeb\xda\x74\x67\x5a\x5f\x77\xee\x5f\x77\xce\xf4\xfa" "\xfa\xfa\x7a\x23\x75\xb2\x99\x73\x3c\xe7\x52\xce\xe5\x9c\x2b\x39\x57" "\x73\x46\x91\xeb\xe7\x6c\x96\x59\x5f\x5f\x1f\xcf\xef\x97\x72\x2e\xe7" "\x5c\xc9\xb9\x9a\x33\x0e\xe5\xfa\x39\x9b\x39\xc7\x73\x2e\xe5\x5c\xce" "\xb9\x92\x73\x35\x67\xd4\x72\xfd\x9c\xcd\x9c\xe3\x39\x97\x72\x2e\xe7" "\x5c\xc9\xb9\x9a\x33\x0e\xc8\xdc\x3d\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xe0\xe3\xa5\xa8\xfe\x49\xf1\xed\x6f\xac\xa5" "\xf5\xfe\xce\xfa\xd2\xe3\xd1\xc9\x15\xeb\x81\x7e\xec\xfd\x32\x00\x00" "\xff\xff\x21\x5f\xf8\xab", 3117); syz_mount_image(/*fs=*/0x20000e00, /*dir=*/0x20000180, /*flags=MS_RDONLY|MS_NOSUID|MS_NODEV|0x400000*/ 0x400007, /*opts=*/0x20000ec0, /*chdir=*/1, /*size=*/0xc2d, /*img=*/0x200001c0); break; case 1: memcpy((void*)0x20000180, "msdos\000", 6); memcpy((void*)0x20000100, ".\000", 2); syz_mount_image( /*fs=*/0x20000180, /*dir=*/0x20000100, /*flags=MS_I_VERSION|MS_PRIVATE|MS_SYNCHRONOUS|MS_STRICTATIME|MS_REMOUNT|MS_RELATIME|0x40044c*/ 0x1e4047c, /*opts=*/0x20000ec0, /*chdir=*/1, /*size=*/0, /*img=*/0x20000000); break; case 2: memcpy((void*)0x20000240, "./file1\000", 8); res = syscall( __NR_open, /*file=*/0x20000240ul, /*flags=O_SYNC|O_NOCTTY|O_NOATIME|O_DIRECT|O_CREAT|0x2*/ 0x145142ul, /*mode=*/0ul); if (res != -1) r[0] = res; break; case 3: syscall(__NR_ftruncate, /*fd=*/r[0], /*len=*/0x2007ffcul); break; case 4: syscall(__NR_sendfile, /*fdout=*/r[0], /*fdin=*/r[0], /*off=*/0ul, /*count=*/0x800000009ul); break; case 5: memcpy((void*)0x20000000, "./bus\000", 6); res = syscall( __NR_open, /*file=*/0x20000000ul, /*flags=O_NOFOLLOW|O_NOCTTY|O_NOATIME|O_CREAT|O_RDWR*/ 0x60142ul, /*mode=*/0ul); if (res != -1) r[1] = res; break; case 6: memcpy((void*)0x20000080, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x20000080ul, /*flags=O_SYNC|O_NOCTTY|O_DIRECT|O_CLOEXEC|O_RDWR*/ 0x185102ul, /*mode=*/0ul); if (res != -1) r[2] = res; break; case 7: syscall(__NR_ftruncate, /*fd=*/r[2], /*len=*/0x2007ffbul); break; case 8: syscall(__NR_sendfile, /*fdout=*/r[1], /*fdin=*/r[2], /*off=*/0ul, /*count=*/0x1000000201005ul); break; case 9: memcpy((void*)0x20000000, "./bus\000", 6); syscall(__NR_creat, /*file=*/0x20000000ul, /*mode=*/0ul); 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; if ((reason = setup_802154())) printf("the reproducer may not work as expected: 802154 injection setup " "failed: %s\n", reason); loop(); return 0; }