// https://syzkaller.appspot.com/bug?id=0b1ac5e39c478b05355e189451b5379dc925fd2e // 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 #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } 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 kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void reset_loop() { char buf[64]; snprintf(buf, sizeof(buf), "/dev/loop%llu", procid); int loopfd = open(buf, O_RDWR); if (loopfd != -1) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x20000f00, "udf\000", 4); memcpy((void*)0x20000f40, "./" "file0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000", 253); memcpy((void*)0x20001180, "iocharset=iso8859-1,nostrict,uid=forget,anchor=00000000000000000145," "gid=", 72); sprintf((char*)0x200011c8, "%020llu", (long long)0); memcpy( (void*)0x200011dc, "\x2c\x64\x6d\x6f\x64\x65\x3d\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30" "\x30\x30\x30\x30\x30\x30\x30\x30\x32\x30\x30\x34\x2c\x75\x6e\x64\x65\x6c" "\x65\x74\x65\x2c\x70\x61\x72\x74\x69\x74\x69\x6f\x6e\x3d\x30\x30\x30\x30" "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31\x2c\x75" "\x6e\x68\x69\x64\x65\x2c\x00\xa7\x0e\x64\xd7\x9b\xe6\x86\x88\x11\xd4\xae" "\x24\xb9\xe9\x9e\xfb\xe1\x3c\xa0\x38\x47\xa6\x7a\x49\x69\x24\x0e\x4d\xbf" "\x2c\xcf\x0a\x91\x6c\xdd\x09\x27\x71\xb7\xb4\xff\x53\x45\x78\x52\x7b\x78" "\xe6\x8f\x65\x6d\xff\xee\x33\x5c\x3e\x56\x98\x3d\xf1\xe6\xe4\x1e\xdf\x9b" "\x8e\xcb\x83\x57\xd5\x0e\xfd\x63\xc0\x7a\x09\xe8\xb1\x1b\xb6\x3c\xab\xb3" "\xe5\xfd\x3d\xc1\xd3\xa6\x38\xd2\x73\x18\xcf\xa5\x06\x2a\x2e\x29\xc6\xfa" "\x0c\xd6\x19\x64\x38\xd2\x5c\x5e\xee\x17\xec\xc6\x9a\x32\x0e\x0c\x93\x72" "\x31\x48\x8e\x80\xc7\x1a\x20\xf3\x6c\x52\x34\x3b\xae\x01\x7c", 213); memcpy( (void*)0x200001c0, "\x78\x9c\xec\xdd\x4f\x6c\x1c\xd7\x7d\x07\xf0\xdf\x1b\x2d\xc5\x95\xdc\x56" "\x4c\xec\x2a\x4e\x1a\x07\x9b\xb6\x48\x65\xc6\x72\xf5\x2f\xa6\x62\x15\xee" "\xaa\xa6\xd9\x06\x90\x65\x22\x14\x73\x0b\xc0\x95\x48\xa9\x0b\x53\x24\x41" "\x52\x8d\x6c\xa4\x05\xd3\x4b\x0f\x3d\x04\x28\x8a\x1e\x72\x22\xd0\x1a\x05" "\x52\x34\x30\x9a\x22\xe8\x91\x69\x5d\x20\xb9\xf8\x50\xe4\xd4\x13\xd1\xc2" "\x46\x50\xf4\xc0\x16\x01\x02\x14\x08\x58\xcc\xec\x5b\x71\x49\x91\xb6\x2c" "\x92\x12\x25\x7f\x3e\x36\xf5\x9d\x9d\x79\x6f\xe6\xbd\x99\xf5\x8c\x2c\xe8" "\xcd\x0b\x00\x00\x00\x00\x00\x00\x00\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\xf7" "\x5e\xb9\x78\xea\x74\xda\x66\xc3\xa1\x87\xd0\x18\x00\xe0\x81\xb8\x3c\xf6" "\xd5\x53\x67\xb6\x7b\xfe\x03\x00\x8f\xad\x2b\x3b\xfd\xff\x3f\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x70\x50\xa4\x28\xe2\xc9\x48\x31\x77\x79" "\x2d\x4d\x54\x9f\x3b\xea\x97\xda\x7d\xb7\x6e\x8f\x0f\x8f\x6c\x5f\xed\x48" "\xaa\x6a\x1e\xaa\xca\x97\x3f\xf5\xd3\x67\xce\x9e\xfb\xd2\x0b\x43\xe7\xbb" "\x79\xa9\x3d\xf3\x01\xf5\xf7\xda\x67\xe2\xb5\xb1\x2b\x17\x1b\x2f\xcf\xde" "\x9c\x9b\x9f\x5a\x58\x98\x9a\x6c\x8c\xcf\xb4\xaf\xcd\x4e\x4e\xdd\xf3\x1e" "\x76\x5b\x7f\xab\xc1\xea\x04\x34\x6e\xbe\x7e\x6b\xf2\xfa\xf5\x85\xc6\x99" "\xe7\xcf\x6e\xda\x7c\x7b\xe0\xfd\xfe\x27\x8e\x0f\x5c\x18\x7a\xf6\xe4\x33" "\xdd\xb2\xe3\xc3\x23\x23\x63\x1b\x45\xea\xbd\xe5\x6b\xf7\xdd\x90\x8e\x9d" "\x46\x78\x1c\x8e\x22\x4e\x46\x8a\xe7\xbe\xf7\xd3\xd4\x8a\x88\x22\x76\x7f" "\x2e\xea\x0f\xf6\xda\x6f\x75\xa4\xea\xc4\x60\xd5\x89\xf1\xe1\x91\xaa\x23" "\xd3\xed\xd6\xcc\x62\xb9\x71\xb4\x7b\x22\x8a\x88\x46\x4f\xa5\x66\xf7\x1c" "\x6d\x7f\x2d\xa2\xd6\xf7\x40\xfb\xb0\xb3\x66\xc4\x52\xd9\xfc\xb2\xc1\x83" "\x65\xf7\xc6\xe6\x5a\xf3\xad\xab\xd3\x53\x8d\xd1\xd6\xfc\x62\x7b\xb1\x3d" "\x3b\x33\x9a\x3a\xad\x2d\xfb\xd3\x88\x22\xce\xa7\x88\xe5\x88\x58\xed\xbf" "\x7b\x77\x7d\x51\x44\x2d\x52\x7c\xe7\xd8\x5a\xba\x9a\xdf\xfa\x51\x9d\x87" "\x2f\x56\x03\x83\x77\x6e\x47\xb1\x8f\x7d\xbc\x07\x65\x3b\x1b\x7d\x11\xcb" "\xc5\x23\x70\xcd\x0e\xb0\xfe\x28\xe2\xd5\x48\xf1\xb3\x77\x4e\xc4\xb5\x7c" "\x9f\xa9\xee\x35\x5f\x88\x78\xb5\xcc\x1f\x44\xbc\x55\xe6\x4b\x11\xa9\xfc" "\x62\x9c\x8b\x78\x6f\x9b\xef\x11\x8f\xa6\x5a\x14\xf1\xe7\xe5\xf5\xbf\xb0" "\x96\x26\xab\xfb\x41\xf7\xbe\x72\xe9\x6b\x8d\xaf\xcc\x5c\x9f\xed\x29\xdb" "\xbd\xaf\x7c\xc4\xe7\xc3\x5d\x77\x8a\x87\xf4\x7c\x38\xb2\x25\x1f\x8c\x03" "\x7e\x6f\xaa\x47\x11\xad\xea\x8e\xbf\x96\xee\xff\x37\x3b\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\xb5\x23\x51\xc4\xa7\x23\xc5\x2b" "\xff\xf6\x47\xd5\xb8\xe2\xa8\xc6\xa5\x1f\xbb\x30\xf4\xfb\x03\xbf\xdc\x3b" "\x66\xfc\xe9\x0f\xd9\x4f\x59\xf6\xf9\x88\x58\x2a\xee\x6d\x4c\xee\xe1\x3c" "\x30\x70\x34\x8d\xa6\xf4\x90\xc7\x12\x7f\x9c\xd5\xa3\x88\x3f\xce\xe3\xff" "\xbe\xf5\xb0\x1b\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\xf0\xb1\x56\xc4\x4f\x22\xc5\x8b\xef\x9e\x48\xcb\xd1\x3b\xa7\x78\x7b" "\xe6\x46\xe3\x4a\xeb\xea\x74\x67\x56\xd8\xee\xdc\xbf\xdd\x39\xd3\xd7\xd7" "\xd7\xd7\x1b\xa9\x93\xcd\x9c\x13\x39\x97\x72\x2e\xe7\x5c\xc9\xb9\x9a\x33" "\x8a\x5c\x3f\x67\x33\xe7\x44\xce\xa5\x9c\xcb\x39\x57\x72\xae\xe6\x8c\x43" "\xb9\x7e\xce\x66\xce\x89\x9c\x4b\x39\x97\x73\xae\xe4\x5c\xcd\x19\xb5\x5c" "\x3f\x67\x33\xe7\x44\xce\xa5\x9c\xcb\x39\x57\x72\xae\xe6\x8c\x03\x32\x77" "\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\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\xe3\xa4\x88\x22\x7e\x11" "\x29\xbe\xfd\x8d\xb5\x14\x29\x22\x9a\x11\x13\xd1\xc9\x95\xfe\x87\xdd\x3a" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\xa0\xd4\x9f\x8a\xf8\x7e\xa4\x68\xfc\x41\xf3\xce\xba\x5a\x44\xa4\xea" "\xdf\x8e\x13\xe5\x2f\xe7\xa2\x79\xb8\xcc\x4f\x46\x73\xa8\xcc\x97\xa2\x79" "\x31\x67\xab\xca\x5a\xf3\x5b\x0f\xa1\xfd\xec\x4e\x5f\x2a\xe2\xc7\x91\xa2" "\xbf\xfe\xf6\x9d\x0b\x9e\xaf\x7f\x5f\xe7\xd3\x9d\xaf\x41\xbc\xf5\xcd\x8d" "\x4f\x9f\xa9\x75\xf2\x50\x77\xe3\xc0\xfb\xfd\x4f\x1c\x3f\x76\x61\x68\xe4" "\x73\x4f\xef\xb4\x9c\xb6\x6b\xc0\xe0\xa5\xf6\xcc\xad\xdb\x8d\xf1\xe1\x91" "\x91\xb1\x9e\xd5\xb5\x7c\xf4\x4f\xf6\xac\x1b\xc8\xc7\x2d\xf6\xa6\xeb\x44" "\xc4\xc2\x1b\x6f\xbe\xde\x9a\x9e\x9e\x9a\xbf\xff\x85\xf2\x2b\xb0\x8b\xea" "\x8f\xd0\x42\xaa\x7d\x5c\x7a\x6a\xa1\x5a\x88\xda\x81\x68\xc6\xc3\xe9\xfb" "\x26\xf5\x87\x75\x83\x62\x5f\x95\xcf\xff\xf7\x22\xc5\x6f\xbf\xfb\xef\xdd" "\x07\x7e\xe7\xf9\x5f\x8f\x5f\xea\x7c\xba\xf3\x84\x8f\x9f\xff\xc9\xc6\xf3" "\xff\xc5\xad\x3b\xba\xc7\xe7\x7f\x6d\x6b\xbd\xfc\xfc\x2f\x9f\xe9\xdb\x3d" "\xff\x9f\xec\x59\xf7\x62\xfe\xdd\x48\x5f\x2d\xa2\xbe\x78\x73\xae\xef\x78" "\x44\x7d\xe1\x8d\x37\x4f\xb6\x6f\xb6\x6e\x4c\xdd\x98\x9a\x39\x77\xea\xd4" "\x97\x87\x86\xbe\x7c\xf6\x54\xdf\xe1\x88\xfa\xf5\xf6\xf4\x54\xcf\xd2\x9e" "\x9c\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x07\x27\x15" "\xf1\xbb\x91\xa2\xf5\xe3\xb5\xd4\x88\x88\xdb\xd5\x78\xad\x81\x0b\x43\xcf" "\x9e\x7c\xe6\x50\x1c\xaa\xc6\x5b\x6d\x1a\xb7\xfd\xda\xd8\x95\x8b\x8d\x97" "\x67\x6f\xce\xcd\x4f\x2d\x2c\x4c\x4d\x36\xc6\x67\xda\xd7\x66\x27\xa7\xee" "\xf5\x70\xf5\x6a\xb8\xd7\xf8\xf0\xc8\xbe\x74\xe6\x43\x1d\xd9\xe7\xf6\x1f" "\xa9\xbf\x3c\x3b\xf7\xc6\x7c\xfb\xc6\x1f\x2e\x6e\xbb\xfd\x68\xfd\xe2\xd5" "\x85\xc5\xf9\xd6\xb5\xed\x37\xc7\x91\x28\x22\x9a\xbd\x6b\x06\xab\x06\x8f" "\x0f\x8f\x54\x8d\x9e\x6e\xb7\x66\xaa\xaa\xa3\xdb\x0e\xa6\xff\xe8\xfa\x52" "\x11\xff\x11\x29\xae\x9d\x6b\xa4\xcf\xe7\x75\x79\xfc\xff\xd6\x11\xfe\x9b" "\xc6\xff\x2f\x6d\xdd\xd1\x1e\x8e\xff\xff\xdc\xd1\x8d\xf1\x7f\x9f\xe8\x29" "\x5a\x1e\x33\xa5\x22\x7e\x1e\x29\x7e\xeb\x2f\x9e\x8e\xcf\x57\xed\x3c\x1a" "\x77\x9d\xb3\x5c\xee\x6f\x22\xc5\xe0\xf9\xcf\xe6\x72\x71\xb8\x2c\xd7\x6d" "\x43\xe7\xbd\x02\x9d\x91\x81\x65\xd9\xff\x89\x14\xff\xf0\x8b\xcd\x65\xbb" "\xe3\x21\x9f\xdc\x28\x7b\xfa\x23\x9d\xdc\x47\x40\x79\xfd\x8f\x45\x8a\xef" "\xff\xd9\x77\xe3\xd7\xf3\xba\xcd\xef\x7f\xd8\xfe\xfa\x1f\xdd\xba\xa3\x7d" "\x7a\xff\xc3\x53\x3d\xeb\x8e\x6e\x7a\x5f\xc1\xae\xbb\x4e\xbe\xfe\x27\x23" "\xc5\x4b\x4f\xbe\x1d\xbf\x51\xad\xf9\xbf\x0f\x7c\xff\x47\xf7\xdd\x1b\x27" "\x3a\x85\x37\xde\xcf\xb1\x4f\xd7\xff\x57\x7b\xd6\x0d\xe4\xe3\xfe\xe6\x5e" "\x75\x1e\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x11\xd6\x97\x8a\xf8\xdb\x48" "\xf1\xc3\x91\x5a\x7a\x21\xaf\xbb\x97\xbf\xff\x37\xb9\x75\x47\xfb\xf4\xf7" "\xbf\x3e\xd5\xb3\x6e\x72\x6f\xe6\x2b\xfa\xd0\x85\x5d\x9f\x54\x00\x00\x00" "\x00\x38\x20\xfa\x52\x11\x3f\x89\x14\x37\x16\xdf\xbe\x33\x86\x7a\xf3\xf8" "\xef\x9e\xf1\x9f\xbf\xb3\x31\xfe\x73\x38\x6d\xd9\x5a\xfd\x39\xdf\xaf\x54" "\xef\x0d\xd8\xcb\x3f\xff\xeb\x35\x90\x8f\x3b\xb1\xfb\x6e\x03\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x81\x92\x52\x11\x2f\xe4" "\xf9\xd4\x27\xaa\xf1\xfc\x93\x3b\xce\xa7\xbe\x12\x29\x5e\xf9\xaf\xe7\x72" "\xb9\x74\xbc\x2c\xd7\x9d\x07\x7e\xa0\xfa\xb5\x7e\x79\x76\xe6\xe4\xc5\xe9" "\xe9\xd9\x7a\x2c\xb6\xae\x4e\x4f\x35\xc6\xe6\x5a\xd7\xa6\xca\xba\x4f\x45" "\x8a\xb5\xbf\xfe\x6c\xae\x5b\x54\xf3\xab\x77\xe7\x9b\xef\xcc\xf1\xbe\x31" "\x17\xfb\x7c\xa4\x18\xf9\xbb\x6e\xd9\xce\x5c\xec\xdd\xb9\xc9\x9f\xda\x28" "\x7b\xba\x2c\xfb\x89\x48\xf1\x9f\x7f\xbf\xb9\x6c\x9e\x9a\x3a\xcf\x1d\x5d" "\x95\x3d\x53\x96\xfd\xab\x48\xf1\xf5\x7f\xda\xbe\xec\xf1\x8d\xb2\x67\xcb" "\xb2\xdf\x8d\x14\x3f\xfa\x7a\xa3\x5b\xf6\x68\x59\xb6\xfb\x7e\xd4\x4f\x6d" "\x94\x7d\xfe\xda\x6c\xb1\x0f\x57\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x80\x8f\x9b\xbe\x54\xc4\x9f\x46\x8a\xff\xbe\xb9\x7c" "\x67\x2c\x7f\x9e\xff\xbf\xaf\xe7\x63\xe5\xad\x6f\xf6\xcc\xf7\xbf\xc5\xed" "\x6a\x9e\xff\x81\x6a\xfe\xff\x9d\x96\xef\x67\xfe\xff\xea\xbd\x02\x4b\x3b" "\x1d\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x1e\x4f\x29\x8a\x78\x33\x52\xcc\x5d\x5e\x4b\x2b\xfd\xe5\xe7\x8e\xfa" "\xa5\xf6\xcc\xad\xdb\xe3\xc3\x23\xdb\x57\x3b\x92\xaa\x9a\x87\xaa\xf2\xe5" "\x4f\xfd\xf4\x99\xb3\xe7\xbe\xf4\xc2\xd0\xf9\x6e\x7e\x70\xfd\xbd\xf6\xe9" "\x78\x6d\xec\xca\xc5\xc6\xcb\xb3\x37\xe7\xe6\xa7\x16\x16\xa6\x26\x1b\xe3" "\x33\xed\x6b\xb3\x93\x53\xf7\xbc\x87\xdd\xd6\xdf\x6a\xb0\x3a\x01\x8d\x9b" "\xaf\xdf\x9a\xbc\x7e\x7d\xa1\x71\xe6\xf9\xb3\x9b\x36\xdf\x1e\x78\xbf\xff" "\x89\xe3\x03\x17\x86\x9e\x3d\xf9\x4c\xb7\xec\xf8\xf0\xc8\xc8\x58\x4f\x99" "\x5a\xdf\x7d\x1f\xfd\x2e\x69\x87\xf5\x87\xa3\x88\xbf\x8c\x14\xcf\x7d\xef" "\xa7\xe9\x87\xfd\x11\x45\xec\xfe\x5c\x7c\xc8\x77\x67\xbf\x1d\xa9\x3a\x31" "\x58\x75\x62\x7c\x78\xa4\xea\xc8\x74\xbb\x35\xb3\x58\x6e\x1c\xed\x9e\x88" "\x22\xa2\xd1\x53\xa9\xd9\x3d\x47\x0f\xe0\x5a\xec\x4a\x33\x62\xa9\x6c\x7e" "\xd9\xe0\xc1\xb2\x7b\x63\x73\xad\xf9\xd6\xd5\xe9\xa9\xc6\x68\x6b\x7e\xb1" "\xbd\xd8\x9e\x9d\x19\x4d\x9d\xd6\x96\xfd\x69\x44\x11\xe7\x53\xc4\x72\x44" "\xac\xf6\xdf\xbd\xbb\xbe\x28\xe2\xf5\x48\xf1\x9d\x63\x6b\xe9\x9f\xfb\x23" "\x0e\x75\xcf\xc3\x17\x2f\x8f\x7d\xf5\xd4\x99\x9d\xdb\x51\xec\x63\x1f\xef" "\x41\xd9\xce\x46\x5f\xc4\x72\xf1\x08\x5c\xb3\x03\xac\x3f\x8a\xf8\xc7\x48" "\xf1\xb3\x77\x4e\xc4\xbf\xf4\x47\xd4\xa2\xf3\x13\x5f\x88\x78\xb5\xcc\x1f" "\x44\xbc\x15\x9d\xeb\x9d\xca\x2f\xc6\xb9\x88\xf7\xb6\xf9\x1e\xf1\x68\xaa" "\x45\x11\xff\x5b\x5e\xff\x0b\x6b\xe9\x9d\xfe\xf2\x7e\xd0\xbd\xaf\x5c\xfa" "\x5a\xe3\x2b\x33\xd7\x67\x7b\xca\x76\xef\x2b\x8f\xfc\xf3\xe1\x41\x3a\xe0" "\xf7\xa6\x7a\x14\xf1\xa3\xea\x8e\xbf\x96\xfe\xd5\x7f\xd7\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x48\x11\xbf\x16\x29\x5e\x7c\xf7" "\x44\xaa\xc6\x07\xdf\x19\x53\xdc\x9e\xb9\xd1\xb8\xd2\xba\x3a\xdd\x19\xd6" "\xd7\x1d\xfb\xd7\x1d\x33\xbd\xbe\xbe\xbe\xde\x48\x9d\x6c\xe6\x9c\xc8\xb9" "\x94\x73\x39\xe7\x4a\xce\xd5\x9c\x51\xe4\xfa\x39\x9b\x65\xd6\xd7\xd7\x27" "\xf2\xe7\xa5\x9c\xcb\x39\x57\x72\xae\xe6\x8c\x43\xb9\x7e\xce\x66\xce\x89" "\x9c\x4b\x39\x97\x73\xae\xe4\x5c\xcd\x19\xb5\x5c\x3f\x67\x33\xe7\x44\xce" "\xa5\x9c\xcb\x39\x57\x72\xae\xe6\x8c\x03\x32\x76\x0f\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\xbc\x14\xd5\x3f\x29\xbe\xfd\x8d" "\xb5\xb4\xde\xdf\x99\x5f\x7a\x22\x3a\xb9\x62\x3e\xd0\xc7\xde\xff\x07\x00" "\x00\xff\xff\x76\xc3\xf9\x1c", 3139); syz_mount_image(/*fs=*/0x20000f00, /*dir=*/0x20000f40, /*flags=MS_I_VERSION|MS_SYNCHRONOUS|MS_RELATIME*/ 0xa00010, /*opts=*/0x20001180, /*chdir=*/1, /*size=*/0xc43, /*img=*/0x200001c0); memcpy((void*)0x20000440, "./control\000", 10); syscall(__NR_mkdir, /*path=*/0x20000440ul, /*mode=*/0ul); memcpy((void*)0x200002c0, "./control/file0\000", 16); syscall(__NR_open, /*file=*/0x200002c0ul, /*flags=O_CREAT|O_CLOEXEC*/ 0x80040ul, /*mode=*/0ul); memcpy((void*)0x200001c0, "./control/file0\000", 16); syscall(__NR_unlink, /*path=*/0x200001c0ul); memcpy((void*)0x20000000, "./control\000", 10); syscall(__NR_rmdir, /*path=*/0x20000000ul); for (int i = 0; i < 32; i++) { syscall(__NR_rmdir, /*path=*/0x20000000ul); } } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; loop(); return 0; }