// https://syzkaller.appspot.com/bug?id=330c57bb9492535fc883e94c3bbb1c74aa8e29af // 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 void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } 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; } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; retry: const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW; while (umount2(dir, umount_flags) == 0) { } dp = opendir(dir); if (dp == NULL) { if (errno == EMFILE) { exit(1); } exit(1); } struct dirent* ep = 0; while ((ep = readdir(dp))) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; char filename[FILENAME_MAX]; snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); while (umount2(filename, umount_flags) == 0) { } struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } int i; for (i = 0;; i++) { if (unlink(filename) == 0) break; if (errno == EPERM) { int fd = open(filename, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno != EBUSY || i > 100) exit(1); if (umount2(filename, umount_flags)) exit(1); } } closedir(dp); for (int i = 0;; i++) { if (rmdir(dir) == 0) break; if (i < 100) { if (errno == EPERM) { int fd = open(dir, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno == EBUSY) { if (umount2(dir, umount_flags)) exit(1); continue; } if (errno == ENOTEMPTY) { if (iter < 100) { iter++; goto retry; } } } exit(1); } } 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"); if (symlink("/dev/binderfs", "./binderfs")) { } } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); 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; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; memcpy((void*)0x20000b40, "nilfs2\000", 7); memcpy((void*)0x20000000, "./bus\000", 6); memcpy( (void*)0x20000b80, "\x78\x9c\xec\xdd\x4f\x8c\x1b\x57\xfd\x00\xf0\x37\xde\xf5\xa6\x69\x92\xc6" "\xe9\x2f\xf9\x75\x49\x4b\x49\x28\xb4\xe5\x4f\x77\x9b\xcd\x12\xfe\x44\x90" "\x54\xcd\x85\xa8\xa9\xb8\x55\xaa\xb8\x44\x49\x5a\x22\xd2\x80\x48\xa5\xd2" "\x2a\x12\x49\x4e\xdc\x68\x15\x85\x2b\x7f\xc4\xa9\x97\x0a\x10\x12\xbd\xa0" "\xa8\x27\x2e\x95\x68\x24\x2e\x3d\x15\x0e\x1c\x88\x82\x54\x89\x03\x14\x12" "\xa3\xf5\xce\xf3\x7a\xbf\x6b\x77\xec\xcd\xee\xda\xbb\xfb\xf9\x48\xcf\xcf" "\x6f\xde\xd8\xef\x8d\x3d\x33\x1e\xbf\x99\x79\x2f\x01\x9b\x56\xad\xf5\x38" "\x3b\x3b\x59\xa4\x74\xed\xed\xab\xc7\xfe\xfe\xe8\xdf\xb6\xce\x4d\x39\xd2" "\x9e\xa3\xd1\x7a\x1c\xef\x48\xd5\x53\x4a\x45\x99\x1e\x0f\xef\xf7\xc1\xd8" "\x7c\x7c\xfb\xc3\x8b\xa7\xba\xc5\x45\x9a\x69\x3d\xe6\x74\x7a\xf6\x56\xfb" "\xb5\xdb\x52\x4a\x97\xd2\xbe\x74\x3d\x35\xd2\xde\x6b\x37\xde\x78\x77\xe6" "\x99\x13\x97\x8f\x5f\xd9\xff\xde\x9b\x87\x6f\xae\xce\xd2\x03\x00\xc0\xe6" "\xf2\xad\xeb\x87\x67\xf7\xfc\xe5\x4f\x0f\xee\xfa\xe8\xad\x87\x8f\xa6\x2d" "\xed\xe9\xf9\xf8\xbc\x51\xa6\xb7\x97\xc7\xfd\x47\xcb\x03\xff\x7c\xfc\x5f" "\x4b\x8b\xd3\x45\x47\xe8\x34\x11\xe6\x1b\x2f\x43\xad\xfb\x6c\x4b\xfe\x5f" "\xe4\xf9\xea\x65\x3c\x16\xf2\x63\xf9\x13\xa1\xfc\x7a\x8f\xf9\xb6\x84\xf9" "\xc6\xc2\x7c\x63\x1d\xd3\xba\x2d\x37\xac\x67\x79\x3d\x6e\xa4\xa2\x36\xb5" "\x28\x5d\xab\x4d\x4d\xcd\xff\x27\x4f\xad\xff\xf5\x13\xc5\xd4\xf9\xb3\xe7" "\x5e\xb8\x30\xa4\x8a\x02\x2b\xee\x9f\x9f\x4a\x29\xed\x1b\x20\xd4\x06\x9c" "\x5f\x58\xcd\xf0\x4a\xab\xb1\x76\xd5\xcb\x69\xce\xaf\x2c\xc3\x5f\xde\x15" "\x0f\x97\xbb\x2f\xd7\xf8\x0a\x96\x51\x1b\xf6\x32\x7e\x5c\x68\xee\x1c\xee" "\xfe\x07\x20\x8b\xe7\x0b\x97\xb8\x14\x5b\x16\xee\x4e\xfb\xdd\xc6\xfb\x2b" "\xff\xd6\x53\xb5\xee\xaf\x87\x15\xb0\xd6\xeb\xbf\xf2\xd7\x57\xf9\xbf\xba" "\x6c\x8f\xc3\xca\xd9\xa8\x6b\x53\x5e\xae\xbc\x1d\x6d\x2f\xd3\xf1\x3c\x42" "\xbc\x7e\x69\xd0\xed\x3f\xbf\x5f\x3c\x1f\x51\xef\x51\xaf\xcb\x21\xdd\xeb" "\x3c\xc2\x7a\x39\xbf\xd0\xab\x9e\x63\x6b\x5c\x8f\xe5\xea\x55\xff\xb8\x5e" "\x6c\x54\x5f\x2f\xe3\xfc\x39\x7c\x23\xe4\x77\x6e\x3f\xf1\x3b\x5d\x2f\xdf" "\x31\xd0\xdd\xbf\x06\x6d\xff\x5f\xed\x90\x0d\xbb\x1e\x9b\x34\xb4\xda\x83" "\x47\xa0\x1e\xc2\x1a\x7d\xdf\x43\xdc\xf7\x00\xa3\x2d\x5e\x37\xd7\x2c\xe5" "\xfc\x78\x5d\x5f\xcc\xdf\x52\x91\x7f\x4f\x45\xfe\xd6\x8a\xfc\x7b\x2b\xf2" "\xb7\x55\xe4\xc3\x66\xf6\xdb\x97\x7f\x92\x5e\x2f\x16\xfe\xe7\x2f\xfc\xa7" "\xbf\xaf\xb5\xe9\x0c\xda\x1e\x96\xdb\xd9\x76\xe4\x77\x19\xb0\x3e\xb1\x3d" "\x32\x96\x1f\xaf\xeb\x8d\xe5\x2f\xc9\x1f\x48\xad\xb2\xfc\x25\x42\xf9\x8b" "\xae\x27\x3e\x72\x57\x95\x81\x55\xf7\xfb\x93\xcf\x9d\xf9\xca\xe9\xe7\x6f" "\xcc\x5f\xff\x5f\xb4\xd7\xff\x3b\xe5\xfa\xbe\xaf\x4c\x37\xca\x6d\xeb\x7a" "\x39\x43\x6e\x2f\x8c\xed\xea\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x6e\xfc\xf9\x9d\x2f\xbf\x3f\x7f\xff\xff\xc2\xfd" "\x7f\xf9\xfe\xff\x7c\xe5\x6f\xbe\xff\xff\xc7\xe1\xfe\xff\x78\x9f\x7c\xbe" "\x0f\x3e\xdf\x07\xb8\xab\x4b\x7e\x6b\x9e\xd0\xc1\xea\x44\x98\xaf\x5e\x86" "\xff\x0b\xf5\xdd\x1d\xca\xd9\x13\x5e\xf7\xff\x65\xdc\x1e\xc7\xaf\xbc\xff" "\x3f\x17\x17\xfb\x75\xcd\xf5\x79\x20\x4c\x8f\xfd\xf7\xe6\xf9\x42\x77\x02" "\x4b\xfa\x40\x9d\x08\x7d\x90\xc4\xf1\x02\x3f\x5d\xc6\x57\xca\xf8\x97\x09" "\x86\xa8\xd8\xda\x7d\x72\x19\x97\xeb\x6d\xbb\xbb\x89\xd8\xbf\x75\x5e\xd7" "\x73\xff\x14\xfa\xa5\x58\x9f\xf2\xf7\x96\xd7\x86\xdc\x8f\x49\xbe\xff\xbb" "\x57\xbf\x4e\x79\xff\xbf\x6b\x0d\xea\xc8\xca\xfb\xf8\xdb\x00\x9b\xcd\x95" "\xb8\x9d\x70\xd8\xcb\x08\x74\xf7\x8f\xd8\xff\x77\x1a\x7e\x9f\xc4\x83\x84" "\xf6\xf1\xc6\x08\xd4\x45\x10\x86\x14\x9a\xcd\xe6\x8f\x96\xb5\x1d\x34\x9b" "\x46\xf1\x00\x46\xc3\xb0\xc7\xff\xcc\xed\x9e\x39\x3e\xff\x87\x6f\xde\x33" "\x17\xf2\x6c\xb7\x9e\x5a\xbc\xbf\x8c\xfd\x97\xc2\xdd\x18\xf5\xf1\x27\xd7" "\xa2\xfc\x7a\x45\xf9\xdd\x5b\x2c\x57\xae\xfc\x34\xc2\x9f\xff\x4a\x8f\xff" "\xd9\xee\x0c\xb9\xef\xfd\x5f\x18\x31\xaf\xd1\x7f\x59\x9d\x6d\xc3\xff\xfe" "\xd9\xcd\xf7\x3b\x8a\x4d\x7b\xfb\x2d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2a\xf2\x3f\x59\x91\xbf\xbf\x22\xff\xe1" "\x8a\xfc\x38\x6e\x63\xcc\xbf\x3f\xb4\xeb\xc7\xfc\x47\x2a\x5e\xff\x99\x8a" "\xfc\xcf\x56\xe4\x3f\x5a\x91\xff\x78\x45\xfe\xe7\x2a\xf2\x37\xba\x7c\x3f" "\xca\x66\x5d\x7e\xd8\xcc\xe2\xfd\x79\x7d\x6e\xff\xa3\x7e\xd8\x02\xf4\x21" "\x9f\xff\xe9\xb5\xfd\xef\xae\xc8\x07\xd6\xaf\x9f\xbe\x75\xe0\xe9\xe7\x7f" "\xf3\xed\xc6\xfc\xfd\xff\x13\xed\xf6\x90\x7c\x1e\xef\x68\x99\xae\x97\x3f" "\xfa\x3f\x2c\xd3\xf1\xbc\x77\xea\x48\xcf\xe5\xbd\x53\xa6\xff\x1a\xf2\x1d" "\x38\xc0\xe8\x88\xfd\x67\xc4\xdf\xf7\xc7\x2a\xf2\x81\xf5\x2b\x5f\xe7\x65" "\xfb\x86\x4d\xa8\xe8\xde\x63\x4f\xbf\xfd\x56\xf5\x3a\xce\x67\x7d\xf9\x7c" "\x19\x7f\xa1\x8c\xbf\x58\xc6\x4f\x94\xf1\x54\x19\x4f\x97\xf1\x81\x32\x9e" "\x59\xa3\xfa\xb1\x3a\x9e\xfe\xf5\xef\x0e\xbf\x5e\x2c\xfc\xdf\xdf\x19\xf2" "\xfb\xbd\x9e\x3c\xde\x0f\x14\xfb\x89\x3a\xd8\x67\x7d\x62\xfb\xc0\xa0\xd7" "\xb3\xc7\x7e\xfc\x06\x75\xb7\xe5\x57\x5c\x2e\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30" "\x72\x6a\xad\xc7\xd9\xd9\xc9\x22\xa5\x6b\x6f\x5f\x3d\xf6\xdc\x89\xb3\xd3" "\x73\x53\x8e\xb4\xe7\x68\xb4\x1e\xc7\x3b\x52\xf5\xf6\xeb\x52\x7a\xb2\x8c" "\xc7\xca\xf8\xe7\xe5\x93\xdb\x1f\x5e\x3c\xd5\x19\xdf\x29\xe3\x22\xcd\xa4" "\x22\x15\xed\xe9\xe9\xd9\x5b\xed\x92\xb6\xa5\x94\x2e\xa5\x7d\xe9\x7a\x6a" "\xa4\xbd\xd7\x6e\xbc\xf1\xee\xcc\x33\x27\x2e\x1f\xbf\xb2\xff\xbd\x37\x0f" "\xdf\x5c\xbd\x4f\x00\x00\x00\x00\x36\xbe\xff\x05\x00\x00\xff\xff\xe0\x58" "\x17\x7b", 2738); syz_mount_image( /*fs=*/0x20000b40, /*dir=*/0x20000000, /*flags=MS_SYNCHRONOUS|MS_SILENT|MS_NOSUID|MS_NOEXEC|0x40*/ 0x805a, /*opts=*/0x20000200, /*chdir=*/0, /*size=*/0xab2, /*img=*/0x20000b80); memcpy((void*)0x20000040, ".\000", 2); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000040ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[0] = res; memcpy((void*)0x20000200, "./bus/file0\000", 12); syscall(__NR_mkdirat, /*fd=*/r[0], /*path=*/0x20000200ul, /*mode=*/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); use_temporary_dir(); loop(); return 0; }