// https://syzkaller.appspot.com/bug?id=235c340d15618abbde31cd7bed00c7e4009d04d7 // 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; } #define MAX_FDS 30 //% 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, 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 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, loopfd = -1, 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) { memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; 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) { if (strstr(opts, "errors=panic") || strstr(opts, "errors=remount-ro") == 0) 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) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } errno = err; return res; } static void setup_common() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void setup_binderfs() { if (mkdir("/dev/binderfs", 0777)) { } if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) { } if (symlink("/dev/binderfs", "./binderfs")) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setsid(); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = (200 << 20); setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 136 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 128 << 20; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); if (unshare(CLONE_NEWNS)) { } if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } typedef struct { const char* name; const char* value; } sysctl_t; static const sysctl_t sysctls[] = { {"/proc/sys/kernel/shmmax", "16777216"}, {"/proc/sys/kernel/shmall", "536870912"}, {"/proc/sys/kernel/shmmni", "1024"}, {"/proc/sys/kernel/msgmax", "8192"}, {"/proc/sys/kernel/msgmni", "1024"}, {"/proc/sys/kernel/msgmnb", "1024"}, {"/proc/sys/kernel/sem", "1024 1048576 500 1024"}, }; unsigned i; for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++) write_file(sysctls[i].name, sysctls[i].value); } static int wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, __WALL) != pid) { } return WEXITSTATUS(status); } static void drop_caps(void) { struct __user_cap_header_struct cap_hdr = {}; struct __user_cap_data_struct cap_data[2] = {}; cap_hdr.version = _LINUX_CAPABILITY_VERSION_3; cap_hdr.pid = getpid(); if (syscall(SYS_capget, &cap_hdr, &cap_data)) exit(1); const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE); cap_data[0].effective &= ~drop; cap_data[0].permitted &= ~drop; cap_data[0].inheritable &= ~drop; if (syscall(SYS_capset, &cap_hdr, &cap_data)) exit(1); } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid != 0) return wait_for_loop(pid); setup_common(); sandbox_common(); drop_caps(); if (unshare(CLONE_NEWNET)) { } write_file("/proc/sys/net/ipv4/ping_group_range", "0 65535"); setup_binderfs(); loop(); exit(1); } static void close_fds() { for (int fd = 3; fd < MAX_FDS; fd++) close(fd); } static void setup_usb() { if (chmod("/dev/raw-gadget", 0666)) exit(1); } static void setup_sysctl() { char mypid[32]; snprintf(mypid, sizeof(mypid), "%d", getpid()); struct { const char* name; const char* data; } files[] = { {"/sys/kernel/debug/x86/nmi_longest_ns", "10000000000"}, {"/proc/sys/kernel/hung_task_check_interval_secs", "20"}, {"/proc/sys/net/core/bpf_jit_kallsyms", "1"}, {"/proc/sys/net/core/bpf_jit_harden", "0"}, {"/proc/sys/kernel/kptr_restrict", "0"}, {"/proc/sys/kernel/softlockup_all_cpu_backtrace", "1"}, {"/proc/sys/fs/mount-max", "100"}, {"/proc/sys/vm/oom_dump_tasks", "0"}, {"/proc/sys/debug/exception-trace", "0"}, {"/proc/sys/kernel/printk", "7 4 1 3"}, {"/proc/sys/kernel/keys/gc_delay", "1"}, {"/proc/sys/vm/oom_kill_allocating_task", "1"}, {"/proc/sys/kernel/ctrl-alt-del", "0"}, {"/proc/sys/kernel/cad_pid", mypid}, }; for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); i++) { if (!write_file(files[i].name, files[i].data)) printf("write to %s failed: %s\n", files[i].name, strerror(errno)); } } uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void loop(void) { intptr_t res = 0; memcpy((void*)0x20000c00, "udf\000", 4); memcpy((void*)0x20000c40, "./file0\000", 8); memcpy( (void*)0x20002000, "\x78\x9c\xec\xdd\x41\x6c\x1c\xd7\x79\x07\xf0\xef\x0d\x49\x91\x92\x8b\x64" "\xeb\x58\xb2\x93\x1a\xc1\xda\x05\x1c\x55\x69\x54\x52\x8a\x2d\x1b\x0c\x50" "\xab\x66\x89\xa6\x51\x6c\xd6\x14\x93\xb6\xee\xc1\x2b\x71\xa5\x6e\x45\x2d" "\x17\x24\xe5\xc8\x46\x9b\xb8\x27\x1f\x5a\xa0\x6c\x0a\xf4\xd2\x14\x28\x50" "\xa4\x30\x7a\x08\xd8\x43\x0e\xed\x29\x05\x0a\xf4\x4a\x14\xb9\x15\x05\xd4" "\x34\x75\x5d\x14\x05\xf6\x10\xc3\x97\xc2\x2c\x66\xf6\x2d\xb9\x92\x68\x8b" "\x11\x45\x51\x92\x7f\x3f\x40\xfa\x0f\x67\xbf\xb7\x3b\xf3\xde\x7a\x66\xb8" "\x6f\xc7\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\xe2" "\x57\x7e\xf5\xf4\xf8\x44\xda\xef\xad\x00\x00\xee\xa6\x17\x67\x5f\x1e\x3f" "\xe1\xfc\x0f\x00\x1f\x2b\x67\xfd\xfe\x0f\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xf7\xba\x14\x45\xbc\x1b\x29\xbe\xf1\x78\x37\xbd\x5a\xfd\xdc" "\x33\x76\xa6\xd5\xbe\x72\x75\x6e\x6a\x7a\xfb\x66\x07\x53\xd5\x72\xa8\xaa" "\x2f\xff\x8c\x4d\x9c\x38\xf9\xc5\xa7\x9f\x39\xf5\x6c\x3f\x3f\xba\xfd\x9d" "\xf6\xe9\x78\x69\xf6\xec\xe9\xfa\x0b\x8b\x97\x3b\x4b\xcd\xe5\xe5\xe6\x7c" "\x7d\xae\xdd\x3a\xbf\x38\xdf\xdc\xf1\x33\xec\xb6\xfd\x8d\x8e\x55\x1d\x50" "\xbf\x7c\xe9\xca\xfc\x85\x0b\xcb\xf5\x13\xc7\x4f\x5e\xf7\xf0\xd5\xda\x3b" "\xa3\x0f\x1d\xa9\x4d\x9e\x9a\x78\xe5\x70\xbf\x76\x6e\x6a\x7a\x7a\x76\xa0" "\x66\x78\xe4\xb6\x5f\xfd\x26\x1f\x76\x87\xc7\x81\x28\xe2\x42\xa4\xb8\xf4" "\xf6\xbb\xa9\x11\x11\x45\xec\xbe\x2f\x6e\xf1\xde\xd9\x6b\x07\xab\x9d\x38" "\x56\xed\xc4\xdc\xd4\x74\xb5\x23\x0b\xad\x46\x7b\xa5\x7c\x70\xa6\xdf\x11" "\x45\x44\x6d\xa0\xd1\xf3\xfd\x3e\xba\x0b\x63\xb1\x2b\xf5\x88\x37\xcb\xcd" "\x2f\x37\xf8\x58\xb9\x7b\xb3\x9d\xc6\x52\xe3\xdc\x42\xb3\x3e\xd3\x58\x5a" "\x69\xad\xb4\x16\xdb\x33\xa9\xb7\xb5\xa9\x2a\x2f\xe2\xd9\x14\xd1\x89\x88" "\xee\xe8\xcd\x4f\x37\x12\x45\x7c\x33\x52\xbc\xf5\x9d\x6e\x3a\x17\x11\x43" "\xfd\x7e\xf8\x7c\x75\x63\xf0\xad\xb7\xa7\xd8\x83\x7d\xdc\x81\xe1\x88\xa8" "\x8d\x44\xac\x17\xf7\xc1\x98\xdd\xc3\x46\xa3\x88\xef\x45\x8a\x6f\x7f\x6b" "\x3c\xce\xe7\x7e\xad\xba\xed\xa9\x88\xaf\x96\x79\x24\xe2\x4a\x99\xd7\x22" "\x56\xcb\xfc\x6c\x44\x2a\xdf\x20\x8f\x44\xbc\xb7\xcd\xfb\x89\xfb\xcb\x70" "\x14\xf1\x47\x91\xe2\x27\x93\xdd\x34\xdf\x1f\xfb\xea\xb8\x72\xe6\x6b\xf5" "\x2f\xb7\x2f\x2c\x0e\xd4\xf6\x8f\x2b\xf7\xfd\xf9\xe1\x6e\xba\xc7\x8f\x4d" "\x63\x51\x44\xa3\x3a\xe2\x77\xd3\xed\x5f\xec\x00\x00\x00\x00\x00\x70\xef" "\x29\xe2\x4f\x23\xc5\x13\x3f\x3c\x9a\x3a\x31\x38\xa7\xd8\x6a\x5f\xac\x9f" "\x6d\x9c\x5b\xe8\x7d\x2a\xdc\xff\xec\xbf\x9e\x5b\x6d\x6c\x6c\x6c\xd4\x52" "\x2f\xc7\x73\xce\xe4\xec\xe4\x5c\xcd\xb9\x96\x73\x3d\x67\x37\x67\xad\xc8" "\xed\x73\xce\xe4\xec\xe4\x5c\xcd\xb9\x96\x73\x3d\x67\x37\x67\x6d\x28\xb7" "\xcf\x39\x93\xb3\x93\x73\x35\xe7\x5a\xce\xf5\x9c\xdd\x9c\xb5\xe1\xdc\x3e" "\xe7\x4c\xce\x4e\xce\xd5\x9c\x6b\x39\xd7\x73\x76\x87\xf7\x71\xb8\x00\x00" "\x00\x00\x00\x00\x00\x60\x1b\x07\xa3\x88\xaf\x47\x8a\xa7\x7e\xe9\xb5\xea" "\xbe\xe2\xa8\xee\x4b\xff\xe4\xe4\xa9\x97\x8f\xff\xfa\xe0\x3d\xe3\x8f\xdd" "\xe2\x79\xca\xda\xe3\x11\xb1\x56\xec\xec\x9e\xdc\x03\xf9\xd6\xe1\x99\x34" "\x93\xd2\x3e\xdd\x43\x4c\xef\xfe\xbf\x3f\xc8\xf7\xff\xfd\xe1\x7e\x6f\x0c" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xb0\xaf\x8a\x28\xe2\xc9\x48\xf1\xda\xf7" "\xbb\x29\x52\x44\xd4\x23\x5e\x8d\x5e\x5e\x1b\xdd\xef\xad\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xee\x84\xb1\x54\xc4\x7b\x91\xe2\xcf\xbf" "\x32\x56\xfd\xbc\x5e\x44\xfc\x76\x44\x7c\xb0\xf1\xc1\x46\x44\x5c\xfb\x60" "\xe3\x4e\xdb\xef\x3d\x06\x00\x00\x00\x00\x00\x00\x80\x07\x50\x2a\xe2\xf5" "\x48\xf1\xe4\xcb\xdd\x54\x8b\x88\xab\xb5\x77\x46\x1f\x3a\x52\x9b\x3c\x35" "\xf1\xca\xe1\xa1\x18\x8a\x54\x96\x0c\xd6\xbf\x34\x7b\xf6\x74\xfd\x85\xc5" "\xcb\x9d\xa5\xe6\xf2\x72\x73\xbe\x3e\xd7\x6e\x9d\x5f\x9c\x6f\xee\xf4\xe5" "\xc6\xce\xb4\xda\x57\xae\xce\x4d\x4d\xef\xc9\xce\xdc\xd2\xc1\x3d\xde\xfe" "\x83\x63\x2f\x2c\x76\x5e\x5f\x6a\x5d\xfc\xdd\x95\x6d\x1f\x3f\x34\x76\xfa" "\xdc\xf2\xca\x52\xe3\xfc\xf6\x0f\xc7\xc1\x28\x22\xea\x83\x6b\x8e\x55\x1b" "\x3c\x37\x35\x5d\x6d\xf4\x42\xab\xd1\xae\x9a\xce\xa4\x9d\x6e\x31\x00\x00" "\x00\x00\x00\x00\x00\x1f\x07\x23\xa9\x88\x0f\x22\xc5\x5b\x7f\xf3\xf6\xe6" "\xbc\xf3\x70\x6f\xce\x7f\xf8\xc6\xda\xef\x7e\x29\xa2\xc8\xcb\x53\x79\xfe" "\x79\x73\x1a\xba\xfa\xde\xc0\x27\xaa\xef\x0d\xf4\x96\x3f\x39\x79\xea\x37" "\x4e\x7c\x66\x70\x79\xdb\x29\xeb\x63\xd5\x84\x7a\x7d\x6e\x6a\x7a\x7a\x76" "\x60\xf5\xf0\xc8\xcd\xa5\x63\xf9\x75\xc7\x77\xb7\xcb\x0c\x28\xc7\x7f\x25" "\x52\xfc\xf1\x5f\xd6\xd3\x13\x79\xdd\xf5\xe3\x3f\xb4\x59\xfb\xdd\xdf\xdf" "\x1a\xef\x37\x6f\x7c\xa2\x0f\x19\xf3\xdd\x8e\xff\xcf\x0e\xac\x2b\x5f\x33" "\xa5\x22\xfe\x2e\x52\xfc\xdc\x6f\x3e\x16\x4f\x54\xdb\x79\x28\x6e\xfa\xce" "\x44\xae\xfb\x4a\xa4\xf8\xad\xb5\xc7\x73\x5d\x1c\x28\xeb\x9e\xcc\x8f\x3f" "\x5c\xfd\x3d\x76\xa1\xb5\xd0\x1c\x2f\x6b\xaf\x46\x8a\x7f\xbc\x72\x7d\xed" "\x53\xb9\xf6\x53\x5b\xb5\x13\x3b\xee\xd8\xfb\x44\x39\xfe\x4f\x46\x8a\xff" "\xf9\x9d\xb5\xcd\xbe\xc9\xe3\x9f\x47\x60\x6b\xd4\x06\xc7\xff\x33\x37\xbe" "\x3b\xf6\x68\xfc\x1f\x1e\x58\x57\xcb\xaf\xfb\xf3\x77\x66\xd7\x89\x88\xe5" "\xd7\xdf\xb8\xd4\x58\x58\x68\x2e\x59\xb0\x60\xc1\xc2\xe6\xc2\x7e\x1f\x99" "\xb8\x1b\xca\xf3\xff\xd7\x23\xc5\x3f\xfc\xd9\xbf\x6e\x5e\xef\xe4\xf3\xff" "\xcf\xf4\x7e\xda\xba\xfe\x7b\xff\x9b\x5b\xe7\xff\xc9\x1b\x9f\x68\x8f\xce" "\xff\x9f\x1a\x58\x37\x99\xaf\x46\x46\x86\x23\xc6\x56\x2e\x77\x46\x1e\x8d" "\x18\x5b\x7e\xfd\x8d\x2f\xb4\x2e\x37\x2e\x36\x2f\x36\xdb\x27\x4f\x3d\xf7" "\xcc\x89\xf1\xe7\x26\xc6\x4f\x8e\x1c\xe8\x5f\xdc\x6d\x2d\xed\xba\xaf\x1e" "\x44\xe5\xf8\xff\x5e\xa4\xf8\xde\x8f\xfe\x36\x3e\x97\xd7\x5d\x7f\xfd\xb7" "\xfd\xf5\xff\xa1\x1b\x9f\x68\x8f\xc6\xff\x91\x81\x75\x87\xae\xbb\x5e\xd9" "\xf5\xae\x93\xc7\xff\xff\x22\xc5\x3f\x4f\xfd\x20\x8e\xe6\x75\x1f\x75\xfd" "\xdf\xff\xfd\xff\x68\xbe\x08\xdf\xbc\x3e\xdf\xa3\xf1\x3f\x3c\xb0\xae\xfa" "\x1d\xef\x13\x11\xbf\x30\xb0\xee\xe8\xe1\x88\x07\xee\x97\x32\x00\x00\x00" "\xb8\xc3\x52\x2a\xe2\x07\x79\x3e\x75\xfc\x16\xf3\xa9\xff\x14\x29\xde\xf8" "\xef\x5f\xcc\x75\xe9\x48\x59\xf7\x7c\x7e\xbc\x56\xfd\x3d\xf6\xe2\x62\xfb" "\x0b\xa7\x17\x16\x16\xcf\x37\x56\x1a\xe7\x16\x9a\xf5\xd9\x4e\xe3\x7c\xb3" "\x6c\xfb\xe3\x48\xd1\xfd\xeb\xc7\x73\xdb\xa2\x9a\x5f\xed\xcf\x37\xf7\xe6" "\x78\xb7\xe6\x62\xff\x25\x52\x3c\xf7\x6b\xfd\xda\xde\x5c\x6c\xff\xb3\xa9" "\x47\xb6\x6a\x27\xca\xda\xe3\x91\xe2\x4f\x5e\xbc\xbe\xb6\xff\x39\xc6\xe1" "\xad\xda\x13\x65\xed\xbf\x45\x8a\x89\x57\xb6\xaf\x3d\xb2\x55\x7b\xb2\xac" "\xfd\xaf\x48\xf1\xfe\x5f\xd4\xfb\xb5\x87\xca\xda\x2f\xe5\xda\x47\xb7\x6a" "\x8f\x9f\x5f\x5c\x98\xdf\x51\x47\x0f\xfd\xd4\x43\x03\x00\x00\x00\x00\x00" "\xb7\x6d\x24\x15\xf1\x4c\xa4\xf8\xfb\x93\xc3\xa9\xff\xf9\xf6\x4e\xbe\xff" "\x79\xd3\x87\xde\x7b\xf4\xfd\xbf\x47\x07\xd6\xcd\xdf\xa5\xfb\x55\x76\xdd" "\xa9\x00\x70\x8f\x2b\xcf\xff\x47\xcb\xb3\xfa\x2f\xff\xd5\xe6\x5c\xfe\xf5" "\xe7\xff\xad\xff\x0f\xc0\xe0\xf9\xff\x46\x83\xff\x6e\xc0\x87\x2d\xdf\xce" "\xf9\xbf\x76\x67\x76\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xe0\x63\x27\x45\x11\x8b\x91\xe2\x1b\x8f\x77\xd3" "\xb5\xd1\xf2\xe7\x9e\xb1\x33\xad\xf6\x95\xab\x73\x53\xd3\xdb\x37\x3b\x98" "\xaa\x96\x43\x55\x7d\xf9\x67\x6c\xe2\xc4\xc9\x2f\x3e\xfd\xcc\xa9\x67\xfb" "\xf9\xd1\xed\xef\xb4\x4f\xc7\x4b\xb3\x67\x4f\xd7\x5f\x58\xbc\xdc\x59\x6a" "\x2e\x2f\x37\xe7\xeb\x73\xed\xd6\xf9\xc5\xf9\xe6\x8e\x9f\x61\xb7\xed\x6f" "\x74\xac\xea\x80\xfa\xe5\x4b\x57\xe6\x2f\x5c\x58\xae\x9f\x38\x7e\xf2\xba" "\x87\xaf\xd6\xde\x19\x7d\xe8\x48\x6d\xf2\xd4\xc4\x2b\x87\xfb\xb5\x73\x53" "\xd3\xd3\xb3\x03\x35\xc3\x23\xb7\xfd\xea\x37\x49\x1f\xb2\xfe\x40\x14\xf1" "\xbf\x91\xe2\xd2\xdb\xef\xa6\x7f\x1f\x8d\x28\x62\xf7\x7d\x71\x8b\xf7\xce" "\x5e\x3b\x58\xed\xc4\xb1\x6a\x27\xe6\xa6\xa6\xab\x1d\x59\x68\x35\xda\x2b" "\xe5\x83\x33\xfd\x8e\x28\x22\x6a\x03\x8d\x9e\xef\xf7\xd1\x5d\x18\x8b\x5d" "\xa9\x47\xbc\x59\x6e\x7e\xb9\xc1\xc7\xca\xdd\x9b\xed\x34\x96\x1a\xe7\x16" "\x9a\xf5\x99\xc6\xd2\x4a\x6b\xa5\xb5\xd8\x9e\x49\xbd\xad\x4d\x55\x79\x11" "\xcf\xa6\x88\x4e\x44\x74\x47\x6f\x7e\xba\x91\x28\x62\x24\x52\xbc\xf5\x9d" "\x6e\xfa\xd1\x68\xc4\x50\xbf\x1f\x3e\xff\xe2\xec\xcb\xe3\x27\x6e\xbd\x3d" "\xc5\x1e\xec\xe3\x0e\x0c\x47\x44\x6d\x24\x62\xbd\xb8\x0f\xc6\xec\x1e\x36" "\x1a\x45\x3c\x1d\x29\xbe\xfd\xad\xf1\xf8\x8f\xd1\x5e\xbf\x56\xdd\xf6\x54" "\xc4\x57\xcb\x3c\x12\x71\xa5\xcc\x6b\x11\xab\x65\x7e\x36\x22\x95\x6f\x90" "\x47\x22\xde\xdb\xe6\xfd\xc4\xfd\x65\x38\x8a\x78\x38\x52\xfc\x64\xb2\x9b" "\x7e\x3c\x9a\xc7\xbe\x3a\xae\x9c\xf9\x5a\xfd\xcb\xed\x0b\x8b\x03\xb5\xfd" "\xe3\xca\x7d\x7f\x7e\xb8\x9b\xee\xf1\x63\xd3\x58\x14\xf1\x6e\x75\xc4\xef" "\xa6\xff\xf4\xdf\x33\x00\x00\x00\x00\xc0\x03\xa4\x88\xc7\x22\xc5\x13\x3f" "\x3c\x9a\xaa\xf9\xc1\xcd\x39\xc5\x56\xfb\x62\xfd\x6c\xe3\xdc\x42\xef\x63" "\xfd\xfe\x67\xff\xf5\xdc\x6a\x63\x63\x63\xa3\x96\x7a\x39\x9e\x73\x26\x67" "\x27\xe7\x6a\xce\xb5\x32\xf3\x17\x05\xca\x9f\xbb\x39\x6b\x45\x6e\x9f\x73" "\x26\x67\x27\xe7\x6a\xce\xb5\x9c\xeb\x39\xbb\x39\x6b\x43\xb9\x7d\xce\x99" "\x9c\x9d\x9c\xab\x39\xd7\x72\xae\xe7\xec\xe6\xac\x0d\xe7\xf6\x39\x67\x72" "\x76\x72\xae\xe6\x5c\xcb\xb9\x9e\xb3\x3b\xbc\x9f\xe3\x05\x00\x00\x00\x00" "\x00\x00\xb0\xbd\x22\x8a\xf8\x5c\xa4\x78\xed\xfb\xdd\xb4\x31\xda\x9b\xe0" "\x7d\x35\x7a\x79\xcd\xfd\x40\x0f\xbc\xff\x0f\x00\x00\xff\xff\xe0\xab\x57" "\xb1", 3061); syz_mount_image(0x20000c00, 0x20000c40, 0x2000050, 0x20004300, 1, 0xbf5, 0x20002000); memcpy((void*)0x200000c0, "./bus\000", 6); syscall(__NR_open, 0x200000c0ul, 0x14da42ul, 0ul); memcpy((void*)0x20000380, "/dev/loop", 9); *(uint8_t*)0x20000389 = 0x30; *(uint8_t*)0x2000038a = 0; memcpy((void*)0x200003c0, "./bus\000", 6); syscall(__NR_mount, 0x20000380ul, 0x200003c0ul, 0ul, 0x1000ul, 0ul); memcpy((void*)0x200000c0, "./bus\000", 6); res = syscall(__NR_open, 0x200000c0ul, 0x14da42ul, 0ul); if (res != -1) r[0] = res; memcpy((void*)0x20000040, "/proc/self/exe\000", 15); res = syscall(__NR_openat, -1, 0x20000040ul, 0ul, 0ul); if (res != -1) r[1] = res; syscall(__NR_sendfile, r[0], r[1], 0ul, 0x80001d00c0d0ul); close_fds(); } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); setup_sysctl(); setup_usb(); do_sandbox_none(); return 0; }