// https://syzkaller.appspot.com/bug?id=9729e5af12d4efde229ad139a686a8b64efb6055 // 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, max_destlen); } static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p) { int err = 0, loopfd = -1; int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; goto error; } if (puff_zlib_to_file(data, size, memfd)) { err = errno; goto error_close_memfd; } loopfd = open(loopname, O_RDWR); if (loopfd == -1) { err = errno; goto error_close_memfd; } if (ioctl(loopfd, LOOP_SET_FD, memfd)) { if (errno != EBUSY) { err = errno; goto error_close_loop; } ioctl(loopfd, LOOP_CLR_FD, 0); usleep(1000); if (ioctl(loopfd, LOOP_SET_FD, memfd)) { err = errno; goto error_close_loop; } } close(memfd); *loopfd_p = loopfd; return 0; error_close_loop: close(loopfd); error_close_memfd: close(memfd); error: errno = err; return -1; } static void reset_loop_device(const char* loopname) { int loopfd = open(loopname, O_RDWR); if (loopfd == -1) { return; } if (ioctl(loopfd, LOOP_CLR_FD, 0)) { } close(loopfd); } static long syz_mount_image(volatile long fsarg, volatile long dir, volatile long flags, volatile long optsarg, volatile long change_dir, volatile unsigned long size, volatile long image) { unsigned char* data = (unsigned char*)image; int res = -1, err = 0, need_loop_device = !!size; char* mount_opts = (char*)optsarg; char* target = (char*)dir; char* fs = (char*)fsarg; char* source = NULL; char loopname[64]; if (need_loop_device) { int loopfd; memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; close(loopfd); source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) reset_loop_device(loopname); errno = err; return res; } static void setup_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); } void loop(void) { memcpy((void*)0x20000040, "nilfs2\000", 7); memcpy((void*)0x20000300, "./file0\000", 8); memcpy( (void*)0x20000e00, "\x78\x9c\xec\xdd\x4d\x8c\x5b\x47\xe1\x00\xf0\xb1\x77\xbd\xc9\x26\xe9\x3f" "\x4e\xff\x09\x5d\xd2\xd0\x26\x14\xda\xf2\xd1\x4d\xb3\x59\xc2\x47\x04\x49" "\x95\x08\x89\xa8\xa9\x10\x97\x4a\x15\x97\x28\x4d\x4b\x44\x08\x12\x45\x02" "\xaa\x4a\x24\x39\x71\xa3\x55\x15\x24\x4e\x7c\x88\x53\x2f\x55\x41\x48\xf4" "\x82\xa2\x9e\xb8\x54\xa2\x91\x2a\xa4\x9e\x0a\x07\x0e\x44\x41\x54\xe2\x00" "\x81\xc4\x28\xde\x19\xaf\x3d\xb1\xf3\x6c\xc7\xf1\x5b\xaf\x7f\x3f\xe9\x79" "\x3c\x6f\xe6\x79\xe6\x3d\x3f\x3f\xbf\xaf\x79\x13\x80\xa9\x55\x6d\xbe\x2e" "\x2f\x2f\x54\x42\xb8\xf8\xe6\xab\x47\xff\xf6\xf0\x5f\xe7\x6f\x8e\x39\xd4" "\xca\x51\x6f\xbe\xce\xb6\xc5\x6a\x21\x84\x4a\x8c\xcf\x66\x9f\xf7\xfe\xcc" "\x4a\x78\xfd\x83\x97\x4e\x76\x0b\x2b\x61\xa9\xf9\x9a\xe2\xe1\xa9\xab\xad" "\x69\x37\x87\x10\xce\x85\xdd\xe1\x52\xa8\x87\x9d\x17\x2f\xbf\xf2\xf6\xd2" "\x93\xc7\xcf\x1f\xbb\xb0\xe7\x9d\xd7\x0e\x5e\xb9\x3b\x73\x0f\x00\x00\xd3" "\xe5\xab\x97\x0e\x2e\xef\xf8\xf3\x1f\xef\xdf\x76\xed\xf5\x07\x0e\x87\x0d" "\xad\xf1\x69\xff\xbc\x1e\xe3\x5b\xe2\x7e\xff\xe1\xb8\xe3\x9f\xf6\xff\xab" "\xa1\x33\x5e\x69\x1b\xda\xcd\x65\xf9\x66\xe3\x50\x9d\xef\xcc\x37\xd3\x25" "\x5f\x7b\x39\xb5\x2c\xdf\x6c\x8f\xf2\xe7\xb2\xf2\x6b\x3d\xf2\x6d\x08\xb7" "\x2f\x7f\xa6\x6d\x5c\xb7\xf9\x86\x49\x96\xd6\xe3\x7a\xa8\x54\x17\x3b\xe2" "\xd5\xea\xe2\xe2\xca\x31\x79\x68\x1e\xd7\xcf\x55\x16\xcf\x9e\x3e\xf3\xdc" "\x0b\x25\x55\x14\x18\xb9\x7f\x3e\x18\x42\xd8\xdd\x36\x1c\xb9\xd0\x19\x5f" "\x6b\xc3\xa1\x35\x50\x87\x21\x87\xc6\x1a\xa8\xc3\x44\x0e\x87\xc7\x57\xd6" "\xb5\xc6\x8a\xd2\xe7\x79\x4c\x43\x63\x6b\xd9\x5b\x20\x80\x15\xf9\xf5\xc2" "\x5b\x9c\xcb\xcf\x2c\xdc\x99\xd6\xa7\xcd\xf6\x57\xfe\xd5\x27\xaa\xdd\xa7" "\x87\x11\x18\xf7\xfa\x3f\x50\xf9\x73\x25\x97\x1f\xa6\xb7\xfc\xb4\xd5\xf9" "\xd5\x79\x5b\x1c\x46\x67\xbd\xae\x4d\x69\xbe\xd2\xef\x68\x4b\x8c\xe7\xd7" "\x11\xf2\xfb\x97\x7a\xff\xfe\xf3\x2b\x1d\x9d\x63\xf3\xeb\x11\xb5\x3e\xeb" "\xd9\xeb\x3a\xc2\xa4\x5c\x5f\xe8\x55\xcf\x99\x31\xd7\x63\x58\xbd\xea\x9f" "\xaf\x17\xeb\xd5\x17\x63\x98\x96\xc3\x97\xb2\xf4\xf6\xdf\x4f\xfe\x9d\x4e" "\xca\x77\x0c\x74\xf7\xaf\xfc\xfc\xff\x34\x0c\xb5\x35\x50\x07\x83\x61\xd8" "\x21\x74\xc4\x6b\x77\xf2\x59\x8d\x92\xb7\x3f\xc0\xda\x95\xdf\x37\xd7\x48" "\xd7\x47\xa3\xfc\xbe\xbe\x3c\x7d\x43\x41\xfa\xc6\x82\xf4\xf9\x82\xf4\x4d" "\x05\xe9\x9b\x0b\xd2\x61\x9a\xfd\xe6\xbb\x3f\x0e\x2f\x57\x56\x8f\xf3\xf3" "\x63\xfa\x41\xcf\x87\xa7\xf3\x6c\xf7\xc4\xf0\xff\x06\xac\x4f\x7e\x3e\x72" "\xd0\xf2\xf3\xfb\x7e\x07\x75\xa7\xe5\xe7\xf7\x13\xc3\x5a\xf6\xbb\x13\x4f" "\x9f\xfa\xdc\xb3\xcf\x5c\x5e\xb9\xff\xbf\xd2\x5a\xff\x6f\xc4\xf5\x3d\x1d" "\x6e\xd4\xe3\x6f\xeb\x52\xcc\x90\xce\x17\xe6\xe7\xd5\x5b\xf7\xfe\xd7\x3b" "\xcb\xa9\xf6\xc8\x77\x6f\x56\x9f\x7b\xba\xe4\x6f\xbe\xdf\xde\x99\xaf\xb2" "\x7d\xf5\x73\x42\xdb\x76\xe6\x96\x7a\x2c\x74\x4e\xb7\x35\xcf\xb7\x25\xe6" "\xdb\xd5\x99\xaf\x9e\xe5\x9b\x8f\xc3\xc6\xac\xbe\xf9\xfe\xc9\xa6\x6c\xba" "\xb4\xff\x91\xb6\xab\x69\x79\xcd\x66\xf3\x5b\xcb\xe6\x63\x2e\xab\x47\xda" "\xae\x6c\x8b\x61\x5e\x0f\x18\x46\x5a\x1f\x7b\xdd\xff\x9f\xd6\xcf\x85\x50" "\xab\x3c\x77\xfa\xcc\xa9\xc7\x63\x3c\xad\xa7\x7f\x98\xa9\x6d\xb8\x39\x7e" "\xdf\x98\xeb\x0d\xdc\xb9\x7e\xdb\xff\x2c\x84\xce\xf6\x3f\x73\xad\xf1\xb5" "\x6a\xfb\x76\x61\xeb\xea\xf8\xca\xca\x76\xe1\x8d\xf8\x79\x9d\xe3\x97\x5a" "\xe5\x74\x8e\xdf\x1f\xe3\xe9\x7f\xee\x1b\x33\xf3\xcd\xf1\x8b\x27\xbf\x7d" "\xe6\xd9\xd1\xcf\x3e\x4c\xb5\x17\x7e\xf0\xe2\x37\x4f\x9c\x39\x73\xea\x3b" "\xde\x0c\xfd\xe6\xcb\x23\xfd\xc0\xb4\xa7\x7f\x57\xeb\x9c\x0e\x5b\xca\x5e" "\x74\xe3\x7a\x33\x3d\x73\x3a\xb2\x37\x25\x6e\x94\x80\xb1\xd8\xfb\xc3\x95" "\x9d\x80\xc7\x4e\x7f\xeb\xc4\xf3\xa7\x9e\x3f\x75\x76\xff\x81\x03\xfb\x97" "\x96\x0e\x7c\x7e\xff\xf2\xde\xe6\x7e\xfd\xde\xf6\xbd\xfb\x76\xe7\x4a\xa8" "\x2d\x30\x4a\xab\x7f\xfa\x65\xd7\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\xe8\xd7\xf7\x8e\x1d\xbd\xfc\xee\x5b\x9f\x7d\x6f\xa5\xfd\xff\x6a\xfb\xbf" "\xd4\xfe\x3f\xdd\xf9\x9b\xda\xff\xff\x28\x6b\xff\x9f\xb7\x93\x4f\xed\xe0" "\x53\x3b\xc0\x6d\x5d\xd2\x9b\x79\xb2\x07\xac\xce\x65\xf9\x6a\x71\xf8\xff" "\xac\xbe\xdb\xb3\x72\x76\x64\xd3\x7d\x28\x86\xad\x7e\xfc\x62\xfb\xff\x54" "\x5c\xfe\x5c\xd7\x54\x9f\xfb\xb2\xf1\xb5\x1e\xd1\xec\x71\x02\xb7\x3c\x2f" "\x65\x2e\x7b\x06\x49\xde\x5f\xe0\x47\x63\x78\x21\x86\xbf\x0c\x50\xa2\xca" "\x7c\xf7\xd1\x31\x2c\x7a\xbe\x75\x5a\xd7\x53\xab\xb5\xb6\xe7\x52\x34\x3c" "\x1f\x78\x72\xa4\xef\x2d\xad\x0d\xe9\x39\x26\xa9\xfd\x77\xd7\xe7\x3a\xb5" "\x7d\xd9\xdb\xc6\x50\x47\x46\x6f\x1c\xcd\x09\xcb\x9e\x47\xa0\xbb\xbf\x4f" "\xd5\xf3\xbf\xff\xb1\x3a\xe3\xa5\xd7\x65\xbd\x0c\xb3\x13\xf2\x99\xb7\x19" "\x7e\x3a\xbd\xeb\x44\xa3\xe7\x5e\x7a\xbf\x3d\xd8\x00\x8c\x46\xd9\xfd\x7f" "\xa6\xf3\x9e\x29\x3c\xfb\xfb\xaf\x6c\xbc\x39\xa4\x6c\x57\x9f\xe8\xdc\x5e" "\xe6\xcf\x2f\x85\x41\xfc\xe9\xdd\xce\xf8\x5a\xed\x7f\x72\x5c\xe5\xe7\xfd" "\xf6\x8d\xbb\xfc\xb2\xe7\xbf\xa8\xfc\x51\xf7\xff\xd9\xea\xff\xae\xef\xed" "\x5f\xd6\x63\x5e\x7d\xb8\x72\xff\xfd\xb3\x2b\xef\xb5\x15\x1b\x76\x76\x96" "\x7f\xbe\x67\xf9\xf9\xfc\xa7\xe7\x40\x6f\x1f\xac\xfc\x6b\xb1\xfc\x34\x37" "\x8f\x84\x8e\xf2\x7b\xce\x7f\xe3\x17\x59\xf9\xf9\x05\xa1\x3e\xfd\x27\x2b" "\x7f\x53\x9f\xe5\xdf\x32\xff\xbb\x86\x2b\xff\xbf\xb1\xfc\xb4\xd8\x1e\x7d" "\xa8\xdf\xf2\x57\x6a\x5c\xa9\x76\xd6\x23\x3f\x6f\x9c\xae\xff\xe5\xe7\x8d" "\x93\xeb\xd9\xfc\xa7\x67\x7b\xde\xa6\xfc\xaf\xbd\xd8\x6d\xfe\x87\xec\xa8" "\xf1\x46\x2c\x1f\xa6\xd9\xa4\xf4\x33\x3b\xa8\x6c\x3f\xa2\xb5\xd3\x3e\x7c" "\xff\xbf\xd1\xb9\xd1\xf6\xff\xdb\xaa\x6c\xb6\x59\xcb\xef\xc3\xf8\x4c\x8c" "\xa7\x0d\x71\xba\xcf\x21\xef\xef\x64\xd0\xfa\xa7\xfb\x2b\xd2\xff\xc0\x8e" "\xec\xf3\x2b\x05\xff\x6f\xfa\xff\x9d\x6c\x5f\x88\x61\xd1\xef\x21\xf5\xff" "\x9b\xd6\xc7\x7a\xfc\xcb\x6f\x8b\x37\x97\x65\x8a\xd7\xba\x2c\xdb\xf5\xba" "\xad\x81\x49\xf5\xfe\x54\x5d\xff\x9b\x88\x61\xe3\x1a\xa8\x83\xa1\xff\xa1" "\x31\x33\xc4\x74\xad\x7e\xe2\x4a\xae\x7f\xa3\xd1\xb8\xbb\x27\xb4\x0a\x94" "\x5a\x38\xa5\x2f\xff\xb2\x8f\x13\xca\x2e\xbf\xec\xe5\x5f\x24\xef\xff\x37" "\xdf\x87\xcf\xfb\xff\xcd\xd3\xf3\xfe\x7f\xf3\xf4\xbc\xff\xdf\x3c\x7d\x3e" "\x7e\x43\xbd\xd2\xf3\xfe\x7f\xf3\xe5\x99\xf7\xff\x9b\xa7\xdf\x97\x7d\x6e" "\xde\x3f\xf0\x42\x41\xfa\x87\x0b\xd2\x77\x76\x4f\x6f\x1d\xb6\xdf\x5f\x30" "\xfd\xae\x82\xf4\x8f\x14\xa4\xef\x69\xa5\x1f\xea\xc8\x91\xd2\x1f\x28\x98" "\xfe\xc1\x82\xf4\x7b\x0b\xd2\x1f\x2a\x48\xff\x58\x41\xfa\xc7\x0b\xd2\x1f" "\x2e\x48\x7f\xb4\x2d\xbd\xbd\x0f\xe8\x94\xfe\x89\x82\xe9\xd7\xbb\xd4\x1e" "\x65\x5a\xe7\x1f\xa6\x59\xde\x3e\xcf\xef\x1f\xa6\x47\xba\xfe\xd3\xeb\xf7" "\xbf\xbd\x20\x1d\x98\x5c\x3f\x79\x7d\xdf\x91\x67\x7e\xfd\xf5\xfa\x4a\xfb" "\xff\xb9\xd6\xf9\x90\x74\x1d\xef\x70\x8c\xd7\xe2\xf1\xd3\xf7\x63\x3c\xbf" "\xee\x1d\xda\xe2\x37\xd3\xde\x8a\xf1\xbf\x64\xe9\x6b\xfd\x7c\x07\x4c\x93" "\xfc\xf9\x19\xf9\xff\xfb\x23\x05\xe9\xc0\xe4\x4a\xf7\x79\xf9\x7d\xc3\x14" "\xaa\x6c\xec\x3e\x3a\x86\x45\xcf\xad\xea\xb5\x9f\xcf\x64\xf9\x64\x0c\x3f" "\x15\xc3\x4f\xc7\xf0\xb1\x18\x2e\xc6\x70\x6f\x0c\xf7\xc5\x70\x69\x4c\xf5" "\xe3\xee\x38\xf2\xc6\x6f\x0f\xbe\x5c\x59\x3d\xde\xdf\x9a\xa5\xf7\x7b\x3f" "\x79\xde\x1e\xa8\xe3\x39\x51\x21\x84\xfd\x7d\xd6\x27\x3f\x3f\x30\xe8\xfd" "\xec\xf9\x73\xfc\x06\x75\xa7\xe5\x0f\xd9\x1c\x0c\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0" "\x34\xd5\xe6\xeb\xf2\xf2\x42\x25\x84\x8b\x6f\xbe\x7a\xf4\xe9\xe3\xa7\xf7" "\xde\x1c\x73\xa8\x95\xa3\xde\x7c\x9d\x6d\x8b\xd5\x5a\xd3\x85\xf0\x78\x0c" "\x67\x62\xf8\xf3\xf8\xe6\xfa\x07\x2f\x9d\x6c\x0f\x6f\xc4\xb0\x12\x96\x42" "\x25\x54\x5a\xe3\xc3\x53\x57\x5b\x25\x6d\x0e\x21\x9c\x0b\xbb\xc3\xa5\x50" "\x0f\x3b\x2f\x5e\x7e\xe5\xed\xa5\x27\x8f\x9f\x3f\x76\x61\xcf\x3b\xaf\x1d" "\xbc\x72\xf7\x96\x00\x00\x00\x00\xac\x7f\xff\x0b\x00\x00\xff\xff\x8e\x7f" "\x0b\x40", 2756); syz_mount_image(/*fs=*/0x20000040, /*dir=*/0x20000300, /*flags=MS_I_VERSION*/ 0x800000, /*opts=*/0x200002c0, /*chdir=*/1, /*size=*/0xac4, /*img=*/0x20000e00); memcpy((void*)0x20000140, "./file0\000", 8); syscall(__NR_unlink, /*path=*/0x20000140ul); } 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); do_sandbox_none(); return 0; }