// https://syzkaller.appspot.com/bug?id=8598354fc7b4b890dd8ef75f7dd1c19f769ca784 // 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 #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; 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; } //% 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, 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 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, loopfd = -1, 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) { memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; 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) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } errno = err; return res; } static void setup_common() { 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)) { } if (symlink("/dev/binderfs", "./binderfs")) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setsid(); 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); setup_common(); sandbox_common(); drop_caps(); if (unshare(CLONE_NEWNET)) { } write_file("/proc/sys/net/ipv4/ping_group_range", "0 65535"); setup_binderfs(); loop(); exit(1); } uint64_t r[1] = {0xffffffffffffffff}; void loop(void) { intptr_t res = 0; memcpy((void*)0x20000180, "udf\000", 4); memcpy((void*)0x20000040, "./file0\000", 8); memcpy((void*)0x20001040, "fileset", 7); *(uint8_t*)0x20001047 = 0x3d; sprintf((char*)0x20001048, "%020llu", (long long)0x10001); *(uint8_t*)0x2000105c = 0x2c; memcpy((void*)0x2000105d, "iocharset", 9); *(uint8_t*)0x20001066 = 0x3d; memcpy((void*)0x20001067, "macinuit", 8); *(uint8_t*)0x2000106f = 0x2c; memcpy((void*)0x20001070, "mode", 4); *(uint8_t*)0x20001074 = 0x3d; sprintf((char*)0x20001075, "%023llo", (long long)1); *(uint8_t*)0x2000108c = 0x2c; memcpy((void*)0x2000108d, "partition", 9); *(uint8_t*)0x20001096 = 0x3d; sprintf((char*)0x20001097, "%020llu", (long long)5); *(uint8_t*)0x200010ab = 0x2c; memcpy((void*)0x200010ac, "gid", 3); *(uint8_t*)0x200010af = 0x3d; sprintf((char*)0x200010b0, "%020llu", (long long)0); *(uint8_t*)0x200010c4 = 0x2c; memcpy((void*)0x200010c5, "longad", 6); *(uint8_t*)0x200010cb = 0x2c; memcpy((void*)0x200010cc, "lastblock", 9); *(uint8_t*)0x200010d5 = 0x3d; sprintf((char*)0x200010d6, "%020llu", (long long)3); *(uint8_t*)0x200010ea = 0x2c; *(uint8_t*)0x200010eb = 0; memcpy( (void*)0x20000400, "\x78\x9c\xec\xdd\x4f\x6c\x1c\xd7\x7d\x07\xf0\xdf\x1b\x92\x22\x29\xb7\x15" "\x13\x3b\x8a\xdd\xc6\xc5\xa6\x2d\x52\x99\xb1\x5c\xfd\x8b\xa9\x58\x85\xbb" "\xaa\x69\xb6\x01\x64\x99\x08\xc5\xdc\x02\x70\x45\x52\xea\xc2\xd4\x92\x20" "\xa9\x46\x36\xd2\x82\xe9\xa5\x87\x1e\x02\x14\x45\x0f\x39\x11\x68\x8d\x02" "\x29\x1a\x18\x4d\x11\xf4\xc8\xb6\x2e\x90\x5c\x7c\x28\x72\xea\x89\x68\x61" "\x23\x28\x7a\x60\x8b\x00\x39\x05\x2c\x66\xf6\xad\xb8\xa4\x28\x4b\x15\x45" "\x89\xb4\x3e\x1f\x9b\xfa\xee\xce\xbc\x37\xf3\xde\xcc\x78\x46\x16\xf4\xe6" "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\xf1\xbb\xaf" "\x5f\x3c\x75\x3a\x3d\xee\x56\x00\x00\x8f\xd2\xe5\x89\xaf\x9e\x3a\xe3\xf9" "\x0f\x00\x4f\x94\x2b\xfe\xff\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x0e\xba\x14\x45\x3c\x1d\x29\x16\x2e\x6f\xa4\xa9\xea\x7b\xdb\xc0\xa5" "\x66\xeb\xe6\xad\xc9\xd1\xb1\xdd\xab\x0d\xa6\xaa\x66\x4f\x55\xbe\xfc\x19" "\x38\x7d\xe6\xec\xb9\x2f\xbd\x3c\x72\xbe\x93\x1f\x5f\xff\x61\x7b\x2e\xde" "\x9c\xb8\x72\xb1\xf6\xda\xfc\x8d\x85\xc5\xd9\xa5\xa5\xd9\x99\xda\x64\xab" "\x39\x3d\x3f\x33\x7b\xdf\x5b\xd8\x6b\xfd\x9d\x86\xab\x03\x50\xbb\xf1\xd6" "\xcd\x99\x6b\xd7\x96\x6a\x67\x5e\x3a\xbb\x6d\xf5\xad\xa1\x8f\xfa\x9f\x3a" "\x3e\x74\x61\xe4\x85\x93\xcf\x77\xca\x4e\x8e\x8e\x8d\x4d\x74\x95\xe9\xed" "\x7b\xe0\xbd\xdf\xe1\x6e\x23\x3c\x8e\x44\x11\x27\x23\xc5\x8b\xdf\xfb\x49" "\x6a\x44\x44\x11\x7b\x3f\x16\xf7\xb8\x76\xf6\xdb\x60\xd5\x89\xe1\xaa\x13" "\x93\xa3\x63\x55\x47\xe6\x9a\x8d\xd6\x72\xb9\x72\xbc\x73\x20\x8a\x88\x5a" "\x57\xa5\x7a\xe7\x18\x3d\x82\x73\xb1\x27\xf5\x88\x95\xb2\xf9\x65\x83\x87" "\xcb\xee\x4d\x2c\x34\x16\x1b\x57\xe7\x66\x6b\xe3\x8d\xc5\xe5\xe6\x72\x73" "\xbe\x35\x9e\xda\xad\x2d\xfb\x53\x8b\x22\xce\xa7\x88\xd5\x88\x58\xef\xbf" "\x73\x73\x7d\x51\x44\x6f\xa4\xf8\xce\xb1\x8d\x74\x35\x22\x7a\x3a\xc7\xe1" "\x8b\xd5\xc0\xe0\xbb\xb7\xa3\xd8\xc7\x3e\xde\x87\xb2\x9d\xb5\xbe\x88\xd5" "\xe2\x10\x9c\xb3\x03\xac\x3f\x8a\x78\x23\x52\xfc\xf4\xfd\x13\x31\x5d\x1e" "\xb3\xfc\x13\x5f\x88\x78\xa3\xcc\x1f\x44\xbc\x5b\xe6\xab\x11\xa9\xbc\x30" "\xce\x45\x7c\xb8\xcb\x75\xc4\xe1\xd4\x1b\x45\xfc\x59\x79\xfe\x2f\x6c\xa4" "\x99\xea\x7e\xd0\xb9\xaf\x5c\xfa\x5a\xed\x2b\xad\x6b\xf3\x5d\x65\x3b\xf7" "\x95\x43\xfa\x7c\x18\xdc\x91\x8f\xc6\x01\xbf\x37\x0d\x44\x11\x8d\xea\x8e" "\xbf\x91\x1e\xfc\x37\x3b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x3c\x6c\x83\x51\xc4\x73\x91\xe2\xf5\x7f\xfb\xc3\x6a\x5c\x71\x54\xe3" "\xd2\x8f\x5d\x18\xf9\xbd\xa1\x5f\xec\x1e\x33\xfe\xec\x3d\xb6\x53\x96\x7d" "\x29\x22\x56\x8a\xfb\x1b\x93\x7b\x24\x0f\x21\x1e\x4f\xe3\x29\x3d\xe6\xb1" "\xc4\x4f\xb2\x81\x28\xe2\x8f\xf2\xf8\xbf\x6f\x3d\xee\xc6\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3c\xd1\x8a\xf8\x71\xa4\x78" "\xe5\x83\x13\x69\x35\xba\xe7\x14\x6f\xb6\xae\xd7\xae\x34\xae\xce\xb5\x67" "\x85\xed\xcc\xfd\xdb\x99\x33\x7d\x73\x73\x73\xb3\x96\xda\x59\xcf\x39\x95" "\x73\x25\xe7\x6a\xce\xb5\x9c\xeb\x39\xa3\xc8\xf5\x73\xd6\x73\x4e\xe5\x5c" "\xc9\xb9\x9a\x73\x2d\xe7\x7a\xce\xe8\xc9\xf5\x73\xd6\x73\x4e\xe5\x5c\xc9" "\xb9\x9a\x73\x2d\xe7\x7a\xce\xe8\xcd\xf5\x73\xd6\x73\x4e\xe5\x5c\xc9\xb9" "\x9a\x73\x2d\xe7\x7a\xce\x38\x20\x73\xf7\x02\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x7c\x92\x14\x51\xc4\xcf\x23\xc5\xb7\xbf\xb1\x91\x22\x45\x44" "\x3d\x62\x2a\xda\xb9\xd6\xff\xb8\x5b\x07\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x94\xfa\x53\x11\xdf\x8f\x14" "\xb5\xdf\xaf\xdf\x5e\xd6\x1b\x11\xa9\xfa\xb7\xed\x44\xf9\xcb\xb9\xa8\x1f" "\x29\xf3\xd3\x51\x1f\x29\xf3\xd5\xa8\x5f\xcc\xd9\xa8\xb2\xb7\xfe\xad\xc7" "\xd0\x7e\xf6\xa6\x2f\x15\xf1\xa3\x48\xd1\x3f\xf0\xde\xed\x13\x9e\xcf\x7f" "\x5f\xfb\xdb\xed\xcb\x20\xde\xfd\xe6\xd6\xb7\x5f\xee\x6d\x67\x4f\x67\xe5" "\xd0\x47\xfd\x4f\x1d\x3f\x76\x61\x64\xec\x57\x9f\xbd\xdb\xe7\xb4\x5b\x03" "\x86\x2f\x35\x5b\x37\x6f\xd5\x26\x47\xc7\xc6\x26\xba\x16\xf7\xe6\xbd\x7f" "\xba\x6b\xd9\x50\xde\x6f\xf1\x70\xba\x4e\x44\x2c\xbd\xfd\xce\x5b\x8d\xb9" "\xb9\xd9\xc5\x07\xff\x50\x5e\x02\x7b\xa8\xee\x83\x0f\x07\xf5\x43\xf4\x1e" "\x88\x66\x3c\x9e\xbe\xf3\x04\x28\x9f\xff\x1f\x46\x8a\xdf\xfa\xe0\xdf\x3b" "\x0f\xfc\xce\xf3\xff\x17\xda\xdf\x6e\x3f\xe1\xe3\x67\x7f\xbc\xf5\xfc\x7f" "\x65\xe7\x86\xf6\xe9\xf9\xff\x74\xd7\xb2\x57\xf2\xef\x46\xfa\x7a\x23\x06" "\x96\x6f\x2c\xf4\x1d\x8f\x18\x58\x7a\xfb\x9d\x93\xcd\x1b\x8d\xeb\xb3\xd7" "\x67\x5b\xe7\x4e\x9d\xfa\xf2\xc8\xc8\x97\xcf\x9e\xea\x3b\x12\x31\x70\xad" "\x39\x37\xdb\xf5\x69\xcf\x87\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xe0\xd1\x4a\x45\xfc\x4e\xa4\x68\xfc\x68\x23\xd5\x22\xe2\x56\x35" "\x5e\x6b\xe8\xc2\xc8\x0b\x27\x9f\xef\x89\x9e\x6a\xbc\xd5\xb6\x71\x5b\x6f" "\x4e\x5c\xb9\x58\x7b\x6d\xfe\xc6\xc2\xe2\xec\xd2\xd2\xec\x4c\x6d\xb2\xd5" "\x9c\x9e\x9f\x99\xbd\xdf\xdd\x0d\x54\xc3\xbd\x26\x47\xc7\xf6\xa5\x33\xf7" "\x34\xb8\xcf\xed\x1f\x1c\x78\x6d\x7e\xe1\xed\xc5\xe6\xf5\x3f\x58\xde\x75" "\xfd\xd1\x81\x8b\x57\x97\x96\x17\x1b\xd3\xbb\xaf\x8e\xc1\x28\x22\xea\xdd" "\x4b\x86\xab\x06\x4f\x8e\x8e\x55\x8d\x9e\x6b\x36\x5a\x55\xd5\xf1\x5d\x07" "\xd3\xfd\xff\xf5\xa5\x22\xfe\x23\x52\x4c\x9f\xab\xa5\xcf\xe7\x65\x79\xfc" "\xdf\xce\x11\xfe\xdb\xc6\xff\xaf\xec\xdc\xd0\x3e\x8d\xff\xfb\x54\xd7\xb2" "\x72\x9f\x29\x15\xf1\xb3\x48\xf1\x9b\x7f\xfe\x6c\x7c\xbe\x6a\xe7\xd1\xb8" "\xe3\x98\xe5\x72\x7f\x1d\x29\x86\xcf\x7f\x2e\x97\x8b\x23\x65\xb9\x4e\x1b" "\xda\xef\x15\x68\x8f\x0c\x2c\xcb\xfe\x4f\xa4\xf8\xfb\x9f\x6f\x2f\xdb\x19" "\x0f\xf9\xf4\x56\xd9\xd3\xf7\x7d\x60\x0f\x89\xf2\xfc\x1f\x8b\x14\xdf\xff" "\xd3\xef\xc6\xaf\xe5\x65\xdb\xdf\xff\xb0\xfb\xf9\x3f\xba\x73\x43\xfb\x74" "\xfe\x9f\xe9\x5a\x76\x74\xdb\xfb\x0a\xf6\xdc\x75\xf2\xf9\x3f\x19\x29\x5e" "\x7d\xfa\xbd\xf8\xf5\xbc\xec\xe3\xde\xff\xd1\x79\xf7\xc6\x89\x5c\xf8\xf6" "\xfb\x39\xf6\xe9\xfc\x7f\xa6\x6b\xd9\x50\xde\xef\x6f\x3c\x9c\xae\x03\x00" "\x00\x00\x00\x00\x00\x00\x00\x1c\x6a\x7d\xa9\x88\xbf\x89\x14\xcf\x8f\xf5" "\xa6\x97\xf3\xb2\xfb\xf9\xfb\x7f\x33\x3b\x37\xb4\x4f\x7f\xff\xeb\xb3\x5d" "\xcb\x66\x1e\xce\x7c\x45\xf7\xfc\xb0\xe7\x83\x0a\x00\x00\x00\x00\x07\x44" "\x5f\x2a\xe2\xc7\x91\xe2\xfa\xf2\x7b\xb7\xc7\x50\x6f\x1f\xff\xdd\x35\xfe" "\xf3\xb7\xb7\xc6\x7f\x8e\xa6\x1d\x6b\xab\x3f\xe7\xfb\xa5\xea\xbd\x01\x0f" "\xf3\xcf\xff\xba\x0d\xe5\xfd\x4e\xed\xbd\xdb\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x70\xa0\xa4\x54\xc4\xcb\x79\x3e\xf5\xa9" "\x7b\xcc\xa7\xbe\x16\x29\x5e\xff\xaf\x17\x73\xb9\x74\xbc\x2c\xd7\x99\x07" "\x7e\xa8\xfa\x75\xe0\xf2\x7c\xeb\xe4\xc5\xb9\xb9\xf9\xe9\xc6\x72\xe3\xea" "\xdc\x6c\x6d\x62\xa1\x31\x3d\x5b\xd6\x7d\x26\x52\x6c\xfc\xd5\xe7\x72\xdd" "\xa2\x9a\x5f\xbd\x33\xdf\x7c\x7b\x8e\xf7\xad\xb9\xd8\x17\x23\xc5\xd8\xdf" "\x76\xca\xb6\xe7\x62\xef\xcc\x4d\xfe\xcc\x56\xd9\xd3\x65\xd9\x4f\x45\x8a" "\xff\xfc\xbb\xed\x65\x3b\xf3\x58\x7f\x66\xab\xec\x99\xb2\xec\x5f\x46\x8a" "\xaf\xff\xe3\xee\x65\x8f\x6f\x95\x3d\x5b\x96\xfd\x6e\xa4\xf8\xe1\xd7\x6b" "\x9d\xb2\x47\xcb\xb2\x9d\xf7\xa3\x7e\x76\xab\xec\x4b\xd3\xf3\xc5\x3e\x9c" "\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9e\x34" "\x7d\xa9\x88\x3f\x89\x14\xff\x7d\x63\xf5\xf6\x58\xfe\x3c\xff\x7f\x5f\xd7" "\xd7\xca\xbb\xdf\xec\x9a\xef\x7f\x87\x5b\xd5\x3c\xff\x43\xd5\xfc\xff\x77" "\xfb\xfc\x20\xf3\xff\x0f\x3d\x9c\x6e\x02\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xa1\x92\xa2\x88\x77\x22\xc5\xc2\xe5" "\x8d\xb4\xd6\x5f\x7e\x6f\x1b\xb8\xd4\x6c\xdd\xbc\x35\x39\x3a\xb6\x7b\xb5" "\xc1\x54\xd5\xec\xa9\xca\x97\x3f\x03\xa7\xcf\x9c\x3d\xf7\xa5\x97\x47\xce" "\x77\xf2\xe3\xeb\x3f\x6c\xcf\xc5\x9b\x13\x57\x2e\xd6\x5e\x9b\xbf\xb1\xb0" "\x38\xbb\xb4\x34\x3b\x53\x9b\x6c\x35\xa7\xe7\x67\x66\xef\x7b\x0b\x7b\xad" "\xbf\xd3\x70\x75\x00\x6a\x37\xde\xba\x39\x73\xed\xda\x52\xed\xcc\x4b\x67" "\xb7\xad\xbe\x35\xf4\x51\xff\x53\xc7\x87\x2e\x8c\xbc\x70\xf2\xf9\x4e\xd9" "\xc9\xd1\xb1\xb1\x89\xae\x32\xbd\x7d\x0f\xbc\xf7\x3b\xa4\xbb\x2c\x3f\x12" "\x45\xfc\x45\xa4\x78\xf1\x7b\x3f\x49\xff\xd4\x1f\x51\xc4\xde\x8f\xc5\x3d" "\xae\x9d\xfd\x36\x58\x75\x62\xb8\xea\xc4\xe4\xe8\x58\xd5\x91\xb9\x66\xa3" "\xb5\x5c\xae\x1c\xef\x1c\x88\x22\xa2\xd6\x55\xa9\xde\x39\x46\x8f\xe0\x5c" "\xec\x49\x3d\x62\xa5\x6c\x7e\xd9\xe0\xe1\xb2\x7b\x13\x0b\x8d\xc5\xc6\xd5" "\xb9\xd9\xda\x78\x63\x71\xb9\xb9\xdc\x9c\x6f\x8d\xa7\x76\x6b\xcb\xfe\xd4" "\xa2\x88\xf3\x29\x62\x35\x22\xd6\xfb\xef\xdc\x5c\x5f\x14\xf1\x56\xa4\xf8" "\xce\xb1\x8d\xf4\xcf\xfd\x11\x3d\x9d\xe3\xf0\xc5\xcb\x13\x5f\x3d\x75\xe6" "\xee\xed\x28\xf6\xb1\x8f\xf7\xa1\x6c\x67\xad\x2f\x62\xb5\x38\x04\xe7\xec" "\x00\xeb\x8f\x22\xfe\x21\x52\xfc\xf4\xfd\x13\xf1\x2f\xfd\x11\xbd\xd1\xfe" "\x89\x2f\x44\xbc\x51\xe6\x0f\x22\xde\x8d\xf6\xf9\x4e\xe5\x85\x71\x2e\xe2" "\xc3\x5d\xae\x23\x0e\xa7\xde\x28\xe2\x7f\xcb\xf3\x7f\x61\x23\xbd\xdf\x5f" "\xde\x0f\x3a\xf7\x95\x4b\x5f\xab\x7d\xa5\x75\x6d\xbe\xab\x6c\xe7\xbe\x72" "\xe8\x9f\x0f\x8f\xd2\x01\xbf\x37\x0d\x44\x11\x3f\xac\xee\xf8\x1b\xe9\x5f" "\xfd\x77\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x80\x14" "\xf1\x2b\x91\xe2\x95\x0f\x4e\xa4\x6a\x7c\xf0\xed\x31\xc5\xcd\xd6\xf5\xda" "\x95\xc6\xd5\xb9\xf6\xb0\xbe\xce\xd8\xbf\xce\x98\xe9\xcd\xcd\xcd\xcd\x5a" "\x6a\x67\x3d\xe7\x54\xce\x95\x9c\xab\x39\xd7\x72\xae\xe7\x8c\x22\xd7\xcf" "\x59\x2f\x73\x60\x73\x73\x2a\x7f\x5f\xc9\xb9\x9a\x73\x2d\xe7\x7a\xce\xe8" "\xc9\xf5\x73\xd6\x73\x4e\xe5\x5c\xc9\xb9\x9a\x73\x2d\xe7\x7a\xce\xe8\xcd" "\xf5\x73\xd6\x73\x4e\xe5\x5c\xc9\xb9\x9a\x73\x2d\xe7\x7a\xce\x38\x20\x63" "\xf7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x4f\x96" "\xa2\xfa\x27\xc5\xb7\xbf\xb1\x91\x36\xfb\xdb\xf3\x4b\x4f\x45\x3b\xd7\xcc" "\x07\xfa\x89\xf7\x7f\x01\x00\x00\xff\xff\xc2\x0e\xfa\x3f", 3074); syz_mount_image(/*fs=*/0x20000180, /*dir=*/0x20000040, /*flags=*/0x2010008, /*opts=*/0x20001040, /*chdir=*/5, /*size=*/0xc02, /*img=*/0x20000400); memcpy((void*)0x20002000, "./bus\000", 6); syscall(__NR_open, /*file=*/0x20002000ul, /*flags=*/0x143142ul, /*mode=*/0ul); memcpy((void*)0x20000380, "/dev/loop", 9); *(uint8_t*)0x20000389 = 0x30; *(uint8_t*)0x2000038a = 0; memcpy((void*)0x20000140, "./bus\000", 6); syscall(__NR_mount, /*src=*/0x20000380ul, /*dst=*/0x20000140ul, /*type=*/0ul, /*flags=*/0x1000ul, /*data=*/0ul); memcpy((void*)0x20000400, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x20000400ul, /*flags=*/0x14113eul, /*mode=*/0ul); if (res != -1) r[0] = res; memcpy((void*)0x20000080, "\x05\x7d\xd1\xac\x29\xca\x28\x5a\x24\x60\x08\x3a\x43\x8b\x46\x8f\x41" "\xe4\x21\x99\x01\x53\x6d\x18\xe6\x5d\x26\xab\x9a\x17\x10\x98\xc2\x31" "\xa2\x9e\x2f\xfd\xee\x25\x64\x83\xad\x8a\xfd\x2e\x61\x2a\xe9\xb3\xdb" "\xc0\x37\x68\x1c\xb8\x63\xae\xda\xd4\x57\xcd\x4c\xff\xdd\xe7\x15\x60" "\x12\x67\xbc\xe5\x2e\x79\xe3\x51\x6a\x86\xcb", 79); syscall(__NR_pwrite64, /*fd=*/r[0], /*buf=*/0x20000080ul, /*count=*/0x4ful, /*pos=*/0x10001ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); do_sandbox_none(); return 0; }