// https://syzkaller.appspot.com/bug?id=ff9fe3de46d66c92f26a627abe9e85d0518c9890 // 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*)0x20000000, "hfsplus\000", 8); memcpy((void*)0x20002380, "./file0\000", 8); memcpy( (void*)0x20001000, "\x78\x9c\xec\xdd\x4b\x6c\x1c\x67\x1d\x00\xf0\xff\xac\xd7\xeb\x5d\x03\xa9" "\xd3\xa6\x49\x41\x91\xba\x6a\xa4\x82\x88\x48\xec\x18\x17\xcc\x85\x80\x10" "\xf8\x50\xa1\xaa\x1c\x38\xaf\x12\xa7\xb1\xb2\x71\x2a\xdb\x45\x4e\x84\xa8" "\xc3\xe3\xce\xa1\x07\xc4\xa9\x1c\x7c\xab\x38\xa0\x72\x8f\x04\x67\xaa\x4a" "\xa8\x57\x1f\x38\x54\x42\xea\xa5\x27\xdf\x8c\x66\x76\x66\x77\x6c\xaf\x77" "\xd7\x89\x5f\xa5\xbf\x9f\x35\x33\xdf\xcc\xf7\x9c\xff\xec\xcc\xec\x43\xd6" "\x04\xf0\xa5\xb5\x70\x35\xaa\x4f\x22\x89\x85\xab\xaf\xaf\xa7\xeb\x5b\x9b" "\xb3\xed\xb1\xcd\xd9\x89\x3c\xbb\x1d\x11\xb5\x88\xa8\x44\x54\x3b\x8b\x48" "\x96\xf3\xbc\xaf\x5e\x8e\x9b\xe9\xf2\xeb\xe9\xc6\x7c\x5b\x72\x50\x3f\xef" "\x2d\xcd\xbf\xf9\xc9\xe7\x5b\x9f\x76\xd6\xaa\xf9\x94\x95\x4f\x06\xd5\xeb" "\xa3\xb6\x7f\xd3\x46\x3e\x45\x33\x22\xc6\xf2\xe5\x7e\xe3\x07\xb4\xf8\xe1" "\xde\xee\x77\xb5\x77\xeb\xc0\xf6\x46\xd5\xdb\xc3\x34\x60\x57\xf2\x65\xc4" "\x9f\x9f\xa9\x55\x78\x66\x3b\xfb\x6c\x74\xf3\x3e\xf8\x77\x36\x1f\x54\xfd" "\x30\xe7\x2d\x70\x46\x25\x9d\xfb\xe6\x3e\x53\x11\x93\xe5\xb3\x3c\xbf\x3a" "\x54\x4e\x6a\x5c\xc7\x65\xe3\xb4\x07\x00\x00\x00\x00\x87\xd5\x38\x7c\x95" "\xe7\xb6\x63\x3b\xd6\xe3\xdc\x71\x0c\x07\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\xfe\x5f\xe5\xcf\xff\x4f\xf2\xa9\x52\xa4\x9b\x91\x4c\x46\x44\x3d\x22" "\x6a\xf9\xb6\xc8\xd3\x67\xd0\xf0\x07\x21\x7e\x3c\xd1\x59\x3e\x39\xfe\xc1" "\x00\x00\x00\x00\x00\x00\x00\xc0\xb1\x7b\x79\x3b\xb6\x63\x3d\xce\x15\xeb" "\x3b\x49\xf6\x9b\xff\x2b\xa5\xdf\xf8\xbf\x12\xef\xc4\x6a\x2c\xc6\x4a\x5c" "\x8b\xf5\x68\xc5\x5a\xac\xc5\x4a\xcc\x44\xc4\x54\xa9\xa1\xda\x7a\x6b\x6d" "\x6d\x65\x26\xab\x19\x71\x61\x40\xcd\x1b\xf1\x51\x9f\x9a\x37\x0e\x1e\xe3" "\xcd\x23\xde\x67\x00\x00\x00\x00\x00\x00\x00\x38\xe3\xea\x43\xf2\xef\x8d" "\xef\xdf\xf6\xdb\x58\xe8\xfd\xfe\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x67\x41\x12\x31\xd6\x59\x64\xd3\x85\x22\x3d\x15\x95\x6a\x44\xd4" "\x8b\x72\x1b\x11\x1f\x45\x44\xed\x74\x47\x7b\x28\x49\xbf\x8d\x4f\x4e\x7e" "\x1c\x00\x00\x00\xf0\x4c\xea\xbb\x57\x93\xfa\x08\x75\x9e\x7b\x37\xb6\x63" "\x3d\xce\x15\xeb\x3b\x49\xf6\x99\xff\x62\xf6\x79\xb9\x1e\xef\xc4\x72\xac" "\xc5\x52\xac\x45\x3b\x16\xe3\x76\xfe\x19\x3a\xfd\xd4\x5f\xd9\xda\x9c\x6d" "\x6f\x6d\xce\xde\x4f\xa7\xfd\xed\xfe\xe8\xb3\x43\x0d\x3d\x6b\x31\x3a\xdf" "\x3d\xf4\xef\xf9\xa5\xac\x44\x23\xee\xc4\x52\xb6\xe5\x5a\xdc\x8a\x24\x76" "\x32\x95\xbc\x95\x97\xb6\x36\x67\xd3\xe5\xfd\xfe\xe3\x7a\x9c\x8e\x29\xf9" "\x61\x6e\xc0\x68\xc6\x4a\xe9\xdb\xe9\xec\xd2\x87\x59\xfa\x8f\xbb\xbf\x45" "\xa8\x1e\x6a\x17\x9f\x52\xe5\xc0\x9c\xa9\x2c\x77\xbc\x1b\x91\xe9\x7c\x6c" "\x69\x8d\xf3\x45\x04\xfa\x47\x62\xe8\xd1\xa9\x0e\xec\x69\x26\x2a\xdd\x6f" "\x7e\x2e\x0c\xee\xa9\x7f\xcc\x1f\x0f\xee\x7d\x72\x4f\xa9\xbe\xdf\xdc\x9c" "\x8a\xbd\x91\xb8\x11\x95\xee\x11\xba\x38\x38\x12\x11\xdf\xfc\xfb\x07\xbf" "\xbc\xdb\x5e\xbe\x77\xf7\xce\xea\xd5\xb3\xb3\x4b\x7d\xbd\x3b\xb4\x44\x37" "\x12\xdf\x2d\x2e\x33\xbd\x48\x5c\x1a\x39\x12\x8d\xa3\x1e\xf8\x29\x98\xce" "\xf6\xfd\xc5\xee\xfa\x42\xfc\x34\x7e\x11\x57\xe3\xb3\x89\x37\x62\x25\x96" "\xe2\x57\xd1\x8a\xb5\x58\x6c\x16\xf9\xad\xfc\xf5\x9c\xce\xa7\x06\x47\xea" "\xe3\xc9\xf2\xda\x1b\xc3\x46\x92\x9e\x93\xcd\xee\xf5\xab\xdf\x98\x9a\xb1" "\x6b\x4c\xd1\x8c\x9f\x64\xa9\x56\xbc\x92\x1d\xd3\x73\xb1\x14\x49\x3c\x88" "\x88\xc5\x78\x2d\xfb\xbb\x11\x33\xdd\xab\x41\xef\x08\xbf\x38\xc2\x59\x5f" "\x19\xe1\x4a\x5b\x72\xe5\x5b\xd9\xa2\x1b\xa6\x18\xf0\xda\xf8\xeb\x68\x4d" "\x1e\x95\x34\xae\xe7\x4b\x71\x2d\x5f\x73\xa7\xb2\xbc\xf2\x96\x5e\x94\x9e" "\xef\x1b\xa5\xe2\x5e\x57\xba\x36\xd6\x63\xd4\x28\x55\xbf\x91\x27\xd2\x16" "\x7e\x37\xf0\xfe\x70\xd2\xf6\x46\x62\xa6\x14\x89\x17\x0e\x7a\xbd\x74\x42" "\xfa\x97\x9d\x74\xbe\xda\x5e\xbe\xb7\x72\xb7\xf5\xf6\x88\xfd\xbd\x9a\x2f" "\xd3\xf3\xe8\x0f\x67\xea\x2e\x51\x8b\xc7\xf1\x7c\xd4\xf3\x9d\x3b\x9f\xcd" "\x93\xec\x9c\x9a\xce\x8e\xfe\x0b\xdd\x3b\xec\xee\x78\xd5\xb2\x5f\x5c\x8a" "\x77\x1f\x95\xbd\x79\x3f\xfb\x53\xb7\x5e\xe7\x4c\xfd\x79\x3c\x88\xdb\xbb" "\xce\xd4\xef\xc5\x5c\xcc\xc5\x7c\xd6\xd2\xc5\xac\xf4\xf8\xbe\x3b\x56\x9a" "\x77\xa9\xdb\x52\x39\x6f\x36\xcb\x4b\xdf\x69\x55\xbb\x3f\xec\x94\xdf\x6f" "\x3d\x88\x76\xe7\xfd\x10\x00\x67\xdb\xe4\xb7\x27\x6b\x8d\xff\x36\xfe\xd5" "\x78\xbf\xf1\xfb\xc6\xdd\xc6\xeb\xf5\x1f\x4f\x7c\x7f\xe2\x72\x2d\xc6\xff" "\x39\xfe\x83\xea\xf4\xd8\xab\x95\xcb\xc9\xdf\xe2\xfd\xf8\x4d\xef\xf3\x3f" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\xf0\xf4\x56\x1f\x3e\xba\xd7\x6a\xb7\x17\x57\xfa\x27" "\x2a\xfd\xb3\x92\xc1\xb5\x5a\xed\x9d\xe2\x41\x62\x03\xca\xec\x4a\x24\xf9" "\xa3\x72\x46\x28\x9c\xac\x3e\x7c\xb4\x33\xb4\xc1\xc1\x89\x89\x7c\x78\x4f" "\x59\xfd\x28\x13\xc5\x63\xd4\x86\x17\x6e\x1e\xe3\x30\x92\x8d\xbd\xc7\xab" "\x3e\xfc\x58\x14\x4f\x79\x1a\xa1\x8b\x64\x5f\xc0\xd3\xca\x4f\x3d\xe6\xa2" "\xe7\xde\x96\xf1\x33\x70\x28\xf7\x26\x9a\x47\xd7\x60\xf1\x82\x2d\x65\x8d" "\xfe\xea\xfd\xcf\xd7\x3a\x95\x1b\xfd\x8e\xd7\x58\x44\xf4\xab\x35\xe4\xc2" "\x31\xb6\xab\x45\xe0\x0b\xe8\xfa\xda\xfd\xb7\xaf\xaf\x3e\x7c\xf4\x9d\xa5" "\xfb\xad\xb7\x16\xdf\x5a\x5c\x1e\x9f\x9b\x9b\x9f\x9e\x9f\x7b\x6d\xf6\xfa" "\x9d\xa5\xf6\xe2\x74\x67\x5e\xaa\x70\x22\x0f\xbf\x05\x4e\x42\xf9\xed\x44" "\x57\x2d\x22\x5e\x1e\x5e\xd7\xcd\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x4e\xc7\x49\xfc\x2f\xc4\x69\xef\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xc5\xb6\x70\x35\xaa" "\x4f\x22\x89\x99\xe9\x6b\xd3\xe9\xfa\xd6\xe6\x6c\x3b\x9d\x8a\x74\xaf\x64" "\x35\x22\x2a\x11\x91\xfc\x3a\x22\xf9\x47\xc4\xcd\xe8\x4c\x31\x55\x6a\x2e" "\x39\xa8\x9f\xf7\x96\xe6\xdf\xfc\xe4\xf3\xad\x4f\x7b\x6d\x55\x8b\xf2\x95" "\x88\x8d\x03\xeb\x8d\x66\x23\x9f\xa2\x19\x11\x63\xf9\xf2\xa8\xda\xbb\x35" "\xbc\xbd\x5a\x2f\x39\xd1\x27\x3b\xe9\x46\x26\x0d\xd8\x95\x22\x70\x70\xda" "\xfe\x17\x00\x00\xff\xff\x8d\x7c\xe8\x90", 1774); syz_mount_image(/*fs=*/0x20000000, /*dir=*/0x20002380, /*flags=MS_LAZYTIME|MS_NOSUID|MS_NODIRATIME*/ 0x2000802, /*opts=*/0x200023c0, /*chdir=*/2, /*size=*/0x6ee, /*img=*/0x20001000); memcpy((void*)0x200000c0, "./file0\000", 8); memcpy((void*)0x20000240, "./" "file0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000", 251); syscall(__NR_rename, /*old=*/0x200000c0ul, /*new=*/0x20000240ul); } 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; }