// https://syzkaller.appspot.com/bug?id=900c6471b285de7578500e083e1f5966e9633b93 // 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_gadgetfs(); static void setup_binderfs(); static void setup_fusectl(); static void sandbox_common_mount_tmpfs(void) { write_file("/proc/sys/fs/mount-max", "100000"); if (mkdir("./syz-tmp", 0777)) exit(1); if (mount("", "./syz-tmp", "tmpfs", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot", 0777)) exit(1); if (mkdir("./syz-tmp/newroot/dev", 0700)) exit(1); unsigned bind_mount_flags = MS_BIND | MS_REC | MS_PRIVATE; if (mount("/dev", "./syz-tmp/newroot/dev", NULL, bind_mount_flags, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/proc", 0700)) exit(1); if (mount("syz-proc", "./syz-tmp/newroot/proc", "proc", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/selinux", 0700)) exit(1); const char* selinux_path = "./syz-tmp/newroot/selinux"; if (mount("/selinux", selinux_path, NULL, bind_mount_flags, NULL)) { if (errno != ENOENT) exit(1); if (mount("/sys/fs/selinux", selinux_path, NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); } if (mkdir("./syz-tmp/newroot/sys", 0700)) exit(1); if (mount("/sys", "./syz-tmp/newroot/sys", 0, bind_mount_flags, NULL)) exit(1); if (mount("/sys/kernel/debug", "./syz-tmp/newroot/sys/kernel/debug", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/sys/fs/smackfs", "./syz-tmp/newroot/sys/fs/smackfs", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/proc/sys/fs/binfmt_misc", "./syz-tmp/newroot/proc/sys/fs/binfmt_misc", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mkdir("./syz-tmp/pivot", 0777)) exit(1); if (syscall(SYS_pivot_root, "./syz-tmp", "./syz-tmp/pivot")) { if (chdir("./syz-tmp")) exit(1); } else { if (chdir("/")) exit(1); if (umount2("./pivot", MNT_DETACH)) exit(1); } if (chroot("./newroot")) exit(1); if (chdir("/")) exit(1); setup_gadgetfs(); setup_binderfs(); setup_fusectl(); } static void setup_gadgetfs() { if (mkdir("/dev/gadgetfs", 0777)) { } if (mount("gadgetfs", "/dev/gadgetfs", "gadgetfs", 0, NULL)) { } } static void setup_fusectl() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void setup_binderfs() { if (mkdir("/dev/binderfs", 0777)) { } if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) { } if (symlink("/dev/binderfs", "./binderfs")) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); if (getppid() == 1) exit(1); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = (200 << 20); setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 136 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 128 << 20; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); if (unshare(CLONE_NEWNS)) { } if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } typedef struct { const char* name; const char* value; } sysctl_t; static const sysctl_t sysctls[] = { {"/proc/sys/kernel/shmmax", "16777216"}, {"/proc/sys/kernel/shmall", "536870912"}, {"/proc/sys/kernel/shmmni", "1024"}, {"/proc/sys/kernel/msgmax", "8192"}, {"/proc/sys/kernel/msgmni", "1024"}, {"/proc/sys/kernel/msgmnb", "1024"}, {"/proc/sys/kernel/sem", "1024 1048576 500 1024"}, }; unsigned i; for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++) write_file(sysctls[i].name, sysctls[i].value); } static int wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, __WALL) != pid) { } return WEXITSTATUS(status); } static void drop_caps(void) { struct __user_cap_header_struct cap_hdr = {}; struct __user_cap_data_struct cap_data[2] = {}; cap_hdr.version = _LINUX_CAPABILITY_VERSION_3; cap_hdr.pid = getpid(); if (syscall(SYS_capget, &cap_hdr, &cap_data)) exit(1); const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE); cap_data[0].effective &= ~drop; cap_data[0].permitted &= ~drop; cap_data[0].inheritable &= ~drop; if (syscall(SYS_capset, &cap_hdr, &cap_data)) exit(1); } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid != 0) return wait_for_loop(pid); sandbox_common(); drop_caps(); if (unshare(CLONE_NEWNET)) { } write_file("/proc/sys/net/ipv4/ping_group_range", "0 65535"); sandbox_common_mount_tmpfs(); loop(); exit(1); } uint64_t r[1] = {0xffffffffffffffff}; void loop(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x20000180, "erofs\000", 6); memcpy((void*)0x20000080, "./file2\000", 8); *(uint32_t*)0x20000e00 = 0; memcpy((void*)0x20000e04, "\xde\x60\xd8\xdc\x53\x6d\x52\x58\xd6\xa9\x4a\xd5\x56\x04\xa3\x4d\xc6" "\x5b\x7e\xf7\x9c\x1a\x17\x54\xe4\xca\xdf\xe2\x18\x23\xd0\xc1\x0a\x15" "\xd5\x3d\xba\x5f\x2d\x2b\xc6\x7e\xf2\x47\x7d\x04\x12\x53\x4e\x2f\x51" "\x51\xc7\xa6\x0c\x8f\x5d\x6c\x63\x4d\x17\x3f\xec\xb5\xde\x92\x07\xa7" "\x09\x0d\x30\x22\x29\xcd\x3f\x21\x0d\x34\xe4\x58\x4c\x82\x4c\x9d\xda" "\x7d\x35\xe0\xd7\xa0\x6c\xd6\x67\xbf\x9c\xce\xd3\x29\x44\xca\x27\xd8" "\xa8\x0e\x62\xcf\x63\x10\xdb\x86\x9e\xe2\x50\xfb\x65\x46\x7e\x3b\x11" "\xad\x50\x42\xd6\x00\xc6\xb8\xf1\x84\x54\xd5\x7d\xf6\x21\xe5\x78\xfe" "\xf0\xa3\xa9\x3c\x14\x60\x92\x31", 144); *(uint32_t*)0x20000e94 = -1; sprintf((char*)0x20000e98, "%020llu", (long long)-1); memcpy( (void*)0x20000eac, "\x21\x5a\xa1\x5b\xf2\x9e\xd2\xff\x6f\x92\x41\xff\x60\x69\x3d\x29\x8a\x3d" "\x41\x14\x3b\xfc\x90\x91\x14\x61\x11\xb4\x93\x0c\x37\xed\xdc\xf5\x42\xd6" "\x41\xb8\x21\xaf\x22\x9e\x7d\x87\x80\xd5\x0b\x6f\x47\xfa\x3e\x59\x28\x55" "\x5e\xb4\xd6\xd5\x07\xd9\x2b\x87\xb0\xb0\x1c\x19\xc7\x89\x89\x5e\x02\x89" "\x1a\xfc\x08\x2b\xb8\x5a\x47\x08\x7f\x16\x8a\x6a\xa2\xc2\xbc\x51\xa3\xf3" "\xa4\x04\xa4\xa1\xe6\xe2\xfb\xad\x00\xd5\x92\xdf\x65\xbd\x2a\x59\x3f\x48" "\x8b\xf4\x1d\xbc\x7e\xa4\x3f\xe2\x55\x4f\xbe\x34\xe4\xa7\x7f\x60\x6f\x35" "\xe4\x45\xaf\xf5\x5a\xaa\x19\xf7\xff\xff\xff\xff\xff\xff\xff\x19\xbd\x47" "\x39\xc8\x0c\x9e\x66\x81\x22\x9c\x48\xe0\xc6\xde\x63\x4c\x35\xc0\x29\xc4" "\xeb\x3b\x43\x41\xff\xff\x08\x94\x16\xa3\xd6\x3f\x08\x57\x7a\x30\x37\x58" "\x41\x06\x58\xa4\xec\x52\xe5\xb7\x78\xed\xa9\xcd\x1b\xd8\x83\x4e\x14\x5c" "\x11\x16\x90\xb0\xda\x92\x70\x87\xe8\x05\x00\x00\x00\x00\x00\x00\x00\x8f" "\xd8\xb9\xbd\xfb\xda\xa7\x77\xdb\x54\x12\x74\x63\xa5\x89\xee\xd3\x25\xc3" "\x4b\x64\x59\x50\x57\x02\xf3\xa4\x5f\x28\x5c\x53\xc1\xb2\x5b\xab\x2e\xef" "\x63\x24\xd6\x7a\xd8\xd7\xe2\x47\x31\x7d\x80\xff\x3a\xd9\x12\x0b\x4e\x22" "\x94\xe6\x7d\xe9\xad\xaa\xb7\x6f\xa9\x91\x57\x1a\x18\x7c\xd8\xf7\xfb\xc4" "\x9b\xf4\x5d\x6f\x8d\xbf\x69\xef\x0d\x76\x5a\x02\xad\x98\xe8\x02\xb1\x68" "\x81\x48\xa8\xc0\x17\xe3\xaf\x23\x8f\x82\xc4\x9b\xbd\x8b\xa5\x42\xfb\xfe" "\xc5\x69\x3d\x82\x15\x8e\x32\x16\xb9\x56\x56\x98\x6f\x9d\x7e\xec\x72\x44" "\xa2\x7d\xfa\xf8\x62\x3f\xc7\x69\x43\xbf\x14\x2a\x61\xd9\xd6\xc6\x22\xdb" "\xca\xc3\xd3\x24\xd0\x7b\xe5\xa5\xcc\x88\xf8\x5a\x85\x7f\xf9\xd4\x59\x24" "\xd5\xd8\x2a\x04\x42\x4d\x34\x53\xc9\x6f\xaf\xa3\x7d\x95\x29\x40\xf3\x14" "\x7d\x5a\xf2\x34\xb3\x9c\x3f\xf7\x42\xa2\xe5\x30\x0e\x10\xee\x69\x2a\x32" "\xf5\xc3\x32\x1d\x44\xea\xda\xa8\xc4\x4b\xf9\xd5\x34\xb5\x2f\xe7\x58\x08" "\x22\x99\xe0\x4f\x83\x9e\x52\x9a\x6d\x02\x93\xbf\x12\x77\x0a\xc9\x48\x73" "\x0a\x0c\x36\x7e\x11\x71\x37\xc6\xfd\x93\x0b\x1f\x30\x61\x38\x16\x3b\x71" "\x80\xe1\x11\xd6\x92\x62\x55\xa7\x1b\xd2\x27\xb1\xd2\x7f\x28\x97\x72\x1e" "\x3b\xda\x88\x4b\x07\x92\xa8\x11\x34\xd8\xfb\xc9\xaa\xfc\x73\x2b\x15\xae" "\xe5\xc9\xe0\xa8\x35\xac\x17\xb4\x57\xef\xa3\x6c\xe1\x09\x5a\x31\x96\xd2" "\x78\x20\x78\x46\xea\x81\x17\x28\x26\xd4\x9b\x87\xaa\xc6\xe6\x62\xbb\x82" "\x4f\x16\xb0\xb6\x5f\xc6\x98\x93\x95\xba\x02\x2b\xd6\xaf\x2f\x18\x30\x37" "\x5c\x31\x1b\xdf\x55\xf1\x5d\x98\x30\x56\x4e\x65\xdc\x76\xe5\xb7\xc9\xa9" "\x1e\x85\x7d\xbc\xef\x39\x09\xcf\xd6\x28\x64\x93\x37\xde\x6f\xf0\x4a\x39" "\x8f\x43\x25\xa4\x30\x46\x7a\xee\x51\xd7\xfa\x12\xef\x61\xbc\x0b\x67\xd1" "\xe1\x8e\x62\x75\x4d\x8a\x2b\x65\xfb", 621); sprintf((char*)0x20001119, "%023llo", (long long)-1); sprintf((char*)0x20001130, "%023llo", (long long)0); *(uint32_t*)0x20001147 = -1; sprintf((char*)0x2000114b, "%020llu", (long long)-1); *(uint64_t*)0x2000115f = -1; *(uint64_t*)0x20001167 = -1; *(uint8_t*)0x2000116f = -1; memcpy((void*)0x20001170, "\x3d\xea\x3f", 3); memcpy( (void*)0x20000700, "\x78\x9c\xec\x99\xbf\x8b\x13\x41\x14\xc7\xbf\x33\xbb\x97\x3d\x0f\x11\x6c" "\x2c\x6c\x2c\x3c\xf0\x44\x6f\x7f\x45\xe5\x9a\x2b\x4e\x10\x41\x10\x84\x53" "\xd4\x32\x78\x7b\x47\x70\x2f\x91\x64\x85\x24\x20\x1a\x6c\x6c\x2c\x45\x04" "\x5b\xff\x01\x0b\x8b\x54\x16\x76\x76\xb6\x5a\xa8\x20\x58\x98\x52\xb0\x10" "\x46\x66\x76\xdc\x9d\x24\x6e\x4c\x4c\x8a\x80\xef\x03\x37\xf7\x9d\x37\x33" "\x6f\xde\x7b\xec\xbe\x14\x0b\x82\x20\xfe\x5b\x3e\x7f\xfa\xfe\xf1\xf1\xf9" "\x8d\xab\xa7\x01\x1c\xc4\x2a\x1c\x6d\xff\x6a\xe5\x7b\x38\x90\xcd\x3e\x3c" "\xbb\x7b\xea\xc9\xe6\x85\xe7\x2f\xdf\xbf\x78\x53\x3b\x74\xaf\x37\xec\x6f" "\x19\x80\x10\x93\xdf\x2f\x1d\xbf\xde\xb2\x90\xa8\x99\x10\xe2\xfe\xe0\xfa" "\xaa\x1c\x9e\x0e\xda\xae\x81\xe3\xa4\xd6\xd7\xc1\xe0\xe2\x81\x94\x3f\x85" "\x22\xb5\x47\x60\xb8\xa9\x94\x0d\x64\x1a\xa8\x1f\xd0\x22\x8e\xdc\x5b\xf5" "\x78\x67\xb7\x1a\x47\xbe\x1c\x02\x39\x84\x72\x28\x9b\x77\xc9\xd3\xfd\x2e" "\xc3\x4e\x96\x9b\x10\xcc\x58\x6f\xb6\x3b\xb7\x2b\x71\x1c\x35\x86\xc5\x92" "\xf8\x7d\xcf\xc8\xd2\xb4\x62\x5c\xfd\x54\x7c\x5b\x1c\x9b\x7a\x2e\xe3\xe3" "\x00\x6e\x3c\x7a\xd8\x95\x73\x57\xdb\x7d\xf0\xb4\x96\x00\x02\x70\x04\x5a" "\x97\xc1\xb0\xad\xf5\x06\x1c\xb8\xae\x9b\x97\xc4\xc8\xff\xa8\x9d\xfb\xb7" "\x06\xf2\xb7\x66\xca\x6d\xee\x82\xfd\x48\x1f\x03\x69\x39\xbc\x3e\x47\xcf" "\xb2\x00\x33\x1c\x67\x0b\x52\x9f\x7f\x10\xf2\x05\xfa\xfb\x66\xe1\x2c\x40" "\xa8\x13\x09\x36\x6c\x91\x2f\x74\x66\x39\xd2\xef\xbd\x1d\x3d\xf5\x65\x51" "\x82\x2f\x16\x0c\x05\x1d\x47\x35\x2e\xf3\xe9\xbd\xa8\xf7\xbc\x5b\x89\xe3" "\xcb\x33\x5c\x5a\xd2\x37\xa6\x96\x4b\x79\x0d\x3b\x96\xd9\x9f\x98\x0d\x9c" "\x30\xfa\x93\x0d\x3b\xeb\x1f\x5e\xb2\x7f\xc7\x6b\xb6\x3b\xeb\xd5\xfd\xca" "\x5e\xb4\x17\xd5\xc2\xb0\x7c\xce\x3f\xe3\xfb\x67\x43\x6f\xb7\xea\xc0\xf7" "\x54\x3b\x1a\xd3\xff\x96\x55\x7f\x5a\x31\xfc\x2f\x99\x1b\x8c\x1f\x94\x12" "\x2b\xa1\x55\x49\x92\x46\xd0\x02\x92\x46\x90\xcd\xc3\x74\x34\x3a\xee\xf6" "\xab\xfa\x37\x75\x86\xab\xfe\xc7\xb1\x76\x3c\xf5\x21\x8b\xac\xd2\x76\xfe" "\x1c\x0f\xd3\x7f\x5c\xfd\x97\x6a\xcd\x2a\x0c\x9e\x20\x08\x82\x20\x08\x82" "\x20\x08\x82\x20\x08\x82\x20\x08\x62\x2a\x8e\x81\x21\xfd\x04\xa2\x3e\x54" "\x89\x02\xc2\x2b\x6a\xf7\xaf\x00\x00\x00\xff\xff\xda\xbb\x69\x42", 520); syz_mount_image( /*fs=*/0x20000180, /*dir=*/0x20000080, /*flags=MS_STRICTATIME|MS_RDONLY|MS_NOEXEC|MS_NODIRATIME|0x4*/ 0x100080d, /*opts=*/0x20000e00, /*chdir=*/-1, /*size=*/0x208, /*img=*/0x20000700); memcpy((void*)0x20000040, ".\000", 2); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000040ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[0] = res; syscall(__NR_fadvise64, /*fd=*/r[0], /*offset=*/0x2000000082e0ul, /*len=*/0xff39ul, /*advice=POSIX_FADV_WILLNEED*/ 3ul); } 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; do_sandbox_none(); return 0; }