// https://syzkaller.appspot.com/bug?id=71555d135aeae425834c5a451596361e11c140c3 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } //% This code is derived from puff.{c,h}, found in the zlib development. The //% original files come with the following copyright notice: //% Copyright (C) 2002-2013 Mark Adler, all rights reserved //% version 2.3, 21 Jan 2013 //% This software is provided 'as-is', without any express or implied //% warranty. In no event will the author be held liable for any damages //% arising from the use of this software. //% Permission is granted to anyone to use this software for any purpose, //% including commercial applications, and to alter it and redistribute it //% freely, subject to the following restrictions: //% 1. The origin of this software must not be misrepresented; you must not //% claim that you wrote the original software. If you use this software //% in a product, an acknowledgment in the product documentation would be //% appreciated but is not required. //% 2. Altered source versions must be plainly marked as such, and must not be //% misrepresented as being the original software. //% 3. This notice may not be removed or altered from any source distribution. //% Mark Adler madler@alumni.caltech.edu //% BEGIN CODE DERIVED FROM puff.{c,h} #define MAXBITS 15 #define MAXLCODES 286 #define MAXDCODES 30 #define MAXCODES (MAXLCODES + MAXDCODES) #define FIXLCODES 288 struct puff_state { unsigned char* out; unsigned long outlen; unsigned long outcnt; const unsigned char* in; unsigned long inlen; unsigned long incnt; int bitbuf; int bitcnt; jmp_buf env; }; static int puff_bits(struct puff_state* s, int need) { long val = s->bitbuf; while (s->bitcnt < need) { if (s->incnt == s->inlen) longjmp(s->env, 1); val |= (long)(s->in[s->incnt++]) << s->bitcnt; s->bitcnt += 8; } s->bitbuf = (int)(val >> need); s->bitcnt -= need; return (int)(val & ((1L << need) - 1)); } static int puff_stored(struct puff_state* s) { s->bitbuf = 0; s->bitcnt = 0; if (s->incnt + 4 > s->inlen) return 2; unsigned len = s->in[s->incnt++]; len |= s->in[s->incnt++] << 8; if (s->in[s->incnt++] != (~len & 0xff) || s->in[s->incnt++] != ((~len >> 8) & 0xff)) return -2; if (s->incnt + len > s->inlen) return 2; if (s->outcnt + len > s->outlen) return 1; for (; len--; s->outcnt++, s->incnt++) { if (s->in[s->incnt]) s->out[s->outcnt] = s->in[s->incnt]; } return 0; } struct puff_huffman { short* count; short* symbol; }; static int puff_decode(struct puff_state* s, const struct puff_huffman* h) { int first = 0; int index = 0; int bitbuf = s->bitbuf; int left = s->bitcnt; int code = first = index = 0; int len = 1; short* next = h->count + 1; while (1) { while (left--) { code |= bitbuf & 1; bitbuf >>= 1; int count = *next++; if (code - count < first) { s->bitbuf = bitbuf; s->bitcnt = (s->bitcnt - len) & 7; return h->symbol[index + (code - first)]; } index += count; first += count; first <<= 1; code <<= 1; len++; } left = (MAXBITS + 1) - len; if (left == 0) break; if (s->incnt == s->inlen) longjmp(s->env, 1); bitbuf = s->in[s->incnt++]; if (left > 8) left = 8; } return -10; } static int puff_construct(struct puff_huffman* h, const short* length, int n) { int len; for (len = 0; len <= MAXBITS; len++) h->count[len] = 0; int symbol; for (symbol = 0; symbol < n; symbol++) (h->count[length[symbol]])++; if (h->count[0] == n) return 0; int left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= h->count[len]; if (left < 0) return left; } short offs[MAXBITS + 1]; offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + h->count[len]; for (symbol = 0; symbol < n; symbol++) if (length[symbol] != 0) h->symbol[offs[length[symbol]]++] = symbol; return left; } static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode, const struct puff_huffman* distcode) { static const short lens[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; static const short dists[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static const short dext[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; int symbol; do { symbol = puff_decode(s, lencode); if (symbol < 0) return symbol; if (symbol < 256) { if (s->outcnt == s->outlen) return 1; if (symbol) s->out[s->outcnt] = symbol; s->outcnt++; } else if (symbol > 256) { symbol -= 257; if (symbol >= 29) return -10; int len = lens[symbol] + puff_bits(s, lext[symbol]); symbol = puff_decode(s, distcode); if (symbol < 0) return symbol; unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]); if (dist > s->outcnt) return -11; if (s->outcnt + len > s->outlen) return 1; while (len--) { if (dist <= s->outcnt && s->out[s->outcnt - dist]) s->out[s->outcnt] = s->out[s->outcnt - dist]; s->outcnt++; } } } while (symbol != 256); return 0; } static int puff_fixed(struct puff_state* s) { static int virgin = 1; static short lencnt[MAXBITS + 1], lensym[FIXLCODES]; static short distcnt[MAXBITS + 1], distsym[MAXDCODES]; static struct puff_huffman lencode, distcode; if (virgin) { lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; short lengths[FIXLCODES]; int symbol; for (symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; for (; symbol < 256; symbol++) lengths[symbol] = 9; for (; symbol < 280; symbol++) lengths[symbol] = 7; for (; symbol < FIXLCODES; symbol++) lengths[symbol] = 8; puff_construct(&lencode, lengths, FIXLCODES); for (symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 5; puff_construct(&distcode, lengths, MAXDCODES); virgin = 0; } return puff_codes(s, &lencode, &distcode); } static int puff_dynamic(struct puff_state* s) { static const short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; int nlen = puff_bits(s, 5) + 257; int ndist = puff_bits(s, 5) + 1; int ncode = puff_bits(s, 4) + 4; if (nlen > MAXLCODES || ndist > MAXDCODES) return -3; short lengths[MAXCODES]; int index; for (index = 0; index < ncode; index++) lengths[order[index]] = puff_bits(s, 3); for (; index < 19; index++) lengths[order[index]] = 0; short lencnt[MAXBITS + 1], lensym[MAXLCODES]; struct puff_huffman lencode = {lencnt, lensym}; int err = puff_construct(&lencode, lengths, 19); if (err != 0) return -4; index = 0; while (index < nlen + ndist) { int symbol; int len; symbol = puff_decode(s, &lencode); if (symbol < 0) return symbol; if (symbol < 16) lengths[index++] = symbol; else { len = 0; if (symbol == 16) { if (index == 0) return -5; len = lengths[index - 1]; symbol = 3 + puff_bits(s, 2); } else if (symbol == 17) symbol = 3 + puff_bits(s, 3); else symbol = 11 + puff_bits(s, 7); if (index + symbol > nlen + ndist) return -6; while (symbol--) lengths[index++] = len; } } if (lengths[256] == 0) return -9; err = puff_construct(&lencode, lengths, nlen); if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) return -7; short distcnt[MAXBITS + 1], distsym[MAXDCODES]; struct puff_huffman distcode = {distcnt, distsym}; err = puff_construct(&distcode, lengths + nlen, ndist); if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) return -8; return puff_codes(s, &lencode, &distcode); } static int puff(unsigned char* dest, unsigned long* destlen, const unsigned char* source, unsigned long sourcelen) { struct puff_state s = { .out = dest, .outlen = *destlen, .outcnt = 0, .in = source, .inlen = sourcelen, .incnt = 0, .bitbuf = 0, .bitcnt = 0, }; int err; if (setjmp(s.env) != 0) err = 2; else { int last; do { last = puff_bits(&s, 1); int type = puff_bits(&s, 2); err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1)); if (err != 0) break; } while (!last); } *destlen = s.outcnt; return err; } //% END CODE DERIVED FROM puff.{c,h} #define ZLIB_HEADER_WIDTH 2 static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd) { if (sourcelen < ZLIB_HEADER_WIDTH) return 0; source += ZLIB_HEADER_WIDTH; sourcelen -= ZLIB_HEADER_WIDTH; const unsigned long max_destlen = 132 << 20; void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); if (ret == MAP_FAILED) return -1; unsigned char* dest = (unsigned char*)ret; unsigned long destlen = max_destlen; int err = puff(dest, &destlen, source, sourcelen); if (err) { munmap(dest, max_destlen); errno = -err; return -1; } if (write(dest_fd, dest, destlen) != (ssize_t)destlen) { munmap(dest, max_destlen); return -1; } return munmap(dest, max_destlen); } static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p) { int err = 0, loopfd = -1; int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; goto error; } if (puff_zlib_to_file(data, size, memfd)) { err = errno; goto error_close_memfd; } loopfd = open(loopname, O_RDWR); if (loopfd == -1) { err = errno; goto error_close_memfd; } if (ioctl(loopfd, LOOP_SET_FD, memfd)) { if (errno != EBUSY) { err = errno; goto error_close_loop; } ioctl(loopfd, LOOP_CLR_FD, 0); usleep(1000); if (ioctl(loopfd, LOOP_SET_FD, memfd)) { err = errno; goto error_close_loop; } } close(memfd); *loopfd_p = loopfd; return 0; error_close_loop: close(loopfd); error_close_memfd: close(memfd); error: errno = err; return -1; } static void reset_loop_device(const char* loopname) { int loopfd = open(loopname, O_RDWR); if (loopfd == -1) { return; } if (ioctl(loopfd, LOOP_CLR_FD, 0)) { } close(loopfd); } static long syz_mount_image(volatile long fsarg, volatile long dir, volatile long flags, volatile long optsarg, volatile long change_dir, volatile unsigned long size, volatile long image) { unsigned char* data = (unsigned char*)image; int res = -1, err = 0, need_loop_device = !!size; char* mount_opts = (char*)optsarg; char* target = (char*)dir; char* fs = (char*)fsarg; char* source = NULL; char loopname[64]; if (need_loop_device) { int loopfd; memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; close(loopfd); source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) reset_loop_device(loopname); errno = err; return res; } static void setup_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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void loop(void) { intptr_t res = 0; memcpy((void*)0x20000040, "ext4\000", 5); memcpy((void*)0x20000000, "./file0\000", 8); memcpy( (void*)0x20000200, "\x67\x72\x70\x69\x64\x2c\x69\x6e\x69\x74\x5f\x69\x74\x61\x62\x6c\x65\x3d" "\x30\x78\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x39" "\x2c\x64\x69\x6f\x72\x65\x61\x64\x5f\x6e\x6f\x6c\x6f\x63\x6b\x2c\x69\x6e" "\x69\x74\x5f\x69\x74\x61\x62\x6c\x65\x3d\x30\x78\x30\x30\x30\x30\x30\x30" "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x33\x2c\x67\x72\x70\x6a\x71\x75\x6f" "\x74\x61\x3d\x2c\x6e\x6f\x71\x75\x6f\x74\x61\x2c\x6e\x6f\x6d\x62\x6c\x6b" "\x5f\x69\x6f\x5f\x73\x75\x62\x6d\x69\x74\x2c\x6c\x61\x7a\x79\x74\x69\x6d" "\x65\x2c\x6e\x6f\x64\x65\x6c\x61\x6c\x6c\x6f\x63\x2c\x00\xfc\x74\x49\xe2" "\xe4\x96\xa1\x03\x3e\x08\x08\x25\x09\x44\xd9\x66\x60\x9a\x81\xd2\x99\xc3" "\xfc\xc2\x95\xcc\xbc\xbe\xe0\xf5\x44\xf0\xcf\x27\xfc\xf4\x72\x86\x69\xb5" "\xbf\xe0\x5d\x22\x75\x60\xf4\x45\x91\x2d\xe5\x01\x87\xe9\x71\x53\x15\xce" "\x29\x30\xde\x43\xf9\x0d\x3d\x4c\x44\x81\x70\x3c\x68\x3f\x84\x4b\xfa\xa4" "\x4a\xf8\x0e\x21\xd9\xa0\xa1\x3c\x9b\x56\xfc\x0c\x53\x0d\x70\x3a\x41\x00" "\xea\x6f\x98\xcf\xfe\x10\x67\x1c\x2f\xdb\x4a\xe8\xaf\xdb\xef\x1f\xfb\x98" "\xa0\x4d\x48\x70\x01\x16\x2b\x0d\x79\xf3\x42\xcd\xa5\xd7\x42\x34\x2c\xe9" "\x34\x51\xfe\xa3\x76\x03\x9f\x09\x57\xc7\x2d\x08\x6e\x99\xcd\xc9\x94\x28" "\x24\xa7\xff\x14\xc0\x63\xb1\x75\x87\x85\x57\x45\xa5\x57\xa4\xae\x3a\xc5" "\x84\x1f\xe3\xf9\x95\xcf\x0a\x07\x7f\x90\x55\x97\x6b\x8f\xd9\xf4\x48\x06" "\x15\x74\x15\x1e\x19\xf8\x55\xb7\x25\x36\xdb\x68\xd6\xc3\xb4\x54\x29\x88" "\x0a\x4c\xf8\xf9\x1d\xf3\x19\xec\x4d\xd3\x28\x31\xc3\xad\xe0\xcb\x56\xa0" "\x6d\x41\xb8\xee\xe0\x5f\x0c\x49\x20\x56\x37\x6f\xef\x83\xbb\x46\xd2\x08" "\xa1\x04\xde\xe6\x2c\x3c\xfd\xc1\x16\xee\x66\xe7\xa9\x7e\x97\x7a\x4b\xb1" "\xb3\xef\x93\xca\x16\x27\x35\xa7\x1f\xc2\x8d\x09\x60\x60\xcb\xa9\x4d\xd7" "\x7a\xc3\xe1\x80\x12\xda\x54\xb0\x36\x2d\xc8\xe0\x8c\x05\x48\x29\x73\x67" "\x1e\x96\xbc\xfa\xde\x40\x4a\x14\x0e\xe7\xb7\xd2\x5e\x41\x8f\x1f\x9f\x9b" "\x42\xed\x93\x78\xb2\xf0\x80\x7e\x71\x51\x98\xc7\x56\xbb\x19\xf7\x58\xc1" "\xdd\x57\x75\xf9\xbe\x98\x5f\xd6\xf3\xbb\x00\x47\x24\x7d\xa0\x19\x70\x54" "\x3b\x7c\xdb\x72\xdb\xe3\xa5\xcd\x0e\x10\xce\x9c\x28\xd5\x25\x82\xe7\x60" "\x99\x95\x52\xd6\x26\x61\xcf\xb5\xf5\x6c\xc4\x3c\x8e\xeb\xd7\x15\x5f\xd5" "\x12\xa3\xd0\xf3\x3e\xaa\xe9\x79\x25\xda\x7a\xfa\x08\xde\xd9\x8d\x5e\xf1" "\x42\x99\x32\x97\x72\xc5\x2d\x95\xde\x9e\x48\x04\x4e\x12\xde\xd8\xcb\xe1" "\x08\xd9\x3d\x0c\x72\x36\xbe\x81\x2b\xfc\x14\xc8\x94\x51\x10\xdb\x4a\xc0" "\xb5\x91\xf4\x70\xf0\xf1\x47\xe9\xfa\xb2\x09\x40\xde\x3e\xc4\xe4\x01\x8a" "\xd0\x24\x39\x0a\x28\x26\x5c\xea\x8f\x92\x08\xd9\xc7\x8d\x54\x6f\x40\x38" "\x9a\x8a\x59\x2c\x21\x6f\x26\xe8\x5a\x8d\xc4\xcf\xa4\x6d\x00\x90\xde\xd7" "\x09\xa4\xf8\x99\x88\x6f\x62\x32\xb0\xf6\xb6\x9f\x29\xc7\x83\xbe", 646); memcpy( (void*)0x20000540, "\x78\x9c\xec\xdd\x51\x6b\x1c\x5b\x1d\x00\xf0\xff\x6c\x76\x6b\xd3\xa6\x4d" "\xaa\x3e\x68\xc1\x5a\x6d\x25\x2d\xda\xdd\xa4\xb1\x6d\xf0\xa1\x56\x10\x7d" "\x2a\xa8\xf5\xbd\xc6\x64\x13\x42\x36\xd9\x90\xdd\xb4\x4d\x28\x9a\xe2\x07" "\x10\x44\x54\xf0\x49\x5f\x7c\x11\xfc\x00\x82\x14\x7c\xf1\x51\x84\x82\x3e" "\x2b\x2a\x8a\x78\xdb\x7b\x1f\xee\xc3\xbd\x9d\xcb\xee\x4e\xd2\x34\xdd\x4d" "\xd2\x76\x9b\x4d\x93\xdf\x0f\x4e\xe6\x9c\x99\x9d\xf9\x9f\xb3\x61\x66\xe7" "\xcc\x1c\x66\x02\x38\xb4\xce\x46\xc4\x8d\x88\x78\x9a\xa6\xe9\xc5\x88\x18" "\xcc\xe6\xe7\xb2\x14\x6b\xad\xd4\xf8\xdc\x93\xc7\xf7\x27\x1b\x29\x89\x34" "\xbd\xf5\xff\x24\x92\x6c\xde\xfa\xb6\x92\x6c\x7a\x3c\x5b\xed\x68\x44\x7c" "\xe7\x9b\x11\xdf\x4f\x5e\x8c\x5b\x5b\x59\x9d\x9b\xa8\x54\xca\x4b\x59\xb9" "\x54\x9f\x5f\x2c\xd5\x56\x56\x2f\xcd\xce\x4f\xcc\x94\x67\xca\x0b\x63\x63" "\xa3\x57\xc7\xaf\x8d\x5f\x19\x1f\xe9\x4a\x3b\x4f\x44\xc4\xf5\xaf\xff\xfb" "\x67\x3f\xfe\xcd\x37\xae\xff\xe1\x4b\x77\xff\x71\xfb\xbf\x17\x7e\xd0\xa8" "\xd6\x40\xb6\x7c\x73\x3b\x5e\x52\x7e\xbb\x85\xad\xa6\x17\x9a\xdf\xc5\xe6" "\x15\x96\x5e\x31\xd8\x7e\x94\x6f\xb6\x30\xd3\xbf\xbb\x75\x1e\xbc\xc1\xfa" "\x00\x00\xd0\x59\xe3\x1c\xff\xe3\x11\xf1\xf9\x88\xb8\x18\x83\xd1\xb7\xfd" "\xe9\x2c\x00\x00\x00\xf0\x16\x4a\xbf\x3a\x10\x1f\x24\x11\x69\x7b\x47\x3a" "\xcc\x07\x00\x00\x00\xde\x22\xb9\xe6\x18\xd8\x24\x57\xcc\xc6\x02\x0c\x44" "\x2e\x57\x2c\xb6\xc6\xf0\x7e\x32\x8e\xe5\x2a\xd5\x5a\xfd\x8b\xd3\xd5\xe5" "\x85\xa9\xd6\x58\xd9\xa1\x28\xe4\xa6\x67\x2b\xe5\x91\x6c\xac\xf0\x50\x14" "\x92\x46\x79\xb4\x99\x7f\x56\xbe\xbc\xa5\x3c\x16\x11\xa7\x22\xe2\xa7\x83" "\xfd\xcd\x72\x71\xb2\x5a\x99\xea\xf5\xc5\x0f\x00\x00\x00\x38\x24\x8e\x6f" "\xe9\xff\xbf\x37\xd8\xea\xff\x03\x00\x00\x00\x07\xcc\x50\xaf\x2b\x00\x00" "\x00\x00\xbc\x71\xfa\xff\x00\x00\x00\x70\xf0\xe9\xff\x03\x00\x00\xc0\x81" "\xf6\xad\x9b\x37\x1b\x29\x5d\x7f\xff\xf5\xd4\x9d\x95\xe5\xb9\xea\x9d\x4b" "\x53\xe5\xda\x5c\x71\x7e\x79\xb2\x38\x59\x5d\x5a\x2c\xce\x54\xab\x33\xcd" "\x67\xf6\xcd\xef\xb4\xbd\x4a\xb5\xba\xf8\xe5\x58\x58\xbe\x57\xaa\x97\x6b" "\xf5\x52\x6d\x65\xf5\xf6\x7c\x75\x79\xa1\x7e\x7b\xf6\xb9\x57\x60\x03\x00" "\x00\x00\x7b\xe8\xd4\x67\x1f\xfe\x2d\x89\x88\xb5\xaf\xf4\x37\x53\xc3\x91" "\x5e\x57\x0a\xd8\x13\xf9\x8d\x5c\x92\x4d\xdb\xec\xfd\x7f\x3f\xd9\x9a\xfe" "\x6b\x8f\x2a\x05\xec\x89\xbe\x5e\x57\x00\xe8\x99\x7c\xaf\x2b\x00\xf4\x4c" "\xa1\xd7\x15\x00\x7a\x2e\xd9\x61\x79\xc7\xc1\x3b\x7f\xce\xa6\x9f\xeb\x6e" "\x7d\x00\x00\x80\xee\x1b\xfe\x74\xe7\xfb\xff\xb9\x6d\xd7\x5c\xdb\x7e\x31" "\xb0\xef\xd9\x89\xe1\xf0\x72\xff\x1f\x0e\xaf\xe6\xfd\xff\xdd\x0e\xf8\x75" "\xb2\x00\x07\x4a\xc1\x19\x00\x1c\x7a\xaf\x7d\xff\x7f\x47\x69\xfa\x52\x15" "\x02\x00\x00\xba\x6e\xa0\x99\x92\x5c\x31\xbb\xbc\x37\x10\xb9\x5c\xb1\x18" "\x71\xa2\xf9\x5a\x80\x42\x32\x3d\x5b\x29\x8f\x44\xc4\xc9\x88\xf8\xeb\x60" "\xe1\x63\x8d\xf2\x68\x73\xcd\x64\xc7\x3e\x03\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\x92\xa6\x49\xa4\x00" "\x00\x00\xc0\x81\x16\x91\xfb\x4f\xf2\xc7\xd6\xb3\xfc\x87\x07\xcf\x0f\x6c" "\xbd\x3e\x70\x24\x79\x7f\x30\xb2\x57\x84\xde\xfd\xe5\xad\x9f\xdf\x9b\xa8" "\xd7\x97\x46\x1b\xf3\xdf\xd9\x98\x5f\xff\x45\x36\xff\x72\x2f\xae\x60\x00" "\x00\x00\x00\x5b\xad\xf7\xd3\xd7\xfb\xf1\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\x4d\x4f\x1e\xdf\x9f\x5c" "\x4f\x7b\x19\xf7\x7f\x5f\x8b\x88\xa1\x76\xf1\xf3\x71\xb4\x39\x3d\x1a\x85" "\x88\x38\xf6\x6e\x12\xf9\x4d\xeb\x25\x11\xd1\xd7\x85\xf8\x6b\x0f\x22\xe2" "\x53\xed\xe2\x27\x8d\x6a\x6d\x84\x6c\x17\xbf\xff\xcd\xc7\x8f\xa1\xec\x5b" "\x68\x17\xff\x78\x17\xe2\xc3\x61\xf6\xb0\x71\xfc\xb9\xd1\x6e\xff\xcb\xc5" "\xd9\xe6\xb4\xfd\xfe\x97\x8f\x78\xae\xfc\xaa\x3a\x1f\xff\x62\xe3\xf8\xd7" "\xd7\x61\xff\x3f\xb1\xcb\x18\xa7\x1f\xfd\xae\xd4\x31\xfe\x83\x88\xd3\xf9" "\xf6\xc7\x9f\xf5\xf8\x49\x87\xf8\xe7\x76\x19\xff\x7b\xdf\x5d\x5d\xed\xb4" "\x2c\xfd\x55\xc4\x70\xdb\xdf\x9f\xe4\xb9\x58\xa5\xfa\xfc\x62\xa9\xb6\xb2" "\x7a\x69\x76\x7e\x62\xa6\x3c\x53\x5e\x18\x1b\x1b\xbd\x3a\x7e\x6d\xfc\xca" "\xf8\x48\x69\x7a\xb6\x52\xce\xfe\xb6\x8d\xf1\x93\xcf\xfc\xfe\xe9\x76\xed" "\x3f\xd6\x21\xfe\xd0\x0e\xed\x3f\xbf\xcb\xf6\x7f\xf8\xe8\xde\xe3\x4f\xb4" "\xb2\x85\x76\xf1\x2f\x9c\x6b\x13\xff\x4f\xbf\xce\x3e\xf1\x62\xfc\x5c\xf6" "\xdb\xf7\x85\x2c\xdf\x58\x3e\xbc\x9e\x5f\x6b\xe5\x37\x3b\xf3\xdb\xbf\x9c" "\xd9\xae\xfd\x53\x1d\xda\xbf\xd3\xff\xff\xc2\x2e\xdb\x7f\xf1\xdb\x3f\xfa" "\xe7\x2e\x3f\x0a\x00\xec\x81\xda\xca\xea\xdc\x44\xa5\x52\x5e\x3a\xb0\x99" "\x46\x2f\x7d\x1f\x54\x43\x66\x1f\x66\x7e\xd8\xd5\x0d\xa6\x69\x9a\x36\xf6" "\xa9\xd7\xd8\x4e\x12\xfb\xe1\x6b\x69\x66\x7a\x7d\x64\x02\x00\x00\xba\xed" "\xd9\x49\x7f\xaf\x6b\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x87\xd7\x5e\x3c\x4e\x6c\x6b\xcc\xb5\x8d\x5c\xd2\x8d\x47\x68" "\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\x74\xc5\x47\x01\x00\x00\xff\xff\xda\x26\xda\x41", 1277); syz_mount_image( /*fs=*/0x20000040, /*dir=*/0x20000000, /*flags=MS_LAZYTIME|MS_REC|MS_NODIRATIME|MS_MANDLOCK*/ 0x2004840, /*opts=*/0x20000200, /*chdir=*/0x64, /*size=*/0x4fd, /*img=*/0x20000540); memcpy((void*)0x20000000, "./file1\000", 8); syscall(__NR_unlink, /*path=*/0x20000000ul); res = syscall(__NR_fanotify_init, /*flags=*/0ul, /*events=*/0ul); if (res != -1) r[0] = res; memcpy((void*)0x20000040, ".\000", 2); res = syscall(__NR_open, /*file=*/0x20000040ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[1] = res; syscall(__NR_fanotify_mark, /*fd=*/r[0], /*flags=FAN_MARK_ONLYDIR|FAN_MARK_DONT_FOLLOW|FAN_MARK_ADD*/ 0xdul, /*mask=FAN_EVENT_ON_CHILD|FAN_OPEN|FAN_CLOSE_WRITE|FAN_ACCESS*/ 0x8000029ul, /*fddir=*/r[1], /*path=*/0ul); } 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); do_sandbox_none(); return 0; }