// https://syzkaller.appspot.com/bug?id=e30eafa41838054ed71bff63e92b4ca38ccd46b2 // 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/newroot/syz-inputs", 0700)) exit(1); if (mount("/syz-inputs", "./syz-tmp/newroot/syz-inputs", NULL, bind_mount_flags | MS_RDONLY, NULL) && errno != ENOENT) exit(1); if (mkdir("./syz-tmp/pivot", 0777)) exit(1); if (syscall(SYS_pivot_root, "./syz-tmp", "./syz-tmp/pivot")) { if (chdir("./syz-tmp")) exit(1); } else { if (chdir("/")) exit(1); if (umount2("./pivot", MNT_DETACH)) exit(1); } if (chroot("./newroot")) exit(1); if (chdir("/")) exit(1); setup_gadgetfs(); setup_binderfs(); setup_fusectl(); } static void setup_gadgetfs() { if (mkdir("/dev/gadgetfs", 0777)) { } if (mount("gadgetfs", "/dev/gadgetfs", "gadgetfs", 0, NULL)) { } } static void setup_fusectl() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void setup_binderfs() { if (mkdir("/dev/binderfs", 0777)) { } if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) { } 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*)0x200000000040, "nilfs2\000", 7); memcpy((void*)0x2000000001c0, "./bus\000", 6); memcpy( (void*)0x200000000200, "\x78\x9c\xec\xdd\x4b\x8c\x5b\x57\xdd\x00\xf0\x63\xcf\x78\x92\x49\xd3\x2f" "\x4e\xbf\x84\x0e\x69\x68\x13\x0a\x6d\x79\x74\xd2\xcc\x0c\xe1\x11\x41\x52" "\x25\x42\x22\x6a\x2a\xc4\xa6\x52\xc4\x26\x4a\xd3\x12\x11\x82\x44\x91\x80" "\xaa\x12\x49\x56\xec\x68\x55\x05\x89\x15\x0f\xb1\xea\xa6\x2a\x08\x89\x6e" "\x50\xd4\x05\x62\x53\x89\x46\xaa\x90\xba\x2a\x2c\x58\x10\x05\x51\x89\x05" "\x84\x26\x46\xe3\x39\xc7\x63\x9f\xd8\xbd\xb6\xe3\xf1\x23\xfe\xfd\xa4\xeb" "\xe3\x73\xcf\xbd\xfe\x9f\x7b\x7d\x7d\x7d\xdf\x27\x00\x53\xab\x5c\x7f\x5d" "\x59\x59\x28\x85\x70\xe9\xf5\x97\x8f\xfe\xfd\xa1\xbf\xcd\xaf\xf6\x39\xd4" "\x18\xa2\x5a\x7f\x9d\x6d\xca\x55\x42\x08\xa5\x98\x9f\xcd\x3e\xef\xdd\x99" "\xb5\xf4\xc6\x7b\x2f\x9c\x6a\x97\x96\xc2\x52\xfd\x35\xe5\xc3\x93\xd7\x1a" "\xe3\xde\x15\x42\x38\x1f\xf6\x84\xcb\xa1\x1a\x76\x5d\xba\xf2\xd2\x9b\x4b" "\x4f\x1c\xbf\x70\xec\xe2\xde\xb7\x5e\x39\x78\x75\x63\xa6\x1e\x00\x00\xa6" "\xcb\x57\x2f\x1f\x5c\xd9\xf9\x97\x3f\xdd\xb7\xfd\xfa\xab\xf7\x1f\x0e\x9b" "\x52\xef\xd5\x37\xf5\xed\xf3\x6a\xec\xb1\x35\x6e\xf7\x1f\x8e\x1b\xfe\x69" "\xfb\xbf\x1c\x5a\xf3\xa5\xa6\xae\xd9\x5c\x36\xdc\x6c\xec\xca\xf3\xad\xc3" "\xcd\xb4\x19\xae\x39\x4e\x25\x1b\x6e\xb6\x43\xfc\xb9\x2c\x7e\xa5\xc3\x70" "\x9b\xc2\x07\xc7\x9f\x69\xea\xd7\x6e\xba\x61\x92\xa5\xe5\xb8\x1a\x4a\xe5" "\xc5\x96\x7c\xb9\xbc\xb8\xb8\xb6\x4f\x1e\xea\xfb\xf5\x73\xa5\xc5\x73\x67" "\xce\x3e\xf3\xdc\x88\x2a\x0a\x0c\xdc\xbf\x1e\x08\x21\xec\x69\xea\x8e\x5c" "\x6c\xcd\x8f\x5b\x77\x68\x0c\xea\x90\x75\xf5\x6d\x8b\x2e\x86\xab\x8d\x41" "\x5d\x27\xb2\x3b\x3c\xbc\x58\xd7\x6b\x6b\x46\x3e\xcd\x43\xea\x6a\xdb\xfa" "\x5f\x77\xbc\x5f\x1b\xe0\x8a\x08\x98\x7a\xf9\xf9\xc2\x5b\x9c\xcf\x8f\x2c" "\xdc\x9e\xc6\xa7\xcd\x76\x17\xff\xda\xe3\xe5\xf6\xe3\xc3\x00\x0c\x7b\xf9" "\xef\x29\xfe\xdc\x88\xe3\x07\xf1\x7f\x75\xc1\x1a\x87\xc1\xb9\x53\x97\xa6" "\x34\x5d\xe9\x77\xb4\x35\xe6\xf3\xf3\x08\xf9\xf5\x4b\x9d\x7f\x7f\xf9\x99" "\x8e\xd6\xbe\xf9\xf9\x88\x4a\x97\xf5\xec\x74\x1e\x61\x52\xce\x2f\x74\xaa" "\xe7\xcc\x90\xeb\xd1\xaf\x4e\xf5\xcf\x97\x8b\x3b\xd5\x17\x63\x9a\xe6\xc3" "\x97\xb2\xf2\xe6\xdf\x4f\xfe\x9d\x4e\xca\x77\x0c\xb4\xf7\xef\xfc\xf8\xbf" "\x4e\xa7\x1b\xef\x2e\xb4\xe4\x2b\xb7\xf3\x59\x0e\xe1\x03\x9d\xe4\xd7\xcd" "\xd5\xd2\xf9\xd1\x28\xbf\xae\x2f\x2f\xdf\x54\x50\xbe\xb9\xa0\x7c\xbe\xa0" "\x7c\x4b\x41\xf9\x5d\x05\xe5\x30\xcd\x7e\xf3\xdd\x1f\x87\x17\x4b\xeb\xfb" "\xf9\xf9\x3e\x7d\xaf\xc7\xc3\xd3\x71\xb6\xbb\x63\xfa\x7f\x3d\xd6\x27\x3f" "\x1e\xd9\x6b\xfc\xfc\xba\xdf\x5e\xdd\x6e\xfc\xfc\x7a\x62\x18\x67\xbf\x3b" "\xf9\xd4\xe9\xcf\x3d\x7d\xe2\xca\xda\xf5\xff\xa5\xc6\xf2\x7f\x33\x2e\xef" "\x69\x77\xa3\x1a\x7f\x5b\x97\xe3\x00\xe9\x78\x61\x7e\x5c\xbd\x71\xed\x7f" "\xb5\x35\x4e\xb9\xc3\x70\xf7\x64\xf5\xb9\xbb\xcd\xf0\xf5\xf7\x3b\x5a\x87" "\x2b\xed\x58\xff\x9c\xd0\xb4\x9e\xb9\xa5\x1e\x0b\xad\xe3\x6d\xeb\x34\xdc" "\xee\xd6\xe1\xaa\xd9\x70\xf3\xb1\xdb\x9c\xd5\x37\xdf\x3e\xd9\x92\x8d\x97" "\xb6\x3f\xd2\x7a\x35\xcd\xaf\xd9\x6c\x7a\x2b\xd9\x74\xcc\x65\xf5\x48\xeb" "\x95\xed\x31\xcd\xeb\x01\xfd\x48\xcb\x63\xa7\xeb\xff\xd3\xf2\xb9\x10\x2a" "\xa5\x67\xce\x9c\x3d\xfd\x58\xcc\xa7\xe5\xf4\x8f\x33\x95\x4d\xab\xfd\xf7" "\x0f\xb9\xde\xc0\xed\xeb\xf6\xfe\x9f\x85\xd0\x7a\xff\xcf\xd6\x46\xff\x4a" "\xb9\x79\xbd\xb0\x6d\xbd\x7f\x69\x6d\xbd\xf0\x5a\xfc\xbc\xd6\xfe\x4b\x8d" "\x38\xad\xfd\x97\x63\x3e\xfd\xcf\x7d\x63\x66\xbe\xde\x7f\xf1\xd4\xb7\xcf" "\x3e\x3d\xf8\xc9\x87\xa9\xf6\xdc\x0f\x9e\xff\xe6\xc9\xb3\x67\x4f\x7f\x67" "\xe4\x6f\x96\xe7\x43\x18\x83\x6a\xf4\xf1\xe6\xcb\xe3\x51\x8d\x5e\xde\xa4" "\xdd\x96\xa1\x04\x0d\x61\x1c\x26\xd9\x9b\xde\xde\x8c\x78\xc5\x04\x6c\xb8" "\x7d\x3f\x5c\xdb\x08\x78\xf4\xcc\xb7\x4e\x3e\x7b\xfa\xd9\xd3\xe7\x96\x0f" "\x1c\x58\x5e\x5a\x3a\xf0\xf9\xe5\x95\x7d\xf5\xed\xfa\x7d\xcd\x5b\xf7\xcd" "\xce\x8f\xa0\xb6\xc0\x20\xad\xff\xe9\x8f\xba\x26\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x40\xb7\xbe\x77\xec\xe8\x95\xb7\xdf\xf8\xec\x3b\x6b\xf7\xff" "\xaf\xdf\xff\x97\xee\xff\x4f\x57\xfe\xa6\xfb\xff\x7f\x94\xdd\xff\x9f\xdf" "\x27\x9f\xee\x83\x4f\xf7\x01\x6e\x6f\x53\x5e\x1f\x26\x7b\xc0\xea\x5c\x36" "\x5c\x25\x76\xff\x9f\xd5\x77\x47\x16\x67\x67\x36\xde\x87\x62\xda\x68\xc7" "\x2f\xde\xff\x9f\xc2\xe5\xcf\x75\x4d\xf5\xb9\x37\xeb\x5f\xe9\x90\xcd\x1e" "\x27\x70\xcb\xf3\x52\xe6\xb2\x67\x90\xe4\xed\x05\x7e\x34\xa6\x17\x63\xfa" "\xcb\x00\x23\x54\x9a\x6f\xdf\x3b\xa6\x45\xcf\xb7\x4e\xcb\x7a\x7a\x3e\x45" "\xd3\x73\x29\x6a\x9e\x0f\x3c\x39\xd2\xf7\x96\x96\x86\x2d\x4d\xef\x43\xa7" "\xe7\x3a\x35\x7d\xd9\xdb\x87\x50\x47\x06\x6f\x18\xb7\x13\x8e\x7a\x1a\x81" "\xf6\xfe\x31\x55\xcf\xff\xfe\xe7\xfa\x84\x8f\xbc\x2e\xba\xce\xdd\xec\x70" "\xe3\xfd\x74\x7a\x97\x89\x5a\xc7\xad\xf4\x6e\x5b\xb0\x01\x18\x8c\x51\xb7" "\xff\x99\x8e\x7b\xa6\xf4\xdc\xef\xbf\xb2\x79\xb5\x4b\x83\x5d\x7b\xbc\x75" "\x7d\x99\x3f\xbf\x14\x7a\xf1\xe7\xb7\x5b\xf3\xe3\xde\xfe\xe4\x46\xc7\xcf" "\xdb\xed\x1b\x76\xfc\x51\x4f\xff\xb0\xdb\xff\x6c\xb4\x7f\xd7\xf5\xfa\x2f" "\x6b\x31\xaf\xda\x5f\xdc\xff\xfc\xec\xea\x3b\x4d\x61\xc3\xae\x6e\xe3\xe7" "\xd3\x9f\x9e\x03\xbd\xa3\xb7\xf8\xd7\x63\xfc\x34\x35\x0f\x87\xee\xe2\xd7" "\x7e\x91\xc5\xcf\x4f\x08\x75\xe9\xbf\x59\xfc\x2d\x5d\xc6\xbf\x65\xfa\x77" "\xf7\x17\xff\xfd\x18\x3f\xcd\xb6\x47\x1e\xec\x36\xfe\x5a\x8d\x4b\xe5\xd6" "\x7a\xcc\x67\xd3\x91\xce\xff\xe5\xc7\x8d\x93\x1b\xd9\xf4\xa7\x67\x7b\x7e" "\x40\xfc\xaf\x3d\xdf\x6e\xfa\xfb\x6c\xa8\xf1\x66\x8c\x0f\xd3\x6c\x52\xda" "\x99\xed\x55\xb6\x1d\xd1\xd8\x68\xef\xbf\xfd\xdf\xe8\xfc\x60\xdb\xff\x6d" "\x54\x36\x5b\xad\xe5\xd7\x61\x7c\x26\xe6\xd3\x8a\x38\x5d\xe7\x90\xb7\x77" "\xd2\x6b\xfd\xd3\xf5\x15\xe9\x7f\x60\x67\xf6\xf9\xa5\x82\xff\x37\xed\xff" "\x4e\xb6\x2f\xc4\xb4\xe8\xf7\x90\xda\xff\x4d\xcb\x63\x35\xfe\xe5\x37\xe5" "\xeb\xf3\x32\xe5\x2b\x6d\xe6\xed\x9d\xba\xae\x81\x49\xf5\xee\x54\x9d\xff" "\x1b\x40\x77\x62\xc3\x63\x6c\xee\xd0\x7f\x7d\x93\x62\xd4\xf3\x60\xa0\xdd" "\x1f\xfa\x18\xe7\xf0\x18\xd4\xbb\xd1\xd5\x66\xfa\x18\x6f\xd3\x98\x7c\x97" "\xb5\x5a\x6d\x63\x0f\x68\x15\x18\x69\x70\x46\x3e\xff\x47\xbd\x9f\x30\xea" "\xf8\xa3\x9e\xff\x45\xf2\xf6\x7f\xf3\x6d\xf8\xbc\xfd\xdf\xbc\x3c\x6f\xff" "\x37\x2f\xcf\xdb\xff\xcd\xcb\xe7\xe3\x37\xd4\xa9\x3c\x6f\xff\x37\x9f\x9f" "\x79\xfb\xbf\x79\xf9\xbd\xd9\xe7\xe6\xed\x03\x2f\x14\x94\x7f\xb8\xa0\x7c" "\x57\xfb\xf2\xc6\x6e\xfb\x7d\x05\xe3\xef\x2e\x28\xff\x48\x41\xf9\xde\x46" "\xf9\xa1\x96\x21\x52\xf9\xfd\x05\xe3\x3f\x50\x50\x7e\x4f\x41\xf9\x83\x05" "\xe5\x1f\x2b\x28\xff\x78\x41\xf9\x43\x05\xe5\x8f\x34\x95\x37\xb7\x01\x9d" "\xca\x3f\x51\x30\xfe\x9d\x2e\xdd\x8f\x32\xad\xd3\x0f\xd3\x2c\xbf\x3f\xcf" "\xef\x1f\xa6\x47\x3a\xff\xd3\xe9\xf7\xbf\xa3\xa0\x1c\x98\x5c\x3f\x79\x75" "\xff\x91\x13\xbf\xfe\x7a\x75\xed\xfe\xff\xb9\xc6\xf1\x90\x74\x1e\xef\x70" "\xcc\x57\xe2\xfe\xd3\xf7\x63\x3e\x3f\xef\x1d\x9a\xf2\xab\x65\x6f\xc4\xfc" "\x5f\xb3\xf2\x71\x3f\xde\x01\xd3\x24\x7f\x7e\x46\xfe\xff\xfe\x70\x41\x39" "\x30\xb9\xd2\x75\x5e\x7e\xdf\x30\x85\x4a\x9b\xdb\xf7\x8e\x69\xd1\x73\xab" "\x3a\x6d\xe7\x33\x59\x3e\x19\xd3\x4f\xc5\xf4\xd3\x31\x7d\x34\xa6\x8b\x31" "\xdd\x17\xd3\xfd\x31\x5d\x1a\x52\xfd\xd8\x18\x47\x5e\xfb\xed\xc1\x17\x4b" "\xeb\xfb\xfb\xdb\xb2\xf2\x6e\xaf\x27\xcf\xef\x07\x6a\x79\x4e\x54\x08\x61" "\xb9\xcb\xfa\xe4\xc7\x07\x7a\xbd\x9e\x3d\x7f\x8e\x5f\xaf\x6e\x37\x7e\x9f" "\xb7\x83\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x8c\x4c\xb9\xfe\xba\xb2\xb2\x50\x0a\xe1" "\xd2\xeb\x2f\x1f\x7d\xea\xf8\x99\x7d\xab\x7d\x0e\x35\x86\xa8\xd6\x5f\x67" "\x9b\x72\x95\xc6\x78\x21\x3c\x16\xd3\x99\x98\xfe\x3c\xbe\xb9\xf1\xde\x0b" "\xa7\x9a\xd3\x9b\x31\x2d\x85\xa5\x50\x0a\xa5\x46\xff\xf0\xe4\xb5\x46\xa4" "\xbb\x42\x08\xe7\xc3\x9e\x70\x39\x54\xc3\xae\x4b\x57\x5e\x7a\x73\xe9\x89" "\xe3\x17\x8e\x5d\xdc\xfb\xd6\x2b\x07\xaf\x6e\xdc\x1c\x00\x00\x00\x80\x3b" "\xdf\xff\x02\x00\x00\xff\xff\xa7\xdd\x0d\x40", 2765); syz_mount_image(/*fs=*/0x200000000040, /*dir=*/0x2000000001c0, /*flags=MS_NOSUID*/ 2, /*opts=*/0x2000000000c0, /*chdir=*/1, /*size=*/0xacd, /*img=*/0x200000000200); memcpy((void*)0x200000000080, "./file1\000", 8); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000080ul, /*flags=O_CREAT|O_RDWR*/ 0x42, /*mode=*/0); if (res != -1) r[0] = res; syscall( __NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x600000ul, /*prot=PROT_GROWSUP|PROT_WRITE|PROT_READ|PROT_EXEC|0x7ffff0*/ 0x27ffff7ul, /*flags=MAP_UNINITIALIZED|MAP_NONBLOCK|MAP_LOCKED|MAP_FIXED|0x1*/ 0x4012011ul, /*fd=*/r[0], /*offset=*/0ul); *(uint64_t*)0x200000000340 = 0; *(uint64_t*)0x200000000348 = 0x3938700; syscall(__NR_ppoll, /*fds=*/0ul, /*nfds=*/0ul, /*tsp=*/0x200000000340ul, /*sigmask=*/0ul, /*size=*/0ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; do_sandbox_none(); return 0; }