// 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"); } else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) { strcat(opts, ",errors=withdraw"); } 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); } void loop(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$hfsplus arguments: [ // fs: ptr[in, buffer] { // buffer: {68 66 73 70 6c 75 73 00} (length 0x8) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: mount_flags = 0x4 (8 bytes) // opts: ptr[in, fs_options[hfsplus_options]] { // fs_options[hfsplus_options] { // elems: array[fs_opt_elem[hfsplus_options]] { // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // uid: fs_opt["uid", fmt[hex, uid]] { // name: buffer: {75 69 64} (length 0x3) // eq: const = 0x3d (1 bytes) // val: uid (resource) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // nodecompose: buffer: {6e 6f 64 65 63 6f 6d 70 6f 73 65} // (length 0xb) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // umask: fs_opt["umask", fmt[oct, int32]] { // name: buffer: {75 6d 61 73 6b} (length 0x5) // eq: const = 0x3d (1 bytes) // val: int32 = 0x1 (23 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // decompose: buffer: {64 65 63 6f 6d 70 6f 73 65} (length 0x9) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // gid: fs_opt["gid", fmt[hex, gid]] { // name: buffer: {67 69 64} (length 0x3) // eq: const = 0x3d (1 bytes) // val: gid (resource) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // nodecompose: buffer: {6e 6f 64 65 63 6f 6d 70 6f 73 65} // (length 0xb) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // gid: fs_opt["gid", fmt[hex, gid]] { // name: buffer: {67 69 64} (length 0x3) // eq: const = 0x3d (1 bytes) // val: gid (resource) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // nls: fs_opt["nls", stringnoz[codepages_names]] { // name: buffer: {6e 6c 73} (length 0x3) // eq: const = 0x3d (1 bytes) // val: buffer: {63 70 31 32 35 31} (length 0x6) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // type: fs_opt["type", array[int8, 4]] { // name: buffer: {74 79 70 65} (length 0x4) // eq: const = 0x3d (1 bytes) // val: buffer: {58 87 f4 52} (length 0x4) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // nobarrier: buffer: {6e 6f 62 61 72 72 69 65 72} (length 0x9) // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0xfc (1 bytes) // size: len = 0x6ea (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x6ea) // } // ] // returns fd_dir memcpy((void*)0x200000000000, "hfsplus\000", 8); memcpy((void*)0x200000000100, "./file1\000", 8); memcpy((void*)0x2000000002c0, "uid", 3); *(uint8_t*)0x2000000002c3 = 0x3d; sprintf((char*)0x2000000002c4, "0x%016llx", (long long)0); *(uint8_t*)0x2000000002d6 = 0x2c; memcpy((void*)0x2000000002d7, "nodecompose", 11); *(uint8_t*)0x2000000002e2 = 0x2c; memcpy((void*)0x2000000002e3, "umask", 5); *(uint8_t*)0x2000000002e8 = 0x3d; sprintf((char*)0x2000000002e9, "%023llo", (long long)1); *(uint8_t*)0x200000000300 = 0x2c; memcpy((void*)0x200000000301, "decompose", 9); *(uint8_t*)0x20000000030a = 0x2c; memcpy((void*)0x20000000030b, "gid", 3); *(uint8_t*)0x20000000030e = 0x3d; sprintf((char*)0x20000000030f, "0x%016llx", (long long)0xee00); *(uint8_t*)0x200000000321 = 0x2c; memcpy((void*)0x200000000322, "nodecompose", 11); *(uint8_t*)0x20000000032d = 0x2c; memcpy((void*)0x20000000032e, "gid", 3); *(uint8_t*)0x200000000331 = 0x3d; sprintf((char*)0x200000000332, "0x%016llx", (long long)0); *(uint8_t*)0x200000000344 = 0x2c; memcpy((void*)0x200000000345, "nls", 3); *(uint8_t*)0x200000000348 = 0x3d; memcpy((void*)0x200000000349, "cp1251", 6); *(uint8_t*)0x20000000034f = 0x2c; memcpy((void*)0x200000000350, "type", 4); *(uint8_t*)0x200000000354 = 0x3d; memcpy((void*)0x200000000355, "\x58\x87\xf4\x52", 4); *(uint8_t*)0x200000000359 = 0x2c; memcpy((void*)0x20000000035a, "nobarrier", 9); *(uint8_t*)0x200000000363 = 0x2c; *(uint8_t*)0x200000000364 = 0; memcpy( (void*)0x200000000f80, "\x78\x9c\xec\xdd\xcd\x6f\x1c\x67\x1d\x07\xf0\xef\xec\xae\xdf\x52\xd1\xba" "\x6d\xd2\x16\x54\x89\xa8\x11\x05\x11\x91\xf8\x45\x29\x04\x09\x25\x20\x84" "\x7c\xa8\x50\x04\x07\x24\x6e\x26\x71\x1a\x2b\x4e\x5a\xd9\x2e\xb8\x11\x02" "\xf3\x7e\xed\xa1\x7f\x40\x7b\xc8\x8d\x13\x12\xf7\xa0\x72\x86\x0b\x82\xa3" "\xc5\xa9\x12\xa2\x17\x4e\xbe\x2d\x9a\xd9\xd9\xf5\xda\xde\xf5\x4b\x9c\xc4" "\x31\x7c\x3e\xd5\xec\x3c\x33\xcf\xfb\x6f\x67\x66\x77\x36\xb5\x26\xc0\xff" "\xad\xb9\xf3\x69\x3d\x48\x91\xb9\xf3\x6f\xae\x95\xdb\x1b\xf7\x67\x97\x36" "\xee\xcf\x8e\xd5\xd9\x4b\x49\xca\x74\x23\x69\x75\x56\x29\xee\x26\xc5\xc7" "\xc9\xd5\x74\x96\x7c\xb6\xdc\x59\x97\x2f\x86\xf5\xf3\xc1\xe2\xe5\xef\xfd" "\xfd\x3f\x1b\x9f\x74\xb6\x5a\xf5\x52\x95\x6f\xec\xae\xf7\xf3\x76\x92\x2f" "\x1c\x7c\x16\xeb\xf5\x92\xb3\x49\x9a\xf5\x7a\xb7\x91\x1d\xdb\x63\xc9\xf8" "\xfe\xed\x5d\x1f\xd0\xde\xf8\xf6\x56\x7a\x06\xcf\xbf\xe8\xe5\x94\x01\x3b" "\xd7\x0d\x1c\x1c\xb7\xf6\x2e\xeb\x87\xa9\x3e\xf4\x7c\x07\x4e\x8e\x22\xdf" "\xf8\xcc\xa0\xfd\x93\xc9\xa9\xfa\xf3\xae\xfa\x9c\xab\xaf\x0e\x8d\x27\x3b" "\xba\x47\xef\x50\x57\x39\x00\x00\x00\x38\x66\x73\xff\x3e\x33\x73\x98\xf2" "\x13\xf5\xfa\xb9\xcd\x6c\x66\xed\xc4\xdf\xc6\x03\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xc0\x13\x55\x24\xcd\xce\xaa\x5a\x1a\xdd\xf4\xd9\x14\xdd\xe7\xff" "\x8f\xd6\xfb\x52\xa7\x4f\xb4\x07\xc7\x3d\x00\x00\x00\x00\x00\x00\x00\x00" "\xd8\x65\x64\xdb\xd6\x68\x92\xb1\xee\xc6\x95\xc1\x35\x3e\xbf\x99\xcd\xac" "\xe5\xd9\xee\x76\xbb\xa8\xfe\xcd\xff\xb5\x6a\xe3\x74\xf5\xfa\x4c\xde\xcd" "\x4a\x16\xb2\x9c\x0b\x59\xcb\x7c\x56\xb3\x9a\xe5\x4c\x27\x99\xec\xef\x6c" "\x6d\x7e\x75\x75\x79\x7a\x58\xcd\x62\x3d\xa9\x6b\xce\x0c\xac\x39\xb3\x7d" "\x5c\xcd\x83\x4d\x78\xfc\x60\xc5\x00\x00\x00\x00\x00\x00\x00\xe0\x7f\xde" "\x2f\x33\xb7\xf5\xef\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0" "\x34\x28\x92\x66\x67\x55\x2d\xa7\xbb\xe9\xc9\x34\x5a\x49\xc6\x93\x8c\x96" "\xe5\xd6\x93\xbf\x76\xd3\x27\x44\x31\x68\xe7\x83\x27\x3f\x0e\x00\x00\x00" "\x38\x92\xf1\x87\xa8\xf3\xdc\x66\x36\xb3\x96\x67\xbb\xdb\xed\xa2\xba\xe7" "\x7f\xa9\xba\x5f\x1e\xcf\xbb\xb9\x9b\xd5\x2c\x66\x35\x4b\x59\xc8\x8d\xfa" "\x1e\xba\xbc\xeb\x6f\x6c\xdc\x9f\x5d\xda\xb8\x3f\x7b\xa7\x5c\x8e\x3c\xf4" "\xaa\xc5\x74\x7e\x7b\x18\xdc\xf3\x2b\x55\x89\x89\xdc\xcc\x62\xb5\xe7\x42" "\xae\x57\x83\xb9\x91\x46\x55\xb3\xf4\xcf\x24\x77\xba\x63\xda\x3d\xae\x5f" "\x7c\x5a\xb6\x7d\xa5\xe3\x27\x07\x1c\xd9\x8d\x7a\x5d\x76\xf6\x7e\xf7\x57" "\x84\xb1\x23\x4f\xf8\x11\x98\x4c\x5a\x8d\x8c\xf4\x22\x32\x55\x8d\xad\x73" "\x10\x3c\xdf\x1f\x85\xdd\x91\xf8\xe6\xa7\xc3\x1a\xbd\xda\x59\xb5\x76\xf6" "\x94\xfe\x9e\xa6\xd3\xe8\xfd\xf2\x73\xba\xd3\x43\x99\xdc\x37\xe6\x57\x0e" "\x38\xb3\x53\xf5\xba\x9c\xcf\x6f\x87\xfd\x72\xf3\xa8\x8d\x6f\x75\xba\x3e" "\xb4\x50\x2f\x12\x8d\x54\x91\x98\xe9\x3b\xfa\x5e\xda\x3b\xe6\xc9\x17\xff" "\xf8\xfb\xf7\x6f\x2d\xdd\xbd\x7d\xeb\xe6\xca\xf9\x27\x32\xa5\xc7\x69\xe7" "\x31\x31\xdb\x17\x89\x97\x0f\x10\x89\x1f\x3c\xb5\x91\x68\xed\x9d\xdd\xd8" "\xb9\x63\xaa\xda\x79\xa6\xbb\xf9\xd1\x33\x49\xbe\x9f\xf3\x39\x9b\x6b\x59" "\xce\x62\x7e\x9c\xf9\xac\x66\x21\x45\x3d\xd3\xf9\xfa\x78\x2e\x5f\x27\xf7" "\x8e\xd4\xd5\x6d\x5b\xd7\x86\x0c\xa0\x67\xb4\x7e\x5f\x9a\x75\xb9\xde\x98" "\x32\x97\xef\x0c\x1c\xd3\xd9\x7c\xbb\x4a\xcd\xe7\xb5\xaa\xee\xb3\x59\x4c" "\x91\xb7\x73\x23\x0b\x79\xa3\xfa\x6f\x26\xd3\xf9\x6a\x2e\xe5\x52\x2e\xf7" "\xbd\xc3\x67\x86\x8e\xbb\x9a\x5b\x75\xd6\x37\x0e\x77\xd6\x9f\xfb\x52\x9d" "\x98\x48\xf2\xbb\x7a\x7d\xdc\x3a\x17\x85\x32\xae\xcf\xf7\xc5\xb5\xff\x9a" "\x3b\x59\xe5\x6d\xed\x19\xe9\x8b\xd2\x0b\x7b\xbf\xbb\xbb\xaf\x8d\xfb\x4f" "\xb9\xf5\xb9\x3a\x51\xf6\xf1\xab\x3d\x8f\x86\x27\x6d\x67\x24\xa6\xfb\x22" "\xf1\xe2\xde\x91\xf8\xa8\x5d\xbe\xae\x2c\xdd\xbd\xbd\x7c\x6b\xfe\x9d\x01" "\x9f\xae\xed\x62\xa4\x5a\xff\xed\x5c\xd2\x6e\x77\xf6\xbd\x5e\xe7\x95\x47" "\xdc\x6f\xf6\xff\xfa\xf3\xa7\xa3\xce\x6f\x1f\x7d\xd7\xb1\xf2\x78\x79\x21" "\xe3\xf5\x95\xe4\xf9\x8c\x74\x86\xd6\xec\xe6\xbd\xd8\xbb\xca\x54\xf1\x1a" "\xed\xaf\x77\xba\x97\xb7\xfd\x13\x77\x34\xe3\xe5\xf9\xdc\xe8\xf4\xd4\x39" "\x53\xbf\x3b\xf4\x4c\x1d\xad\xbf\xc3\xed\x6e\x69\xa6\xca\x7b\x79\x60\xde" "\x6c\x95\xf7\x4a\x5f\x5e\xff\xf7\xad\xe4\xed\x2c\xf5\xbe\x0f\x01\xf0\x14" "\x3b\xf5\xe5\x53\xa3\x13\xff\x9a\xf8\xcb\xc4\x87\x13\xbf\x9e\xb8\x35\xf1" "\xe6\xf8\xb7\xc6\xbe\x36\xf6\xea\x68\x46\xfe\x3c\xf2\xf5\xd6\x54\xf3\xf5" "\xc6\xab\xc5\x1f\xf2\x61\x7e\xb6\x75\xff\x0f\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3c\xbc" "\x95\xf7\xee\xdd\x9e\x5f\x5a\x5a\x58\x1e\x9c\x68\x34\x87\x66\x0d\x49\xa4" "\x7d\xef\xf6\x7c\xf7\x49\x3e\x07\xad\x95\x95\xa2\x7e\x92\xce\xa1\xfa\x1a" "\x9a\x68\x1c\xad\xfa\x7e\x89\xde\x23\x7f\x1e\x5f\x17\xc7\x9f\x28\x76\xed" "\x29\x67\xfc\x68\xba\xe8\x3e\xf9\xe8\x70\xb5\xa6\x76\x1f\x51\x57\x8f\x33" "\x50\xff\x38\x6c\xad\x8c\xf7\x4d\xb9\x39\xb4\xf0\xa9\x3a\xd1\x7e\xae\x13" "\xa5\x43\x75\x31\xb9\xf3\xc8\x4c\x86\x14\x1e\xeb\x04\xb3\x39\xe4\x3c\xad" "\xdf\xa2\x87\x79\xb8\x28\x70\x22\x5c\x5c\xbd\xf3\xce\xc5\x95\xf7\xee\x7d" "\x65\xf1\xce\xfc\x5b\x0b\x6f\x2d\xdc\x1d\xb9\x74\xe9\xf2\xd4\xe5\x4b\x6f" "\xcc\x5e\xbc\xb9\xb8\xb4\x30\xd5\x79\x3d\xee\x51\x02\x8f\xc3\xd6\xf7\x76" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xa4\x38\xe0\xdf\x15\x5c\xfb\xe1" "\x8f\xaa\xff\x43\xf0\xa1\xfe\x5e\xe2\xb8\xe7\x08\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\x6c\x73" "\xe7\xd3\x7a\x90\x22\xd3\x53\x17\xa6\xca\xed\x8d\xfb\xb3\x4b\xe5\xd2\x4d" "\x6f\x95\x6c\x25\x69\x34\x92\xe2\xa7\x49\xf1\x71\x72\x35\x9d\x25\x93\x7d" "\xcd\x15\xc3\xfa\xf9\x60\xf1\x72\x33\xc9\x27\x5b\x6d\xb5\xba\xe5\x1b\x7b" "\xd4\x6b\x8f\x1d\x68\x16\xeb\xf5\x92\xb3\x49\x9a\xf5\xfa\x08\xb6\xb5\x77" "\xfd\xc8\xed\x15\xbd\x19\x96\x01\x3b\xd7\x0d\x1c\x1c\xb7\xff\x06\x00\x00" "\xff\xff\xa2\x46\xe9\x45", 1770); syz_mount_image(/*fs=*/0x200000000000, /*dir=*/0x200000000100, /*flags=MS_NODEV*/ 4, /*opts=*/0x2000000002c0, /*chdir=*/0xfc, /*size=*/0x6ea, /*img=*/0x200000000f80); } 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; }