// https://syzkaller.appspot.com/bug?id=67dbafe7987e8ed784ca4d29a2465ee9ae18d2f1 // 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) { errno = EMSGSIZE; return -1; } 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); } uint64_t r[1] = {0xffffffffffffffff}; void loop(void) { intptr_t res = 0; memcpy((void*)0x20000440, "ext4\000", 5); memcpy((void*)0x20000480, "./file0\000", 8); memcpy( (void*)0x20000000, "\x6e\x6f\x75\x73\x65\x72\x5f\x78\x61\x74\x74\x72\x2c\x61\x63\x6c\x2c\x64" "\x65\x62\x75\x67\x5f\x77\x61\x6e\x74\x5f\x65\x78\x74\x72\x61\x5f\x69\x73" "\x69\x7a\x65\x3d\x30\x78\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30" "\x30\x30\x38\x30\x2c\x6c\x61\x7a\x79\x74\x69\x6d\x65\x2c\x6e\x6f\x62\x68" "\x2c\x71\x75\x6f\x74\x61\x2c\x00\x3d\x93\x09\x61\x36\x5d\x73\x58\x9c", 89); memcpy( (void*)0x200004c0, "\x78\x9c\xec\xdb\xcf\x6b\x1c\x55\x1c\x00\xf0\xef\xcc\x26\xad\xfd\x65\x62" "\xad\x3f\x9a\x56\x8d\x56\x31\xf8\x23\x69\xd2\xaa\x3d\x78\x50\x51\xf0\xa0" "\x20\xe8\xa1\x1e\x63\x92\x96\xd8\x6d\x23\x4d\x04\x5b\x82\x46\x91\x7a\x94" "\x82\x77\xf1\x28\xf8\x17\x78\xd2\x8b\xa8\x27\xc1\xab\xde\xa5\x50\x24\x97" "\x56\x4f\x2b\xb3\x3b\x93\x6c\xb6\xbb\x31\x9b\x6c\xb2\xd5\xfd\x7c\x60\xda" "\xf7\x66\xde\xf2\xde\x77\xde\xbc\xdd\x37\xf3\x32\x01\xf4\xac\xe1\xec\x9f" "\x24\x62\x7f\x44\xfc\x16\x11\x03\xb5\xec\xda\x02\xc3\xb5\xff\x6e\x2e\x2f" "\x4e\xfd\xb5\xbc\x38\x95\x44\xa5\xf2\xe6\x9f\x49\xb5\xdc\x8d\xe5\xc5\xa9" "\xa2\x68\xf1\xb9\x7d\x79\x66\x24\x8d\x48\x3f\x4d\xe2\x48\x93\x7a\xe7\x2f" "\x5d\x3e\x37\x59\x2e\xcf\x5c\xcc\xf3\x63\x0b\xe7\xdf\x1b\x9b\xbf\x74\xf9" "\xe9\xd9\xf3\x93\x67\x67\xce\xce\x5c\x98\x38\x75\xea\xe4\x89\xf1\xe7\x9e" "\x9d\x78\xa6\x23\x71\x66\x71\xdd\x18\xfa\x70\xee\xe8\xe1\x57\xdf\xbe\xfa" "\xfa\xd4\xe9\xab\xef\xfc\xf4\x4d\x52\xc4\xdf\x10\x47\x87\x0c\xaf\x77\xf0" "\xb1\x0e\x57\xd6\x6d\x07\xea\xd2\x49\x5f\x17\x1b\x42\x5b\x4a\x11\x91\x75" "\x57\x7f\x75\xfc\x0f\x44\x29\x56\x3b\x6f\x20\x5e\xf9\xa4\xab\x8d\x03\xb6" "\x55\xa5\x52\xa9\xec\x6e\x7d\x78\xa9\x02\xfc\x8f\x25\xd1\xed\x16\x00\xdd" "\x51\xfc\xd0\x67\xf7\xbf\xc5\xb6\x43\x53\x8f\xdb\xc2\xf5\x17\x6b\x37\x40" "\x59\xdc\x37\xf3\xad\x76\xa4\x2f\xd2\xbc\x4c\x7f\xc3\xfd\x6d\x27\x0d\x47" "\xc4\xe9\xa5\xbf\xbf\xcc\xb6\xd8\x9e\xe7\x10\x00\x00\x6b\x7c\x97\xcd\x7f" "\x9e\x6a\x36\xff\x4b\xe3\xde\xba\x72\x77\xe6\x6b\x28\x83\x11\x71\x57\x44" "\x1c\x8c\x88\xbb\x23\xe2\x50\x44\xdc\x13\x51\x2d\x7b\x5f\x44\xdc\xdf\x66" "\xfd\x8d\x8b\x24\xb7\xce\x7f\xd2\x6b\x9b\x0a\x6c\x83\xb2\xf9\xdf\xf3\xf9" "\xda\xd6\xda\xf9\x5f\x31\xfb\x8b\xc1\x52\x9e\x3b\x50\x8d\xbf\x3f\x39\x33" "\x5b\x9e\x39\x9e\x9f\x93\x91\xe8\xdf\x9d\xe5\xc7\xd7\xa9\xe3\xfb\x97\x7f" "\xfd\xbc\xd5\xb1\xfa\xf9\x5f\xb6\x65\xf5\x17\x73\xc1\xbc\x1d\xd7\xfa\x1a" "\x1e\xd0\x4d\x4f\x2e\x4c\x6e\x25\xe6\x7a\xd7\x3f\x8e\x18\xea\x6b\x16\x7f" "\xb2\xb2\x12\x90\x44\xc4\xe1\x88\x18\xda\x64\x1d\xb3\x4f\x7c\x7d\xb4\xd5" "\xb1\x7f\x8f\x7f\x1d\x1d\x58\x67\xaa\x7c\x15\xf1\x78\xad\xff\x97\xa2\x21" "\xfe\x42\xb2\xfe\xfa\xe4\xd8\x1d\x51\x9e\x39\x3e\x56\x5c\x15\xb7\xfa\xf9" "\x97\x2b\x6f\xb4\xaa\x7f\x4b\xf1\x77\x40\xd6\xff\x7b\x9b\x5e\xff\x2b\xf1" "\x0f\x26\xf5\xeb\xb5\xf3\xed\xd7\x71\xe5\xf7\xcf\x5a\xde\xd3\x6c\xf6\xfa" "\xdf\x95\xbc\x55\x4d\xef\xca\xf7\x7d\x30\xb9\xb0\x70\x71\x3c\x62\x57\xf2" "\x5a\xbe\xff\x85\xd5\xfd\x13\xab\x9f\x2d\xf2\x45\xf9\x2c\xfe\x91\x63\xcd" "\xc7\xff\xc1\x58\x3d\x13\x47\x22\x22\xbb\x88\x1f\x88\x88\x07\x23\xe2\xa1" "\xbc\xed\x0f\x47\xc4\x23\x11\x71\x6c\x9d\xf8\x7f\x7c\xe9\xd1\x77\x37\x1f" "\xff\xf6\xca\xe2\x9f\x6e\xab\xff\xdb\x4f\x94\xce\xfd\xf0\xed\x9a\x4a\x07" "\xdb\x89\x3f\xeb\xff\x93\xd5\xd4\x48\xbe\x67\x23\xdf\x7f\x1b\x6d\xe0\x56" "\xcf\x1f\x00\x00\x00\xfc\x17\xa4\x11\xb1\x3f\x92\x74\x74\x25\x9d\xa6\xa3" "\xa3\xb5\xbf\xe1\x3f\x14\x7b\xd3\xf2\xdc\xfc\xc2\x93\x67\xe6\xde\xbf\x30" "\x5d\x7b\x47\x60\x30\xfa\xd3\xe2\x49\xd7\x40\xdd\xf3\xd0\xf1\xfc\xb6\xbe" "\xc8\x4f\x34\xe4\x4f\xe4\xcf\x8d\xbf\x28\xed\xa9\xe6\x47\xa7\xe6\xca\xd3" "\xdd\x0e\x1e\x7a\xdc\xbe\x16\xe3\x3f\xf3\x47\xa9\xdb\xad\x03\xb6\x9d\xf7" "\xb5\xa0\x77\x19\xff\xd0\xbb\x8c\x7f\xe8\x5d\xc6\x3f\xf4\xae\x26\xe3\x7f" "\x4f\x37\xda\x01\xec\xbc\x66\xbf\xff\x1f\x75\xa1\x1d\xc0\xce\x33\xff\x87" "\xde\x65\xfc\x43\xef\x32\xfe\xa1\x77\x19\xff\xd0\x93\xb6\xf2\x5e\xbf\x44" "\x2f\x27\x22\xbd\x2d\x9a\x21\xb1\x4d\x89\x6e\x7f\x33\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\x74\xc6\x3f\x01\x00\x00\xff\xff\x38\x0b\xe6" "\xcd", 1063); syz_mount_image(0x20000440, 0x20000480, 0x1e, 0x20000000, 2, 0x427, 0x200004c0); memcpy((void*)0x200001c0, "./file0\000", 8); memcpy((void*)0x20000180, "security.ima\000", 13); *(uint8_t*)0x20000900 = 0; *(uint8_t*)0x20000901 = 0; *(uint8_t*)0x20000902 = 0; *(uint32_t*)0x20000903 = htobe32(0); *(uint16_t*)0x20000907 = htobe16(0x378); memcpy( (void*)0x20000909, "\xb2\xd1\xa2\x57\xc0\x59\x0f\x56\x43\x02\x86\xff\x78\xb6\xc4\xf1\x60\x3f" "\x44\x02\xfd\x1b\xb7\x8b\xa5\xb5\x00\xf4\x52\x8d\x17\xbe\x58\xd9\x19\x0e" "\x16\x0d\x19\x81\xc3\x19\xe4\xd0\xeb\x4f\xd4\x17\xfd\xf3\x27\x91\xf8\x90" "\x13\x80\xe8\xdb\xd3\x18\xa9\x9c\x06\xc7\x8d\x57\xa9\xb3\xd3\x68\x51\x3d" "\xb9\xc1\xfe\xe5\x7b\xcc\xc0\x0d\xc4\xec\x92\xa0\xee\x9e\x37\x6e\x7f\x39" "\xc5\x8e\x06\xac\x8d\xcd\x6b\xf7\x3f\x80\x96\x59\xee\x28\x43\xd0\x44\xe7" "\x6f\x14\x5b\x03\xa9\xf2\xc8\x4c\x31\x3b\x6a\x40\x4d\x69\x60\xa7\xa6\x82" "\x59\x0b\xef\xd3\xc0\x15\x3c\xd3\x2f\x52\x5d\x23\x70\xd6\x74\xb3\xf1\x94" "\xb8\x5d\xeb\x6d\x43\x32\x6d\xd6\xd7\x79\xa8\xc3\x3a\x65\x6c\x21\x0e\xbb" "\x1c\xce\xe9\x44\xea\x76\xb7\x3c\xaa\xf3\x46\x29\x53\x80\x1e\x76\xce\xa6" "\xb6\xda\x09\x70\x9f\xcf\x08\x4e\xeb\x7c\xd5\xff\xa9\x58\x67\x7a\xf6\xa9" "\x05\x5e\x84\x64\x5e\x3b\x19\x76\x68\xbb\x38\x54\x6f\xca\x3d\x03\x07\x2f" "\xc7\xf5\xf9\x0e\x66\x2d\x66\xff\xae\x2d\x27\xf5\xaf\x49\x8f\x2a\x1d\x5d" "\x10\x3b\xc0\x0c\xcd\x62\x9e\x90\x37\xef\x89\xd5\xa8\x72\x9f\x18\x2d\xd7" "\xfa\xea\x30\x34\x95\xb7\xfb\xa3\xd4\x12\x2c\x3e\xb8\x1e\x31\x88\x51\x84" "\x55\xf0\x1a\xe9\x93\x37\x83\xad\xed\xbc\xb1\xda\x3f\xc9\x25\x14\x49\xfb" "\x27\x96\x76\x61\x00\x66\x23\x51\x31\x5f\xa9\xbe\xef\x90\x8a\x4b\x2b\xf0" "\x42\x6d\x31\x58\xdd\xd2\x71\xc2\x44\xaa\x94\x5b\x60\x53\x85\x99\x42\x6c" "\xed\x8e\x4f\x03\xce\x0a\xc5\x2b\x49\x51\xdf\x66\x0a\x93\x5e\x2a\x5b\x9f" "\xe6\x26\xd7\x32\xb3\x43\xa6\xea\x8c\x6a\x0b\xbd\x07\x19\x93\x2e\xef\x11" "\x37\xfe\xcd\x5b\x6b\x1e\xdb\x7f\xd6\x06\x76\x8f\xcb\xdf\x0a\x90\xf3\xd7" "\xd4\x0d\x75\xf4\x71\x5c\x2d\x9c\xfa\x5a\x76\xfb\x75\x38\x16\xd4\xf4\x5f" "\xbd\xdc\x30\x78\x20\x65\x69\x0e\x9a\xa0\xd6\xbc\x48\x28\xf6\x3a\xb5\x68" "\x7a\x06\x4f\xb7\xee\x03\xde\xb5\x89\xce\xad\x9d\x58\x20\x75\x24\xe7\xa7" "\xd0\x79\x2d\x6d\xb2\xed\x4c\xcd\xc6\x85\xe5\xa9\xca\x0c\xb8\xb9\x8a\x26" "\x81\x3b\xa7\x98\x14\x8a\xd4\x45\xc8\x72\x1b\xd2\xd6\xff\xd3\xe4\xa7\x0d" "\x1a\x96\xe8\x2a\xd6\xb8\xc3\x45\xe8\x3e\xfd\x7f\xa9\xc6\x14\x5a\x47\xff" "\x5b\x62\x1f\x25\x98\x1f\x45\xde\xb7\x3d\x82\x6c\xbc\x49\xc2\x37\x19\x00" "\xd6\x2f\x20\x1c\x25\x8d\xa7\xee\xe4\x45\x2b\x5a\xaf\x2a\x62\xb7\x2b\x86" "\xf7\x42\xe8\x90\xe7\x54\x2d\x85\xf6\x73\x60\x5c\x77\x6c\xb3\x25\x2d\xf7" "\x73\x16\x50\x85\x13\x2a\x04\x6d\x6f\x5b\xa5\xb1\xe5\xe7\x12\x21\x3f\xe0" "\xff\xb3\xa6\xd4\x72\xa5\x48\xe4\x49\x98\x50\x41\x86\x7c\x02\x20\xa0\x7c" "\xc5\xbe\x7f\xe1\x33\xe4\xb0\xcd\x81\x94\xe1\xa5\xc5\xc1\xe4\x79\x77\x5d" "\x5a\x2d\xa1\xb0\x0f\xd5\xa8\x11\x15\x8a\x79\x0e\x40\x91\x38\xac\xea\x1e" "\x83\x6a\xf6\x29\x28\x5e\x32\x2c\xf9\x6a\xdb\xec\xaa\x4f\xbf\x05\x35\x4b" "\xb9\x95\xc7\x37\xf3\x1f\xe8\x82\xdd\x33\x59\xf0\x15\x8c\x9c\xe4\x61\xcd" "\xaa\xd7\xa7\xbf\x5c\x4a\x0b\x6f\x4f\x54\x2e\xf2\xeb\x8a\x7c\x5d\x14\xe9" "\xec\x9e\xfb\xc3\xa3\xbd\xd0\xca\x18\x3d\x77\xec\xdd\x8f\x7d\x47\x0d\x72" "\x07\x75\x75\x3e\xf2\xe1\x58\xdc\xa2\x15\x24\x09\x07\x72\x2c\x5f\xcc\x02" "\xf2\x52\x9e\x0f\xf9\xc3\xc6\xa1\x15\x90\x9d\x0a\x6d\x54\xbe\x26\x10\x62" "\xab\x52\x72\xb2\x76\x11\xd9\x62\xf4\x34\xec\x6e\xf4\x75\xde\xc6\xd2\x94" "\xf9\xe3\xe1\x49\xe8\x45\x4d\x46\x8e\x38\xf9\xd9\xd3\xb5\xdd\x95\x34\x58" "\x8c\xb4\xd6\x32\xdb\xc7\xe9\xd3\x84\xb1\x00\xc5\xf9\x9f\x3b\xa6\x8d\xad" "\xae\xd1\x3c\x81\x22\x66\x45\x78\x0e\xc6\x64\xb3\xec\xe2\x34\xb9\x9a\x01" "\x87\x34\xd5\xe3\xbf\xbe\x8f\x90\xad\x94\xff\xec\x1c\x65\xbb\xfc\xd1\x11" "\x61\x47\x6d\xdc\xd2\x88\xda\x83\xf5\x41\x70\x77\x8a\x6d\xa6\xde\xf5\x78" "\x4f\xa6\xe0\xae\xe1\xcd\xc9\x21\xee\xd8\x0f\x66\xf5\x61\x7d\x46\x89\xcf" "\x82\x3e\x0c\xfd\xad\x09\xb6\xdb\x57\x50\xe5\xaf\x6b\xdc\x8f\xf6\xf5\x7a" "\x30\x72\x01\x2e\x3f\xcd\xee\xc7\xf3\xda\x9a\x67\x0f\xce\xfe\x5b\x7a\xcb" "\xe3\x6d\xcc\x71\x27\xa8", 888); syscall(__NR_lsetxattr, 0x200001c0ul, 0x20000180ul, 0x20000900ul, 0x381ul, 0ul); memcpy((void*)0x20004280, "./file0\000", 8); res = syscall(__NR_openat, 0xffffff9c, 0x20004280ul, 0ul, 0ul); if (res != -1) r[0] = res; syscall(__NR_getdents64, r[0], 0ul, 0ul); } 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); do_sandbox_none(); return 0; }