// https://syzkaller.appspot.com/bug?id=2d88e2bf0244528dd966548cbcec638378a4ac8b // 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 #ifndef __NR_move_mount #define __NR_move_mount 429 #endif #ifndef __NR_open_tree #define __NR_open_tree 428 #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_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_binderfs(); setup_fusectl(); } 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); 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); 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*)0x20000000, "ext4\000", 5); memcpy((void*)0x20000500, "./file1\000", 8); memcpy((void*)0x20000680, "journal_dev", 11); *(uint8_t*)0x2000068b = 0x3d; sprintf((char*)0x2000068c, "0x%016llx", (long long)5); *(uint8_t*)0x2000069e = 0x2c; memcpy((void*)0x2000069f, "noblock_validity", 16); *(uint8_t*)0x200006af = 0x2c; memcpy((void*)0x200006b0, "nombcache", 9); *(uint8_t*)0x200006b9 = 0x2c; memcpy((void*)0x200006ba, "norecovery", 10); *(uint8_t*)0x200006c4 = 0x2c; memcpy((void*)0x200006c5, "barrier", 7); *(uint8_t*)0x200006cc = 0x3d; sprintf((char*)0x200006cd, "0x%016llx", (long long)0xc); *(uint8_t*)0x200006df = 0x2c; memcpy((void*)0x200006e0, "resgid", 6); *(uint8_t*)0x200006e6 = 0x3d; sprintf((char*)0x200006e7, "0x%016llx", (long long)0xee01); *(uint8_t*)0x200006f9 = 0x2c; memcpy((void*)0x200006fa, "nodiscard", 9); *(uint8_t*)0x20000703 = 0x2c; memcpy((void*)0x20000704, "noauto_da_alloc", 15); *(uint8_t*)0x20000713 = 0x2c; memcpy((void*)0x20000714, "resgid", 6); *(uint8_t*)0x2000071a = 0x3d; sprintf((char*)0x2000071b, "0x%016llx", (long long)0); *(uint8_t*)0x2000072d = 0x32; *(uint8_t*)0x2000072e = 0; memcpy( (void*)0x20000a40, "\x78\x9c\xec\xdd\xdd\x6b\x5b\xe7\x19\x00\xf0\xe7\x1c\x5b\x59\x3e\x9c\xd9" "\x61\xbb\xc8\x02\xcb\xc2\x92\x61\x87\x2d\x92\x1d\x2f\x89\x19\x2c\xdb\x60" "\x6c\x57\x81\x6d\xd9\xc5\xee\x32\xcf\x96\x8d\xb1\x6c\x19\x4b\x4e\x62\x13" "\x36\x87\xfd\x01\x83\x11\xb6\xc1\xae\x7a\xd5\x9b\x42\xff\x80\x42\xc9\x5d" "\x6f\x4b\x4b\xa0\xbd\x2f\x6d\x69\x29\x6d\xd2\x5e\xf4\xa2\x8d\x8a\xbe\x52" "\xc7\x91\xfc\x41\x64\x2b\x58\xbf\x1f\x1c\xeb\x3d\x1f\xf2\xf3\xbc\x12\x7a" "\x75\xde\xf7\xbc\xe8\x04\xd0\xb3\xce\x44\xc4\xc5\x88\x78\x5c\xa9\x54\xce" "\x47\xc4\x60\x63\x7b\xda\x58\xee\x1f\x8b\x88\xf5\xfa\x71\x8f\x1e\xde\x99" "\xaa\x2e\x49\x54\x2a\xd7\x3f\x4d\x22\x69\x6c\xab\x1e\x3f\xb2\xe1\x7f\x36" "\x9e\x52\xf3\xa7\xdf\x47\xfc\x2d\x79\x36\x6e\x69\x75\x6d\x7e\xb2\x50\xc8" "\x2f\x37\xd6\x73\xe5\x85\xa5\x5c\x69\x75\xed\xc2\xdc\xc2\xe4\x6c\x7e\x36" "\xbf\x38\x3e\x3e\x76\x79\xe2\xca\xc4\xa5\x89\xd1\x8e\xd4\x73\x20\x22\xae" "\xfe\xf6\xc3\xff\xfc\xeb\xe5\xdf\x5d\x7d\xfd\x67\xb7\xde\xbb\xf1\xf1\xc8" "\xdf\xab\x69\xfd\xb2\xb1\xbf\x59\x8f\x4e\xab\x57\x3d\x13\x87\x37\x6c\xeb" "\x8f\x88\xe5\xbd\x08\xd6\x05\x7d\x8d\xfa\x64\xba\x9d\x08\x00\x00\x3b\xd2" "\x3c\xcf\xff\x71\x44\x9c\x8f\xc1\xe8\xab\x9d\xcd\x01\x00\x00\x00\x07\x49" "\xe5\x57\x03\xf1\x55\x12\x51\x01\x00\x00\x00\x0e\xac\xb4\x36\x37\x36\x49" "\xb3\x8d\x79\x00\x03\x91\xa6\xd9\x6c\x7d\x0e\xef\xf7\xe3\x68\x5a\x28\x96" "\xca\x3f\x9d\x29\xae\x2c\x4e\xd7\xe7\xd0\x0e\x45\x26\x9d\x99\x2b\xe4\x47" "\x1b\x73\x85\x87\x22\x93\x54\xd7\xc7\x6a\xe5\x6f\xd7\x2f\x6e\x5a\x1f\x8f" "\x88\x13\x11\x71\x6f\xf0\x48\x6d\x3d\x3b\x55\x2c\x4c\x77\x7b\xf0\x03\x00" "\x00\x00\x7a\xc4\xb1\x4d\xfd\xff\x2f\x06\xeb\xfd\x7f\x00\x00\x00\xe0\x80" "\x19\xea\x76\x02\x00\x00\x00\xc0\x9e\xd3\xff\x07\x00\x00\x80\x83\xaf\x45" "\xff\xff\x2f\xdd\xc8\x03\x00\x00\x00\xd8\x13\x7f\xb8\x76\xad\xba\x54\x9a" "\xf7\xbf\x9e\xbe\xb9\xba\x32\x5f\xbc\x79\x61\x3a\x5f\x9a\xcf\x2e\xac\x4c" "\x65\xa7\x8a\xcb\x4b\xd9\xd9\x62\x71\xb6\xf6\x9b\x7d\x0b\xdb\xfd\xbf\x42" "\xb1\xb8\xf4\xf3\x58\x5c\xb9\x9d\x2b\xe7\x4b\xe5\x5c\x69\x75\xed\xc6\x42" "\x71\x65\xb1\x7c\x63\xee\xa9\x5b\x60\x03\x00\x00\x00\xfb\xe8\xc4\x8f\xee" "\xbf\x9b\x44\xc4\xfa\x2f\x8e\xd4\x96\xaa\x43\xdd\x4e\x0a\xd8\x17\xfd\xbb" "\x39\xf8\x83\xbd\xcb\x03\xd8\x7f\x7d\xdd\x4e\x00\xe8\x9a\x5d\x7d\xff\x03" "\x07\x4a\xa6\xdb\x09\x00\x5d\x97\x6c\xb3\xbf\xed\xe4\x9d\x37\x3b\x9f\x0b" "\x00\x00\xb0\x37\x86\x7f\xd0\xfa\xfa\x7f\xb2\xed\xd8\xc0\x7a\xba\x4f\x29" "\x02\x7b\xc4\xf8\x1f\xf4\x2e\xd7\xff\xa1\x77\xb9\xfe\x0f\xbd\x2b\x13\x7d" "\xa1\x23\x0f\xbd\x6d\xef\xaf\xff\x57\x2a\xbb\x4a\x08\x00\x00\xe8\xb8\x81" "\xda\x92\xa4\xd9\x88\xda\x38\xc0\x40\xa4\x69\x36\x1b\x71\xbc\x76\x5b\x80" "\x4c\x32\x33\x57\xc8\x8f\x46\xc4\x77\x23\xe2\x9d\xc1\xcc\x77\xaa\xeb\x63" "\xb5\x67\x26\xdb\xf6\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x80\xba\x4a\x25\x89\x0a\x00\x00\x00\x70\xa0" "\x45\xa4\x1f\x25\x8d\xfb\x7f\x0d\x0f\x9e\x1b\xd8\x3c\x3e\x70\x28\xf9\x72" "\xb0\xf6\x18\x11\xb7\xfe\x7f\xfd\xbf\xb7\x27\xcb\xe5\xe5\xb1\xea\xf6\xcf" "\x9e\x6c\x2f\xff\xaf\xb1\xfd\x62\x37\x46\x30\x00\x00\x00\x80\xcd\x9a\xfd" "\xf4\x66\x3f\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x3a\xe9\xd1\xc3\x3b\x53\xcd\x65\x3f\xe3\x7e\xf2\x9b" "\x88\x18\x6a\x15\xbf\x3f\x0e\xd7\x1e\x0f\x47\x26\x22\x8e\x7e\x9e\x44\xff" "\x86\xe7\x25\x11\xd1\xd7\x81\xf8\xeb\x77\x23\xe2\x64\xab\xf8\x49\x35\xad" "\x18\x6a\x64\xd1\x2a\xfe\x91\x2e\xc6\x4f\x23\xe2\x58\x07\xe2\x43\x2f\xbb" "\x5f\x6d\x7f\x7e\xdd\xea\xf3\x97\xc6\x99\xda\x63\xeb\xcf\xdf\xe5\x5a\x0b" "\xf5\xfc\xda\xb7\x7f\xe9\x93\xf6\xaf\xaf\x4d\xfb\x73\x7c\x87\x31\x4e\x3d" "\x78\x35\xd7\x36\xfe\xdd\x88\x53\xfd\xad\xdb\x9f\x66\xfc\xa4\x4d\xfc\xb3" "\x3b\x8c\xff\xd7\x3f\xaf\xad\xb5\xdb\x57\x79\x29\x62\xb8\xe5\xf7\x4f\xf2" "\x54\xac\x5c\x79\x61\x29\x57\x5a\x5d\xbb\x30\xb7\x30\x39\x9b\x9f\xcd\x2f" "\x8e\x8f\x8f\x5d\x9e\xb8\x32\x71\x69\x62\x34\x37\x33\x57\xc8\x37\xfe\xb6" "\x88\x70\x28\xfe\xfd\xc3\xd7\x1e\x6f\x55\xff\xa3\x71\xaf\x6d\xfb\xbb\x55" "\xfd\xcf\xed\xb0\xfe\x5f\x3f\xb8\xfd\xf0\x7b\xf5\x62\xa6\x55\xfc\x91\xb3" "\xad\xdf\xff\x93\x6d\xe2\xa7\x8d\xef\xbe\x9f\x34\xca\xd5\xfd\xc3\xcd\xf2" "\x7a\xbd\xbc\xd1\xe9\x57\xde\x3a\x1d\xf1\xf6\x1b\xed\xea\x3f\xdd\xe6\xf5" "\xdf\xee\xfd\x1f\xd9\x61\xfd\xcf\xff\xf1\x9f\xef\xef\xf0\x50\x00\x60\x1f" "\x94\x56\xd7\xe6\x27\x0b\x85\xfc\x72\x4f\x17\x9e\xeb\xd5\xa8\x9e\x16\xbd" "\x10\xb5\x50\xd8\x6d\xe1\x1f\x2f\x46\x1a\x2f\x64\xa1\xbb\xed\x12\x00\x00" "\xd0\x79\xcf\xf6\x81\x9f\xd6\x89\x6b\xec\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\xc0\xd6\xf6\xf3\xd7\xf5\x9a\xd6\xbb\x53\x55" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x80\x2d\x7d\x13\x00\x00\xff\xff\x94\xec\xd7\xa3", 1240); syz_mount_image( /*fs=*/0x20000000, /*dir=*/0x20000500, /*flags=MS_POSIXACL|MS_REC|MS_SYNCHRONOUS|MS_SILENT|MS_NOSUID|0x904*/ 0x1c916, /*opts=*/0x20000680, /*chdir=*/0x9b, /*size=*/0x4d8, /*img=*/0x20000a40); memcpy((void*)0x20000080, "./file0\000", 8); memcpy((void*)0x20000040, "./file0\000", 8); memcpy((void*)0x20000180, "incremental-fs\000", 15); syscall(__NR_mount, /*src=*/0x20000080ul, /*dst=*/0x20000040ul, /*type=*/0x20000180ul, /*flags=*/0ul, /*opts=*/0ul); memset((void*)0x20000640, 0, 1); res = syscall( __NR_open_tree, /*dfd=*/0xffffff9c, /*filename=*/0x20000640ul, /*flags=OPEN_TREE_CLOEXEC|OPEN_TREE_CLONE|AT_SYMLINK_NOFOLLOW|AT_RECURSIVE|AT_NO_AUTOMOUNT|AT_EMPTY_PATH*/ 0x89901ul); if (res != -1) r[0] = res; memcpy((void*)0x200003c0, "./file1\000", 8); syscall(__NR_move_mount, /*from_dfd=*/r[0], /*from_pathname=*/0x200003c0ul, /*to_dfd=*/0xffffff9c, /*to_pathname=*/0ul, /*flags=MOVE_MOUNT_T_EMPTY_PATH|MOVE_MOUNT_T_AUTOMOUNTS*/ 0x60ul); } 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; }