// https://syzkaller.appspot.com/bug?id=b3d4ed3e41b3085ce97f4504f4183e3f99115fb2 // 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 279 #endif #ifndef __NR_mmap #define __NR_mmap 222 #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; const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW; retry: 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 (;;) { 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; } remove_dir(cwdbuf); } } void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x200002c0, "ext4\000", 5); memcpy((void*)0x20000080, "./file1\000", 8); *(uint8_t*)0x20000240 = 0; memcpy( (void*)0x20000980, "\x78\x9c\xec\xdd\xcf\x6f\x23\x57\x1d\x00\xf0\xef\x4c\xe2\xdd\xec\x6e\x8a" "\x5d\x40\x08\x2a\xd1\x56\xb4\x68\xb7\x82\xb5\x37\x0d\x6d\x23\x84\xa0\x5c" "\xe0\x54\x09\x28\xf7\x10\x12\x27\x8a\x62\xc7\x51\xec\x94\x4d\x54\xd1\x54" "\xfc\x07\x08\x09\x24\x4e\x9c\xb8\x20\xf1\x07\x20\x55\x3d\xf0\x07\xa0\x4a" "\x95\xe0\x82\x38\x20\x40\x20\x04\x5b\x38\x20\x01\x9d\xca\xf6\xb8\xbb\x71" "\xec\x24\xbb\x9b\xd8\xc9\xfa\xf3\x91\x26\x7e\x6f\x7e\x7d\xdf\x1b\xcb\xcf" "\xf3\xc6\x2f\x33\x01\x4c\xac\xa7\x23\xe2\xe5\x88\x98\x8a\x88\xe7\x22\xa2" "\x98\xcf\x4f\xf3\x69\xb1\x9d\xd9\xef\xae\xf7\xde\x9d\xd7\x97\xdb\x53\x12" "\x59\xf6\xea\x3f\x92\x48\xf2\x79\xbd\x7d\xb5\xf3\xd3\x11\x71\xad\xbb\x49" "\xcc\x44\xc4\xb7\xbe\x1e\xf1\xdd\xe4\x70\xdc\xe6\xee\xde\xc6\x52\xad\x56" "\xdd\xce\xf3\x95\x56\x7d\xab\xd2\xdc\xdd\xbb\xb9\x5e\x5f\x5a\xab\xae\x55" "\x37\xe7\xe7\xe7\x5e\x5c\x78\x69\xe1\x85\x99\x5b\x59\xee\xa1\xea\x59\xea" "\x25\x7e\xfe\xb5\x2f\xbf\xf5\xf9\xef\xfd\x71\xf1\x6f\x37\xbe\xdf\x2e\xd6" "\x97\x3e\x11\x85\xe8\xab\xc7\x69\xea\x56\xbd\xd0\x39\x16\x3d\xed\x63\xb4" "\x7d\x16\xc1\xc6\x64\xba\x53\x43\x00\x00\x2e\x82\xf6\x39\xfe\x47\x23\xe2" "\x33\x9d\xf3\xff\x62\x4c\x75\xce\xe6\xfa\x4c\x8d\xa3\x64\x00\x00\x00\xc0" "\x69\xc9\xbe\x32\x1b\xff\x4b\x22\x32\x00\x00\x00\xe0\x91\x95\x46\xc4\x6c" "\x24\x69\x39\x1f\x0b\x30\x1b\x69\x7a\x29\xbf\x36\xf0\xf1\xb8\x9a\xd6\x1a" "\xcd\xd6\xe7\x56\x1b\x3b\x9b\x2b\xed\x65\x11\xa5\x28\xa4\xab\xeb\xb5\xea" "\xad\x7c\xac\x70\x29\x0a\x49\x3b\x3f\x97\x8f\xb1\xed\xe5\x9f\xef\xcb\xcf" "\x47\xc4\xe3\x11\xf1\xa3\xe2\x95\x4e\xbe\xbc\xdc\xa8\xad\x8c\xf9\xda\x07" "\x00\x00\x00\x4c\x8a\x6b\x7d\xfd\xff\x7f\x17\xd3\x4e\xfa\x78\x03\xfe\x4f" "\x00\x00\x00\x00\x38\xbf\x4a\x43\x33\x00\x00\x00\xc0\xa3\x42\x97\x1f\x00" "\x00\x00\x1e\x7d\xfd\xfd\xff\xb7\xc6\x54\x0e\x00\x00\x00\xe0\x4c\x7c\xe3" "\x95\x57\xda\x53\xd6\x7b\xfe\xf5\xca\x6b\xbb\x3b\x1b\x8d\xd7\x6e\xae\x54" "\x9b\x1b\xe5\xfa\xce\x72\x79\xb9\xb1\xbd\x55\x5e\x6b\x34\xd6\x3a\xf7\xec" "\xab\x1f\xb7\xbf\x5a\xa3\xb1\xf5\x85\xd8\xdc\xb9\x5d\x69\x55\x9b\xad\x4a" "\x73\x77\x6f\xb1\xde\xd8\xd9\x6c\x2d\xae\x1f\x78\x04\x36\x00\x00\x00\x30" "\x42\x8f\x3f\xf5\xf6\xef\x92\x88\xd8\xff\xe2\x95\xce\x14\xf9\x7d\x00\x01" "\x0e\xf8\xf3\xb8\x0b\x00\x9c\xa6\xa9\x71\x17\x00\x18\x1b\x77\xf1\x86\xc9" "\x55\xb8\x9f\x95\x2f\x9d\x5d\x39\x80\xf1\x49\x8e\x59\x6e\xf0\x0e\x00\x00" "\x5c\x7c\xd7\x3f\x75\xf8\xf7\xff\x5e\x37\xff\xbe\xae\x0d\x00\x17\x8e\xb1" "\x3e\x00\x30\x79\x1e\xea\xf7\x7f\x1d\x04\xb8\xd0\x0a\x46\x00\xc2\x44\x4b" "\x23\xe2\x23\xdd\xe4\xe5\x61\xeb\x0c\xfd\xfd\xff\x37\x27\x8d\x92\x65\x11" "\xef\x14\xef\x9d\xe3\xf4\x01\x00\x00\x46\x6b\xb6\x33\x25\x69\x39\xef\x07" "\xcc\x46\x9a\x96\xcb\x11\x8f\x45\xa4\xa5\x28\x24\xab\xeb\xb5\xea\xad\xbc" "\x7f\xf0\xdb\x62\xe1\x72\x3b\x3f\xd7\xd9\x32\x39\x76\xcc\x30\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\x95" "\x65\x49\x64\x0f\xe8\xf2\x03\x6f\x09\x00\x00\x00\x8c\x52\x44\xfa\xd7\xa4" "\x73\x37\xff\x88\xeb\xc5\x67\x67\xfb\xaf\x0f\x5c\x4a\xfe\x53\x8c\xbf\xe4" "\x99\x9f\xbe\xfa\xe3\xdb\x4b\xad\xd6\xf6\x5c\x7b\xfe\x3f\x3b\xcf\xf2\xba" "\x14\x11\xad\x9f\xe4\xf3\x9f\x1f\xfa\xf8\x30\x00\x00\x00\xe0\xb4\x25\xfb" "\x43\x17\x75\xfb\xe9\xf9\xeb\xdc\x48\x4b\x05\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\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\x04\x78\xef\xce\xeb\xcb" "\xbd\x69\x94\x71\xff\xfe\xd5\x88\x28\x0d\x8a\x3f\x1d\x33\x9d\xd7\x99\x28" "\x44\xc4\xd5\x7f\x25\x31\x7d\xcf\x76\x49\x44\x4c\x9d\x42\xfc\xfd\x37\x23" "\xe2\x93\x83\xe2\x27\xf1\x7e\x96\x65\xa5\xbc\x14\x83\xe2\x5f\x39\xe3\xf8" "\xa5\xce\xa1\x19\x1c\x3f\x8d\x88\x6b\xa7\x10\x1f\x26\xd9\xdb\xed\xf6\xe7" "\xe5\x41\x9f\xbf\x34\x9e\xee\xbc\x0e\xfe\xfc\x4d\xe7\xd3\xc3\x1a\xde\xfe" "\xa5\x1f\xb6\x7f\x53\x43\xda\x9f\xc7\x0e\xed\xad\x3e\x30\xc6\x13\xef\xfe" "\xb2\x32\x34\xfe\x9b\x11\x4f\x4c\x0f\x6e\x7f\x7a\xf1\x93\x21\xf1\x9f\x39" "\xb4\xb7\xff\x66\x59\x76\x38\xc6\x77\xbe\xbd\xb7\x37\x2c\x7e\xf6\xb3\x88" "\xeb\x03\xbf\x7f\x92\x03\xb1\x2a\xad\xfa\x56\xa5\xb9\xbb\x77\x73\xbd\xbe" "\xb4\x56\x5d\xab\x6e\xce\xcf\xcf\xbd\xb8\xf0\xd2\xc2\x0b\x0b\xb7\x2a\xab" "\xeb\xb5\x6a\xfe\x77\x60\x8c\x1f\x7e\xfa\x57\xef\x1f\x55\xff\xab\x03\xe2" "\xff\xe1\xf7\xdd\xf6\xf7\xa8\xfa\x3f\x3b\x6c\xa7\x7d\xfe\xff\xee\xed\x3b" "\x1f\xeb\x26\x0b\x83\xe2\xdf\x78\x66\xe0\xf7\xef\x4c\x0c\x89\x9f\xe6\xdf" "\x7d\x9f\xcd\xd3\xed\xe5\xd7\x7b\xe9\xfd\x6e\xfa\x5e\x4f\xfe\xe2\x9d\x27" "\x8f\xaa\xff\xca\x90\xe3\x7f\xdc\xfb\x7f\xe3\x84\xf5\x7f\xee\x9b\x3f\xf8" "\xd3\x09\x57\x05\x00\x46\xa0\xb9\xbb\xb7\xb1\x54\xab\x55\xb7\x8f\x48\xcc" "\x9c\x60\x9d\x8b\x98\xf8\xf5\xcc\xb9\x28\xc6\x7d\x26\xb2\x37\xba\xef\xdc" "\x39\x29\x4f\xe1\x41\x37\x6f\x9f\xad\xde\x9d\xd3\xab\xd5\xb8\xab\x73\x30" "\x91\x8d\x26\xd6\x53\xb1\x31\x15\xe7\xa4\xca\x1f\x26\x8e\x69\x38\xb2\xae" "\x37\xce\xbc\x85\x02\x00\x00\x4e\xcb\xdd\x93\xfe\x71\x97\x04\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x26\xd7\x28\x6e\x27\xd6" "\x1f\x73\x7f\x3c\x55\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\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\xd2\x07\x01\x00\x00\xff\xff" "\x95\x16\xe3\xec", 1318); syz_mount_image( /*fs=*/0x200002c0, /*dir=*/0x20000080, /*flags=MS_LAZYTIME|MS_SYNCHRONOUS|MS_STRICTATIME|MS_RDONLY*/ 0x3000011, /*opts=*/0x20000240, /*chdir=*/1, /*size=*/0x526, /*img=*/0x20000980); memcpy((void*)0x20000100, "ext4\000", 5); memcpy((void*)0x20000080, "./file1\000", 8); *(uint8_t*)0x20000000 = 0; memcpy( (void*)0x20001600, "\x78\x9c\xec\xdd\x41\x6f\x23\x57\x1d\x00\xf0\xff\x8c\xe3\x6d\x76\x37\xc5" "\x2e\x20\x54\x2a\x51\x2a\x5a\x94\xad\x60\xed\xa4\xa1\x6d\x84\x10\x94\x0b" "\x9c\x2a\x01\xe5\x1e\x42\xe2\x44\x51\xec\x38\x8a\x9d\xb2\x89\x2a\x48\xc5" "\x37\x40\x48\x20\x71\xe2\xc4\x05\x89\x0f\x80\x54\xf5\xc0\x07\x40\x95\x2a" "\xc1\x05\x71\x40\x80\x40\x08\xb6\x70\x40\x02\x76\x90\xed\x31\x9b\x75\xec" "\x24\x74\x93\x38\x1b\xff\x7e\xd2\x5b\xbf\xf7\x66\x3c\xff\xf7\x26\xf2\xf3" "\xcc\xf8\xed\x4c\x00\x13\xeb\x99\x88\x78\x25\x22\x0a\x11\xf1\x7c\x44\x94" "\xf2\xfa\x34\x4f\x4b\x9d\xc2\x41\x6f\xbd\xf7\xee\xbe\xb1\xd2\x49\x49\x64" "\xd9\x6b\x7f\x4d\x22\xc9\xeb\xfa\xdb\xea\x94\xa7\x22\xe2\x66\xef\x2d\x31" "\x1d\x11\x5f\xfb\x72\xc4\x37\x93\xa3\x71\x5b\x7b\xfb\x9b\xcb\xf5\x7a\x6d" "\x27\x2f\x57\xdb\x8d\xed\x6a\x6b\x6f\xff\xf6\x46\x63\x79\xbd\xb6\x5e\xdb" "\x5a\x58\x98\x7f\x69\xf1\xe5\xc5\x17\x17\xe7\xb2\xdc\x43\xf5\xb3\xdc\xcf" "\xfc\xe4\x4b\x9f\x7f\xeb\xd3\xdf\xfa\xdd\xd2\x9f\x6f\x7d\xbb\xd3\xac\xcf" "\x7d\x24\x8a\x31\xd0\x8f\xb3\xd4\xeb\x7a\xb1\xbb\x2f\xfa\x3a\xfb\x68\xe7" "\x3c\x82\x8d\x41\x21\xef\x4f\x71\xdc\x0d\x01\x00\xe0\x54\x3a\xc7\xf8\x1f" "\x8c\x88\x4f\x74\x8f\xff\x4b\x51\xe8\x1e\xcd\x0d\x28\x8c\xa3\x65\x00\x00" "\x00\xc0\x59\xc9\xbe\x30\x13\xff\x4e\x22\x32\x00\x00\x00\xe0\xca\x4a\x23" "\x62\x26\x92\xb4\x92\xcf\x05\x98\x89\x34\xbd\x96\x5f\x1b\xf8\x70\xdc\x48" "\xeb\xcd\x56\xfb\x53\x6b\xcd\xdd\xad\xd5\xce\xb2\x88\x72\x14\xd3\xb5\x8d" "\x7a\x6d\x2e\x9f\x2b\x5c\x8e\x62\xd2\x29\xcf\xe7\x73\x6c\xfb\xe5\x17\x06" "\xca\x0b\x11\xf1\x44\x44\x7c\xbf\x74\xbd\x5b\xae\xac\x34\xeb\xab\x63\xbe" "\xf6\x01\x00\x00\x00\x93\xe2\xe6\xc0\xf9\xff\x3f\x4a\x69\x37\x7f\xb2\x21" "\xff\x4f\x00\x00\x00\x00\xb8\xbc\xca\x23\x0b\x00\x00\x00\xc0\x55\xe1\x94" "\x1f\x00\x00\x00\xae\xbe\xc1\xf3\xff\xb7\xc6\xd4\x0e\x00\x00\x00\xe0\x5c" "\x7c\xe5\xd5\x57\x3b\x29\xeb\x3f\xff\x7a\xf5\xf5\xbd\xdd\xcd\xe6\xeb\xb7" "\x57\x6b\xad\xcd\x4a\x63\x77\xa5\xb2\xd2\xdc\xd9\xae\xac\x37\x9b\xeb\xdd" "\x7b\xf6\x35\x4e\xda\x5e\xbd\xd9\xdc\xfe\x4c\x6c\xed\xde\xa9\xb6\x6b\xad" "\x76\xb5\xb5\xb7\xbf\xd4\x68\xee\x6e\xb5\x97\x36\x1e\x78\x04\x36\x00\x00" "\x00\x70\x81\x9e\xf8\xf8\xdb\xbf\x4e\x22\xe2\xe0\xb3\xd7\xbb\x29\xf2\xfb" "\x00\x02\x3c\xe0\x0f\xe3\x6e\x00\x70\x96\x0a\xe3\x6e\x00\x30\x36\xee\xe2" "\x0d\x93\xab\x38\xee\x06\x00\x63\x97\x9c\xb0\xdc\xe4\x1d\x00\x00\x78\xf4" "\xcd\x7e\xf4\xe8\xef\xff\xfd\xe7\xff\xbb\x36\x00\x57\x9b\xb9\x3e\x00\x30" "\x79\xfc\xfe\x0f\x93\xab\x68\x06\x20\x4c\xb4\x34\x22\x3e\xd0\xcb\x3e\x36" "\x6a\x9d\x91\xbf\xff\xff\xf2\xb4\x51\xb2\x2c\xe2\x9d\xd2\xe1\x1a\xd7\x17" "\x01\x00\xe0\x62\xcd\x74\x53\x92\x56\xf2\xf3\x80\x99\x48\xd3\x4a\x25\xe2" "\xf1\x88\xb4\x1c\xc5\x64\x6d\xa3\x5e\x9b\xcb\xcf\x0f\x7e\x55\x2a\x3e\xd6" "\x29\xcf\x77\xdf\x99\x9c\x38\x67\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe8\xc9\xb2\x24\x32\x00\x00\x00" "\xe0\x4a\x8b\x48\xff\x94\x74\xef\xe6\x1f\x31\x5b\x7a\x6e\x66\xf0\xfa\xc0" "\xb5\xe4\x9f\xa5\xf8\x63\x5e\xf8\xd1\x6b\x3f\xb8\xb3\xdc\x6e\xef\xcc\x77" "\xea\xff\xd6\x7d\x96\xd7\xb5\x88\x68\xff\x30\xaf\x7f\x61\xe4\xe3\xc3\x00" "\x00\x00\x80\xb3\x96\x1c\x8c\x5c\xd4\x3b\x4f\xcf\x5f\xe7\x2f\xb4\x55\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x4c\x80\xf7\xee\xbe\xb1\xd2\x4f\x17\x19\xf7\x2f\x5f\x8c\x88\xf2\xb0\xf8" "\x53\x31\xdd\x7d\x9d\x8e\x62\x44\xdc\xf8\x7b\x12\x53\x87\xde\x97\x44\x44" "\xe1\x0c\xe2\x1f\xbc\x19\x11\x4f\x0e\x8b\x9f\xc4\xbd\x2c\xcb\xca\x79\x2b" "\x86\xc5\xbf\x7e\xce\xf1\xcb\xdd\x5d\x33\x3c\x7e\x1a\x11\x37\xcf\x20\x3e" "\x4c\xb2\xb7\x3b\xe3\xcf\x2b\xc3\x3e\x7f\x69\x3c\xd3\x7d\x1d\xfe\xf9\x9b" "\xca\xd3\xc3\x1a\x3d\xfe\xa5\x79\xe4\x27\xbb\xe3\xdc\xb0\xf1\xe7\xf1\x23" "\x5b\x6b\x0c\x8d\xf1\xd4\xbb\x3f\xab\x8e\x8c\xff\x66\xc4\x53\x53\xc3\xc7" "\x9f\xfe\xf8\x9b\x8c\x88\xff\xec\x91\xad\xfd\x2b\xcb\xb2\xa3\x31\xbe\xf1" "\xf5\xfd\xfd\x51\xf1\xb3\x1f\x47\xcc\x0e\xfd\xfe\x49\x1e\x88\x55\x6d\x37" "\xb6\xab\xad\xbd\xfd\xdb\x1b\x8d\xe5\xf5\xda\x7a\x6d\x6b\x61\x61\xfe\xa5" "\xc5\x97\x17\x5f\x5c\x9c\xab\xae\x6d\xd4\x6b\xf9\xbf\x43\x63\x7c\xef\x63" "\x3f\xbf\x77\x5c\xff\x6f\x0c\x89\xff\xdb\xdf\xf4\xc6\xdf\xe3\xfa\xff\xdc" "\xa8\x8d\x0e\xf8\xcf\xbb\x77\xee\x7e\xa8\x97\x2d\x0e\x8b\x7f\xeb\xd9\xa1" "\xdf\xbf\xd3\x31\x22\x7e\x9a\x7f\xf7\x7d\x32\xcf\x77\x96\xcf\xf6\xf3\x07" "\xbd\xfc\x61\x4f\xff\xf4\x9d\xa7\x8f\xeb\xff\xea\x88\xfd\x7f\xd2\xdf\xff" "\xd6\x29\xfb\xff\xfc\x57\xbf\xfb\xfb\x53\xae\x0a\x00\x5c\x80\xd6\xde\xfe" "\xe6\x72\xbd\x5e\xdb\x39\x26\x33\x7d\x8a\x75\x1e\xc5\xcc\x2f\xa6\x2f\x45" "\x33\xfe\xcf\x4c\xf6\x9d\xde\x5f\xee\xb2\xb4\xe7\xfd\x66\x3a\x47\xab\xf7" "\x6b\xfa\xbd\xba\x04\x0d\x3b\x94\xc9\x2e\x2c\x56\x21\x2e\x49\x97\xff\x97" "\x19\xeb\xb0\x04\x00\x00\x9c\x83\xfb\x07\xfd\xe3\x6e\x09\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4c\xae\x73\xb8\x79\x58\x21" "\x06\x6a\x06\x63\x1e\x8c\xa7\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc7\xfa\x6f\x00\x00" "\x00\xff\xff\x02\xe1\xdf\x09", 1303); syz_mount_image(/*fs=*/0x20000100, /*dir=*/0x20000080, /*flags=MS_LAZYTIME|MS_SYNCHRONOUS|MS_STRICTATIME*/ 0x3000010, /*opts=*/0x20000000, /*chdir=*/1, /*size=*/0x517, /*img=*/0x20001600); } 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; use_temporary_dir(); loop(); return 0; }