// https://syzkaller.appspot.com/bug?id=82148e8173e51abf3a46e231a7e233950c815ca7 // 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 (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } void execute_one(void) { memcpy((void*)0x20000000, "hfsplus\000", 8); memcpy((void*)0x20000040, "./bus\000", 6); *(uint8_t*)0x20000080 = 0; sprintf((char*)0x20000081, "0x%016llx", (long long)-1); memcpy( (void*)0x20000b00, "\x78\x9c\xec\xdd\xc1\x6f\x1c\x57\x1d\x07\xf0\xef\x6e\x1c\x67\x37\x48\xe9" "\xc6\x4d\xd2\x80\x2a\x61\x15\xa9\x42\x58\x24\xbb\xb6\x44\x52\x2e\x40\x29" "\xc8\x42\x15\xaa\xc4\x81\xb3\x45\x9c\xc4\xca\x26\xad\xec\x2d\x72\x7b\x80" "\x80\x38\x54\x9c\xfa\x27\x94\x83\xff\x01\xc4\xb1\x48\x39\xd0\x1e\xe1\xd4" "\xb3\x51\x8f\x48\xdc\x7d\x73\x35\xb3\xb3\xf6\xda\xde\xb8\x8e\xed\x78\xb7" "\xed\xe7\x23\xcd\xce\x7b\xf3\xe6\xbd\xfd\xbd\xdf\xcc\x4e\x66\xd6\x8a\x36" "\xc0\x37\xd6\xe2\x5c\xa6\x9e\xa4\x96\xc5\xb9\x37\xd7\x8b\xfa\xe6\xc6\x42" "\x77\x73\x63\xe1\xe1\xa0\x9c\xe4\x42\x92\x7a\xd2\x48\x52\x2b\x36\xff\x23" "\xc9\xe7\xc9\xe3\xf4\x97\x7c\x7b\xd0\x30\xb4\x3e\xe0\xb3\x8f\x1b\xf7\x3e" "\xfd\xf0\x93\x0f\xfa\xb5\x46\xb5\x94\xfb\xd7\x0e\xeb\x77\x34\x3b\xb1\x34" "\xfb\xb1\xa6\x75\x4a\xe3\x15\xe3\xcc\x57\x63\x1e\xdf\xde\x19\xce\x24\x99" "\x3d\x59\x7c\x70\x3a\xb6\x07\xfe\x3b\xb2\xf9\x84\x9f\x4b\x00\x60\x92\xd5" "\x92\x73\xa3\xb6\xb7\x92\x8b\xd5\xcd\x7a\xf1\x1c\xd0\xbf\x2b\x3e\xe9\xfd" "\xf0\x04\x78\x3c\xee\x00\x00\x00\x00\xe0\x0c\xbc\xb0\x95\xad\xac\xe7\xd2" "\xb8\xe3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaf\x92\xea\xf7\xff\x6b" "\xd5\x52\x1f\x94\x67\x53\x1b\xfc\xfe\xff\x74\xb5\x2d\x55\x79\x62\x3d\xb9" "\x76\x84\x7d\xce\x22\x10\x00\x00\x00\x00\x00\x00\x00\x78\xce\xbe\xbb\x95" "\xad\xac\xe7\xd2\xa0\xbe\x5d\x2b\xff\xe6\xff\x4a\x59\xb9\x52\xbe\x7e\x2b" "\xef\x66\x2d\xcb\x59\xcd\x8d\xac\x67\x2a\x49\x2f\xab\xe9\x24\x69\x0d\x0d" "\x34\xbd\xbe\xd4\xeb\xad\x76\x0e\xe9\xb9\x94\x5e\xd9\x73\x7e\x64\xcf\xf9" "\xb3\x99\x2f\x00\x00\x00\x00\x00\x00\x00\x7c\x4d\xfd\x39\x8b\xbb\x7f\xff" "\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\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x49\x50\x4b\xce\xf5\x57" "\xe5\x72\x65\x50\x6e\xa5\x3e\x95\xa4\x91\x64\xba\xd8\xef\x71\xf2\x9f\x41" "\xf9\xab\xec\xc9\xb8\x03\x00\x00\x00\x80\x33\xf0\xc2\x56\xb6\xb2\x9e\x4b" "\x83\xfa\x76\xad\x7c\xe6\xbf\x56\x3e\xf7\x37\xf2\x6e\x1e\xa5\x97\x95\xf4" "\xd2\xcd\x72\xee\x94\xdf\x05\xf4\x9f\xfa\xeb\x9b\x1b\x0b\xdd\xcd\x8d\x85" "\x87\xc5\x72\x70\xdc\x9f\xfd\xff\x99\xc2\x28\x47\x4c\xff\xbb\x87\xd1\xef" "\x7c\xbd\xdc\xa3\x99\xbb\x59\x29\xb7\xdc\xc8\xef\xf2\x76\xba\xb9\x93\x7a" "\xd9\xb3\x70\x7d\x10\xcf\xe8\xb8\xfe\x54\xc4\x54\xfb\x49\xe5\x88\x91\xdd" "\xa9\xd6\xc5\xcc\x7f\x55\xad\x27\x43\xab\xcc\xc8\xf9\x9d\x8c\xb4\xab\xd8" "\x8a\x6c\x5c\x3e\x3c\x13\xcf\x78\x74\xf6\xbf\x53\x27\xf5\x9d\x6f\x7e\xae" "\x3c\x87\x9c\x5f\xac\xd6\xc5\x7c\xde\x98\xe8\x9c\xcf\x0f\x9d\x7d\xd7\x0e" "\xcf\x44\x32\xf3\xdb\xbf\xde\xba\xdf\x7d\xf4\xe0\xfe\xdd\xb5\xb9\xc9\x99" "\xd2\x31\xed\xcf\xc4\xc2\x50\x26\x5e\xfa\x46\x65\xa2\x5d\x66\xe2\xea\x4e" "\x7d\x31\xbf\xcc\x6f\x32\x97\xd9\xbc\x95\xd5\xac\xe4\xf7\x59\x4a\x2f\xcb" "\x99\xcd\x1b\x65\x69\xa9\x3a\x9f\x8b\xd7\xd6\xe1\x99\xfa\xe9\x9e\xda\x5b" "\x5f\x16\xc9\x74\x75\x5c\xfa\x57\xd1\xa7\xc5\xd4\x18\x19\xd3\x2b\x65\xdf" "\x4b\x59\xc9\xaf\xf3\x76\xee\x94\x47\xb4\x9d\x5b\xb9\x95\xf9\xfc\x28\xaf" "\xa5\xbd\xe7\x08\x5f\x1d\x19\xf7\x1f\xb7\xab\xe6\xf2\x53\x5f\x7f\xb6\x4f" "\xfd\xf7\xbe\x5f\x15\xce\x27\xf9\x45\xb5\x9e\x0c\x45\x5e\x2f\x0f\xe5\x75" "\xf8\x9a\xdb\x2a\xdb\x76\xb7\x64\x28\x4b\x33\xa7\x7f\x6d\x9c\xfa\x4e\x55" "\x28\xce\x9e\xd7\x27\xee\xda\x78\x79\xdf\xbf\x12\x83\x4c\xbc\x78\x78\x26" "\xfe\x56\x9e\x38\x6b\xdd\x47\x0f\x56\xef\x2f\xbd\x73\xc4\xf7\x7b\xb5\x5a" "\x17\x19\xf8\xf9\x81\x4c\x6c\x9f\x3b\xf1\x84\x8e\xad\x38\x5f\x66\x8a\x83" "\x55\xd6\x2e\xef\x39\x5f\x8a\xb6\x17\x47\xb6\x75\xca\xb6\x2b\x3b\x6d\xf5" "\x03\x6d\x57\x77\xda\xbe\xec\x93\x3a\x5d\xdd\xc3\x1d\x1c\x69\xbe\x6c\x7b" "\x69\x64\x5b\xbf\xdf\xf5\xa1\xb6\x51\xf7\x5b\x00\x4c\xbc\x8b\x3f\xb8\x38" "\xdd\xfc\x5f\xf3\xdf\xcd\x8f\x9a\x7f\x69\xde\x6f\xbe\xd9\x78\xfd\xc2\xed" "\x0b\x2f\x4f\xe7\xfc\xbf\xce\xff\x78\xaa\x7d\xee\xd5\xfa\xcb\xb5\xbf\xe7" "\xa3\xfc\x61\xf7\xf9\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\xbe\xb5\xf7\xde\x7f\xb0" "\xd4\xed\x2e\xaf\x2a\x28\x28\x28\xec\x14\xc6\x7d\x65\x02\x9e\xb7\x9b\xbd" "\x87\xef\xdc\x5c\x7b\xef\xfd\x1f\xae\x3c\x5c\xba\xb7\x7c\x6f\xf9\xd1\x6b" "\xed\xdb\xb7\x3b\x9d\xce\xad\xf6\xcd\xbb\x2b\xdd\xe5\xea\x75\xdc\x51\x02" "\x00\xa7\x69\xf7\xa6\x7f\xdc\x91\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x4f\x73\x16\xff\x9d\x78\xdc\x73\x04\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbe\xde\x16\xe7\x32\xf5\x24\xb5" "\x74\xda\x37\xda\x45\x7d\x73\x63\xa1\x5b\x2c\x83\xf2\xee\x9e\x8d\x24\xb5" "\xa2\xf0\xcf\x24\x9f\x27\x8f\xd3\x5f\xd2\x1a\x1a\xae\xf6\xb4\xf7\xf9\xec" "\xe3\xc6\xbd\x4f\x3f\xfc\xe4\x83\x6c\x5f\xa8\xc6\x6a\x0c\xf6\xaf\x1d\xd6" "\xef\x68\xf6\xc4\x52\xdf\x17\xd3\x49\xc7\x9b\x3f\xf1\x78\xbb\x33\x9c\x4d" "\x32\x53\xad\x61\xec\xbe\x08\x00\x00\xff\xff\x08\xc2\x06\x55", 1509); syz_mount_image(/*fs=*/0x20000000, /*dir=*/0x20000040, /*flags=MS_STRICTATIME|MS_SILENT|MS_NOEXEC*/ 0x1008008, /*opts=*/0x20000080, /*chdir=*/1, /*size=*/0x5e2, /*img=*/0x20000b00); memcpy((void*)0x20000140, "hfsplus\000", 8); memcpy((void*)0x20000100, "./bus\000", 6); *(uint16_t*)0x20000180 = 0; *(uint16_t*)0x20000182 = -1; *(uint32_t*)0x20000184 = 0; sprintf((char*)0x20000188, "0x%016llx", (long long)-1); *(uint16_t*)0x2000019a = -1; *(uint8_t*)0x2000019c = -1; sprintf((char*)0x2000019d, "0x%016llx", (long long)-1); memcpy( (void*)0x20000a40, "\x78\x9c\xec\xdd\xcd\x6f\x1c\x67\x1d\x07\xf0\xef\x6c\x36\x4e\x36\x94\xd4" "\x6d\x93\x36\x45\x95\x12\x35\x12\x20\x22\x12\x3b\x56\x0a\x46\x42\x04\x84" "\x90\x0f\x15\xaa\xca\x81\xb3\x95\x38\x8d\x95\x4d\x5a\x6c\x17\xb9\x15\xa2" "\xe6\xfd\xda\x43\xfe\x80\x72\xf0\x8d\x13\x12\xf7\x48\xe5\xc2\x05\x6e\xbd" "\xfa\x58\x09\xc1\xa5\x17\xcc\x85\x45\x33\x3b\x6b\x6f\xed\x5d\xbf\x14\xdb" "\x6b\x97\xcf\x27\x9a\x7d\x9e\x99\x67\xe6\x79\x7e\xcf\x6f\x67\x76\x76\xd7" "\x8a\x36\xc0\xff\xad\x99\x6b\x69\x3e\x49\x91\x99\x6b\xaf\x2e\x97\xeb\x6b" "\xab\x53\xed\xb5\xd5\xa9\x87\xbd\x7a\x92\x33\x49\x1a\x49\xb3\x2a\x8a\x14" "\xff\xea\x74\x3a\x1f\x26\xb7\xd3\x5d\xf2\x62\x92\xa2\xee\xae\x18\x36\xce" "\xe3\xf9\xe9\xd7\x3f\xfa\x64\xed\xe3\xee\x5a\xb3\x5e\xaa\xfd\x1b\x3b\x1d" "\xb7\x37\x2b\xf5\x92\x2b\x49\x4e\xd5\xe5\x41\xf5\x77\x67\xb7\xfe\xce\xee" "\xd6\x5d\xb1\x31\xc3\x32\x61\x57\x7b\x89\x83\x51\x3b\x9d\xa4\x53\xf9\xc7" "\xe3\xee\x96\x9f\xfc\xe5\xa9\x8d\x96\x3e\xad\x41\x47\xef\x7a\xe6\x03\x27" "\x40\xd1\xbd\x6f\x6e\x33\x9e\x9c\xab\x2f\xf4\xf2\x7d\x40\xf7\xae\xd8\xbd" "\x67\x9f\x68\x2b\xa3\x0e\x00\x00\x00\x00\x8e\xc0\xd3\xeb\x59\xcf\x72\xce" "\x8f\x3a\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x49\xea\xdf\xff\x2f" "\xea\xa5\xd1\xab\x5f\x49\xd1\xfb\xfd\xff\xb1\x7a\x5b\xea\xfa\xf1\x72\x79" "\x7f\xbb\x3f\x39\xac\x38\x00\x00\x00\x00\x00\x00\x00\xe0\x08\x5d\x5e\xcf" "\x7a\x96\x73\xbe\xb7\xde\x29\xaa\xbf\xf9\xbf\x5c\xad\x5c\xa8\x1e\xbf\x90" "\xb7\xb3\x98\xb9\x2c\xe4\x7a\x96\x33\x9b\xa5\x2c\x65\x21\x93\x49\xc6\xfb" "\x3a\x1a\x5b\x9e\x5d\x5a\x5a\x98\xdc\xc3\x91\x37\x07\x1e\x79\x73\x97\x40" "\xcf\xd4\x65\xeb\x60\xe6\x0d\x00\x00\x00\x00\x00\x00\x00\x9f\x33\xbf\xcc" "\xcc\xe6\xdf\xff\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\xe0\x38\x28" "\x92\x53\xdd\xa2\x5a\x2e\xf4\xea\xe3\x69\x34\x93\x9c\x4d\x32\x56\xee\xb7" "\x92\xfc\xad\x57\x3f\xc9\x9e\x8c\x3a\x00\x00\x00\x00\x38\x02\x4f\xaf\x67" "\x3d\xcb\x39\xdf\x5b\xef\x14\xd5\x67\xfe\xe7\xab\xcf\xfd\x67\xf3\x76\x1e" "\x65\x29\xf3\x59\x4a\x3b\x73\xb9\x5b\x7d\x17\xd0\xfd\xd4\xdf\x58\x5b\x9d" "\x6a\xaf\xad\x4e\x3d\x2c\x97\xed\xfd\x7e\xf7\x9f\xfb\x0a\xa3\xea\x31\xdd" "\xef\x1e\x06\x8f\x7c\xa9\xda\xa3\x95\x7b\x99\xaf\xb6\x5c\xcf\x9d\xbc\x99" "\x76\xee\xa6\x51\x1d\x59\xba\xd4\x8b\x67\x70\x5c\xbf\x28\x63\x2a\xbe\x53" "\xdb\x63\x64\x77\xeb\xb2\x9c\xf9\xfb\x75\xb9\xcd\x7b\xfb\x9a\xec\x30\xfb" "\xfc\x32\x65\xbc\xca\xc8\xe9\x8d\x8c\x4c\xd4\xb1\x95\xd9\x78\x66\xe7\x4c" "\xec\xf3\xd9\xd9\x3a\xd2\x64\x1a\x1b\xc1\x5e\xd8\x32\xd2\x96\x49\x7c\xa6" "\x9c\x9f\xab\xcb\x72\x3e\xbf\x1d\x96\xf3\x91\xd8\x9a\x89\x9b\x7d\x67\xdf" "\xf3\x3b\xe7\x3c\xf9\xca\x9f\xfe\xf0\xe3\xfb\xed\x47\x0f\xee\xdf\x5b\xbc" "\x76\x7c\xa6\xb4\x37\xa7\xea\xb2\x53\x3d\xb6\xb6\x67\x62\xaa\x2f\x13\x2f" "\x7c\x9e\x33\xb1\xcd\x44\x95\x89\x8b\x1b\xeb\x33\xf9\x41\x7e\x94\x6b\xb9" "\x92\xd7\xb2\x90\xf9\xfc\x34\xb3\x59\xca\x5c\xae\xe4\xfb\x55\x6d\xb6\x3e" "\x9f\x8b\xbe\x4b\x7e\x48\xa6\x6e\x7f\x6a\xed\xb5\xdd\x22\x19\xab\xcf\xd0" "\xee\x93\xb5\xbf\x98\x5e\xae\x8e\x3d\x9f\xf9\xfc\x30\x6f\xe6\x6e\xe6\xf2" "\x4a\xf5\xef\x66\x26\xf3\x8d\xdc\xca\xad\x4c\xf7\x3d\xc3\x17\xf7\xf0\x4a" "\xdb\x18\x72\xd5\x77\xbe\x38\x30\xf8\xab\x5f\xad\x2b\xad\x24\xbf\xab\xcb" "\xe3\xa1\xcc\xeb\x33\x7d\x79\xed\x7f\xcd\x1d\xaf\xda\xfa\xb7\x6c\x66\xe9" "\xd9\x83\xbf\x1f\x35\xbf\x54\x57\xca\x31\x7e\x55\x97\xc7\xc3\xd6\x4c\x4c" "\xf6\x65\xe2\xb9\x9d\x33\xf1\xfb\xea\x65\x65\xb1\xfd\xe8\xc1\xc2\xfd\xd9" "\xb7\xf6\x36\xdc\xb3\xef\xd7\x95\xf2\x3a\xfa\xcd\xb1\xba\x4b\x94\xe7\xcb" "\xb3\xe5\x93\x55\xad\x7d\xfa\xec\x28\xdb\x9e\x1b\xd8\x36\x59\xb5\x5d\xd8" "\x68\x6b\x6c\x6b\xbb\xb8\xd1\xd6\xbd\x52\x57\x86\x5e\xa9\x63\xf5\x7b\xb8" "\xe6\xb7\xa7\xb7\xdd\xb1\xca\xb6\x17\x06\x8e\x32\x55\xb5\x5d\xea\x6b\x1b" "\xf4\x7e\x0b\x80\x63\xef\xdc\xd7\xce\x8d\xb5\xfe\xde\xfa\x6b\xeb\x83\xd6" "\xaf\x5b\xf7\x5b\xaf\x9e\xfd\xde\x99\x6f\x9e\x79\x69\x2c\xa7\xff\x7c\xfa" "\x5b\xcd\x89\x53\x5f\x6e\xbc\x54\xfc\x31\x1f\xe4\xe7\x9b\x9f\xff\x01\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x80\xcf\x6e\xf1\x9d\x77\x1f\xcc\xb6\xdb\x73\x0b\x5b\x2a\x9d" "\x4e\xe7\xbd\x21\x4d\x87\x52\xf9\xcf\xd1\x8c\xd5\xfb\x39\xb3\xa1\xfb\x9c" "\x3e\xf0\x41\x5f\x7c\x2a\x39\x9a\x1c\x6e\xaf\x8c\x25\x39\xf2\x41\x07\x56" "\xfe\xdd\xe9\x74\xea\x2d\xc5\x71\x88\x67\xe7\x4a\xa7\x74\x26\x9d\x43\x1f" "\xab\x99\x64\x50\xd3\xe5\xd1\x27\x61\xc4\x2f\x4c\xc0\xa1\xbb\xb1\xf4\xf0" "\xad\x1b\x8b\xef\xbc\xfb\xf5\xf9\x87\xb3\x6f\xcc\xbd\x31\xf7\x68\xfa\xd6" "\xad\xe9\x89\xe9\x5b\xaf\x4c\xdd\xb8\x37\xdf\x9e\x9b\xe8\x3e\x8e\x3a\x4a" "\xe0\x30\x6c\xde\xf4\x47\x1d\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb0" "\x57\x47\xf1\xdf\x09\x86\x8f\x7e\xf6\x28\xa7\x0a\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\x50\x33" "\xd7\xd2\x7c\x92\x22\x93\x13\xd7\x27\xca\xf5\xb5\xd5\xa9\x76\xb9\xf4\xea" "\x9b\x7b\x36\x93\x34\x92\x14\x3f\x4b\x8a\x0f\x93\xdb\xe9\x2e\x19\xef\xeb" "\xae\x18\x36\xce\xe3\xf9\xe9\xd7\x3f\xfa\x64\xed\xe3\xcd\xbe\x9a\xbd\xfd" "\x1b\x3b\x1d\xb7\x37\x2b\xf5\x92\x2b\x49\x4e\xd5\xe5\x41\xf5\x77\xe7\x7f" "\xee\xaf\xd8\x98\x61\x99\xb0\xab\xbd\xc4\xc1\xa8\xfd\x37\x00\x00\xff\xff" "\xdb\x73\x06\xf7", 1624); syz_mount_image( /*fs=*/0x20000140, /*dir=*/0x20000100, /*flags=MS_LAZYTIME|MS_STRICTATIME|MS_NODIRATIME|MS_NOATIME*/ 0x3000c00, /*opts=*/0x20000180, /*chdir=*/1, /*size=*/0x658, /*img=*/0x20000a40); memcpy((void*)0x20000080, "./file1\000", 8); syscall(__NR_unlink, /*path=*/0x20000080ul); } 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); loop(); return 0; }