// 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; retry: while (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW) == 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, MNT_DETACH | UMOUNT_NOFOLLOW) == 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, MNT_DETACH | UMOUNT_NOFOLLOW)) 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, MNT_DETACH | UMOUNT_NOFOLLOW)) 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); } } void execute_one(void) { memcpy((void*)0x20000040, "ext4\000", 5); memcpy((void*)0x20000500, "./file1\000", 8); memcpy((void*)0x200002c0, "errors=remount-ro", 17); *(uint8_t*)0x200002d1 = 0x2c; memcpy((void*)0x200002d2, "sysvgroups", 10); *(uint8_t*)0x200002dc = 0x2c; memcpy((void*)0x200002dd, "nojournal_checksum", 18); *(uint8_t*)0x200002ef = 0x2c; memcpy((void*)0x200002f0, "auto_da_alloc", 13); *(uint8_t*)0x200002fd = 0x3d; sprintf((char*)0x200002fe, "0x%016llx", (long long)7); *(uint8_t*)0x20000310 = 0x2c; memcpy((void*)0x20000311, "nobarrier", 9); *(uint8_t*)0x2000031a = 0x2c; memcpy((void*)0x2000031b, "resgid", 6); *(uint8_t*)0x20000321 = 0x3d; sprintf((char*)0x20000322, "0x%016llx", (long long)0); *(uint8_t*)0x20000334 = 0x2c; memcpy((void*)0x20000335, "dioread_nolock", 14); *(uint8_t*)0x20000343 = 0x2c; memcpy((void*)0x20000344, "auto_da_alloc", 13); *(uint8_t*)0x20000351 = 0x2c; memcpy((void*)0x20000352, "usrquota", 8); *(uint8_t*)0x2000035a = 0x2c; *(uint8_t*)0x2000035b = 0; memcpy( (void*)0x20000ec0, "\x78\x9c\xec\xdd\xdf\x6b\x5b\xd7\x1d\x00\xf0\xef\xbd\xb6\xb2\xfc\x70\x66" "\x67\xdb\x43\x16\x58\x16\x96\x0c\x27\x6c\x91\xec\x78\x49\xcc\x1e\xb2\x0c" "\xc6\xf2\x14\xd8\x96\xbd\x67\x9e\x2d\x1b\x63\xd9\x32\x96\x9c\xc4\x26\x0c" "\x87\xfd\x01\x83\x31\xb6\xc1\x9e\xf6\xb4\x97\x41\xff\x80\x42\xc9\x9f\x50" "\x0a\x81\xf6\xbd\xb4\xa5\xa5\xb4\x49\xfb\xd0\x87\xb6\x2a\x92\xae\xd2\xc4" "\x95\x62\x97\x28\xbe\x8e\xfd\xf9\xc0\xc9\x3d\xe7\x5e\x49\xdf\xef\x89\xd1" "\xd5\x39\xf7\x1e\xa4\x00\xf6\xad\x53\x11\x71\x35\x22\x06\x22\xe2\x5c\x44" "\x0c\x67\xfb\xd3\xac\x5c\x6b\x36\x36\xda\x8f\x7b\xf4\xf0\xee\x74\xb3\x24" "\xd1\x68\xdc\xf8\x28\x89\x24\xdb\xd7\x79\xad\x24\xdb\x1e\x69\x3f\x25\x0e" "\x46\xc4\x1f\xae\x45\xfc\x39\xf9\x66\xdc\xda\xda\xfa\xc2\x54\xa5\x52\x5e" "\xc9\xda\xa5\xfa\xe2\x72\xa9\xb6\xb6\x7e\x7e\x7e\x71\x6a\xae\x3c\x57\x5e" "\x9a\x98\x18\xbf\x34\x79\x79\xf2\xe2\xe4\x58\x5f\xfa\x39\x12\x11\x57\x7e" "\xf3\xde\x3f\xff\xf6\xbf\xdf\x5e\x79\xed\xe7\xb7\xdf\xbe\xf9\xc1\xd9\xbf" "\x34\xd3\x1a\xca\xf2\x7e\xb2\x1f\xfd\xd4\xee\x7a\xa1\xf5\x7f\xd1\x31\x18" "\x11\x2b\x2f\x22\x58\x0e\x06\xb2\x6d\x21\xe7\x3c\x00\x00\xd8\x9e\xe6\x18" "\xff\x7b\x11\xf1\x93\xd6\xf8\x7f\x38\x06\x5a\xa3\x53\x00\x00\x00\x60\x2f" "\x69\xfc\x6a\x28\x3e\x4f\x22\x1a\x00\x00\x00\xc0\x9e\x95\xb6\xd6\xc0\x26" "\x69\x31\x5b\x0b\x30\x14\x69\x5a\x2c\xb6\xd7\xf0\xfe\x20\x0e\xa7\x95\x6a" "\xad\xfe\xb3\xd9\xea\xea\xd2\x4c\x7b\xad\xec\x48\x14\xd2\xd9\xf9\x4a\x79" "\x2c\x5b\x2b\x3c\x12\x85\xa4\xd9\x1e\xcf\xd6\xd8\x76\xda\x17\x36\xb5\x27" "\x22\xe2\x58\x44\xfc\x63\xf8\x50\xab\x5d\x9c\xae\x56\x66\xf2\xbe\xf8\x01" "\x00\x00\x00\xfb\xc4\x91\x4d\xf3\xff\x4f\x87\xdb\xf3\x7f\x00\x00\x00\x60" "\x8f\x19\xc9\x3b\x01\x00\x00\x00\xe0\x85\x33\xff\x07\x00\x00\x80\xbd\xcf" "\xfc\x1f\x00\x00\x00\xf6\xb4\xdf\x5d\xbf\xde\x2c\x8d\xce\xef\x5f\xcf\xdc" "\x5a\x5b\x5d\xa8\xde\x3a\x3f\x53\xae\x2d\x14\x17\x57\xa7\x8b\xd3\xd5\x95" "\xe5\xe2\x5c\xb5\x3a\xd7\xfa\xce\xbe\xc5\xad\x5e\xaf\x52\xad\x2e\xff\x22" "\x96\x56\xef\x94\xea\xe5\x5a\xbd\x54\x5b\x5b\xbf\xb9\x58\x5d\x5d\xaa\xdf" "\x9c\x7f\xea\x27\xb0\x01\x00\x00\x80\x1d\x74\xec\xc7\xf7\xdf\x4a\x22\x62" "\xe3\x97\x87\x5a\xa5\xe9\x40\xde\x49\x01\xbb\xcf\xbb\x79\x27\x00\xf4\xd3" "\x40\xde\x09\x00\xb9\x19\xcc\x3b\x01\x20\x37\x85\xbc\x13\x00\x72\x97\x6c" "\x71\xbc\xe7\xe2\x9d\xd7\xfb\x9f\x0b\x00\x00\xf0\x62\x8c\xfe\xb0\xf7\xfd" "\x7f\xd7\x06\x60\x6f\x4b\xf3\x4e\x00\x00\xd8\x71\xee\xff\xc3\xfe\x55\xb0" "\x02\x10\xf6\xbd\xef\x6e\x71\xfc\xf9\xef\xff\x37\x1a\xdf\x2a\x21\x00\x00" "\xa0\xef\x86\x5a\x25\x49\x8b\xd9\xbd\xc0\xa1\x48\xd3\x62\x31\xe2\x68\xeb" "\x67\x01\x0a\xc9\xec\x7c\xa5\x3c\x96\xcd\x0f\xde\x1c\x2e\x7c\xa7\xd9\x1e" "\x6f\x3d\x33\xd9\x72\xcd\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xd0\xd6\x68\x24\xd1\x00\x00\x00\x00\xf6" "\xb4\x88\xf4\xfd\xa4\xf5\x6d\xfe\x11\xa3\xc3\x67\x86\x36\x5f\x1f\x38\x90" "\x7c\x36\xdc\xda\x46\xc4\xed\xff\xdc\xf8\xd7\x9d\xa9\x7a\x7d\x65\xbc\xb9" "\xff\xe3\xc7\xfb\xeb\xff\xce\xf6\x5f\xc8\xe3\x0a\x06\x00\x00\x00\xb0\x59" "\x67\x9e\xde\x99\xc7\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x40\x3f\x3d\x7a\x78\x77\xba\x53\x76\x32\xee\x87" "\xbf\x8e\x88\x91\x6e\xf1\x07\xe3\x60\x6b\x7b\x30\x0a\x11\x71\xf8\x93\x24" "\x06\x9f\x78\x5e\x12\x11\x03\x7d\x88\xbf\x71\x2f\x22\x8e\x77\x8b\x9f\x34" "\xd3\x8a\x91\x2c\x8b\x6e\xf1\x0f\xe5\x18\x3f\x8d\x88\x23\x7d\x88\x0f\xfb" "\xd9\xfd\xe6\xf9\xe7\x6a\xb7\xf7\x5f\x1a\xa7\x5a\xdb\xee\xef\xbf\xc1\xac" "\x3c\xaf\xde\xe7\xbf\xf4\xf1\xf9\x6f\xa0\xc7\xf9\xe7\xe8\x36\x63\x9c\x78" "\xf0\x4a\xa9\x67\xfc\x7b\x11\x27\x06\xbb\x9f\x7f\x3a\xf1\x93\x1e\xf1\x4f" "\x6f\x33\xfe\x9f\xfe\xb8\xbe\xde\xeb\x58\xe3\xbf\x11\xa3\x5d\x3f\x7f\x92" "\xa7\x62\x95\xea\x8b\xcb\xa5\xda\xda\xfa\xf9\xf9\xc5\xa9\xb9\xf2\x5c\x79" "\x69\x62\x62\xfc\xd2\xe4\xe5\xc9\x8b\x93\x63\xa5\xd9\xf9\x4a\x39\xfb\xb7" "\x6b\x8c\xbf\xff\xe8\xd5\x2f\x9f\xd5\xff\xc3\x3d\xe2\x8f\x6c\xd1\xff\x33" "\xdb\xec\xff\x17\x0f\xee\x3c\xfc\x7e\xbb\x5a\xe8\x16\xff\xec\xe9\xee\x9f" "\xbf\xc7\x7b\xc4\x4f\xb3\xcf\xbe\x9f\x66\xf5\xe6\xf1\xd1\x4e\x7d\xa3\x5d" "\x7f\xd2\xc9\xff\xbf\x71\xf2\x59\xfd\x9f\xe9\xd1\xff\xad\xfe\xfe\x67\xb7" "\xd9\xff\x73\xbf\xff\xeb\x3b\xdb\x7c\x28\x00\xb0\x03\x6a\x6b\xeb\x0b\x53" "\x95\x4a\x79\xe5\x25\xab\x34\xc7\x1f\xbb\x20\x0d\x95\x5d\x59\x69\x8e\x4f" "\x77\x41\x1a\x2f\x75\x25\xef\x33\x13\x00\x00\xd0\x6f\x5f\x0f\xfa\xf3\xce" "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\xaf" "\x9d\xf8\x3a\xb1\xcd\x31\x37\xf2\xe9\x2a\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\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\x33\x7d\x15" "\x00\x00\xff\xff\x91\xf3\xd1\x9b", 1214); syz_mount_image(/*fs=*/0x20000040, /*dir=*/0x20000500, /*flags=MS_REC|MS_NODIRATIME|MS_NOATIME|0x100*/ 0x4d00, /*opts=*/0x200002c0, /*chdir=*/0x12, /*size=*/0x4c5, /*img=*/0x20000ec0); memcpy((void*)0x20000040, "ext4\000", 5); memcpy((void*)0x20000500, "./file1\000", 8); memcpy((void*)0x200002c0, "errors=remount-ro", 17); *(uint8_t*)0x200002d1 = 0x2c; memcpy((void*)0x200002d2, "sysvgroups", 10); *(uint8_t*)0x200002dc = 0x2c; memcpy((void*)0x200002dd, "nojournal_checksum", 18); *(uint8_t*)0x200002ef = 0x2c; memcpy((void*)0x200002f0, "auto_da_alloc", 13); *(uint8_t*)0x200002fd = 0x3d; sprintf((char*)0x200002fe, "0x%016llx", (long long)7); *(uint8_t*)0x20000310 = 0x2c; memcpy((void*)0x20000311, "nobarrier", 9); *(uint8_t*)0x2000031a = 0x2c; memcpy((void*)0x2000031b, "resgid", 6); *(uint8_t*)0x20000321 = 0x3d; sprintf((char*)0x20000322, "0x%016llx", (long long)0); *(uint8_t*)0x20000334 = 0x2c; memcpy((void*)0x20000335, "dioread_nolock", 14); *(uint8_t*)0x20000343 = 0x2c; memcpy((void*)0x20000344, "auto_da_alloc", 13); *(uint8_t*)0x20000351 = 0x2c; memcpy((void*)0x20000352, "usrquota", 8); *(uint8_t*)0x2000035a = 0x2c; *(uint8_t*)0x2000035b = 0; memcpy( (void*)0x20000ec0, "\x78\x9c\xec\xdd\xdf\x6b\x5c\x59\x1d\x00\xf0\xef\xbd\xc9\xd4\xfe\x48\x4d" "\xaa\x3e\xd4\x82\xb5\xd8\x4a\x5a\xb4\x33\x49\x63\xdb\xe0\x43\xad\x20\xf6" "\xa9\xa0\xd6\xf7\x1a\x93\x49\x08\x99\x64\x42\x66\xd2\x36\xa1\x48\x8a\x7f" "\x80\x20\xa2\x82\x4f\x3e\xf9\x22\xf8\x07\x08\xd2\x3f\x41\x84\x82\xfb\xbe" "\xec\x2e\xbb\x2c\xbb\xed\xee\xc3\x3e\xec\xee\x2c\x33\x73\xa7\x9b\x66\x67" "\x9a\x94\x4e\x72\xdb\xe4\xf3\x81\x93\x7b\xce\x9d\x1f\xdf\xef\x49\x98\x3b" "\xe7\xdc\x7b\x32\x13\xc0\x81\x75\x26\x22\xae\x47\xc4\x40\x44\x5c\x88\x88" "\xe1\x6c\x7f\x9a\x95\x1b\xcd\xc6\x46\xfb\x7e\x4f\x1e\xdf\x9f\x6e\x96\x24" "\x1a\x8d\x5b\x1f\x24\x91\x64\xfb\x3a\xcf\x95\x64\xdb\x63\xed\x87\xc4\xe1" "\x88\xf8\xd5\x8d\x88\xdf\x26\x5f\x8d\x5b\x5b\x5b\x5f\x98\xaa\x54\xca\x2b" "\x59\xbb\x54\x5f\x5c\x2e\xd5\xd6\xd6\x2f\xce\x2f\x4e\xcd\x95\xe7\xca\x4b" "\x13\x13\xe3\x57\x26\xaf\x4e\x5e\x9e\x1c\xeb\x4b\x3f\x47\x22\xe2\xda\xcf" "\xde\xf9\xf3\x1f\xfe\xf1\xf3\x6b\xff\xf9\xe1\xdd\x37\x6f\xbf\x77\xfe\x77" "\xcd\xb4\x86\xb2\xbc\x37\xf7\xa3\x9f\xda\x5d\x2f\xb4\x7e\x17\x1d\x83\x11" "\xb1\xb2\x1b\xc1\x72\x30\x90\x6d\x0b\x39\xe7\x01\x00\xc0\xce\x34\xc7\xf8" "\xdf\x88\x88\xef\xb5\xc6\xff\xc3\x31\xd0\x1a\x9d\x02\x00\x00\x00\xfb\x49" "\xe3\x27\x43\xf1\x69\x12\xd1\x00\x00\x00\x00\xf6\xad\xb4\xb5\x06\x36\x49" "\x8b\xd9\xba\xd4\xa1\x48\xd3\x62\xb1\xbd\x86\xf7\x5b\x71\x34\xad\x54\x6b" "\xf5\x1f\xcc\x56\x57\x97\x66\xda\x6b\x65\x47\xa2\x90\xce\xce\x57\xca\x63" "\xd9\x5a\xe1\x91\x28\x24\xcd\xf6\x78\xb6\xc6\xb6\xd3\xbe\xb4\xa5\x3d\x11" "\x11\x27\x22\xe2\x4f\xc3\x47\x5a\xed\xe2\x74\xb5\x32\x93\xf7\xc9\x0f\x00" "\x00\x00\x38\x20\x8e\x6d\x9a\xff\xa7\x11\xf1\xf1\x70\x7b\xfe\x0f\x00\x00" "\x00\xec\x33\x23\x79\x27\x00\x00\x00\x00\xec\x3a\xf3\x7f\x00\x00\x00\xd8" "\xff\xcc\xff\x01\x00\x00\x60\x5f\xfb\xc5\xcd\x9b\xcd\xd2\xe8\x7c\xff\xf5" "\xcc\x9d\xb5\xd5\x85\xea\x9d\x8b\x33\xe5\xda\x42\x71\x71\x75\xba\x38\x5d" "\x5d\x59\x2e\xce\x55\xab\x73\xad\xcf\xec\x5b\xdc\xee\xf9\x2a\xd5\xea\xf2" "\x8f\x62\x69\xf5\x5e\xa9\x5e\xae\xd5\x4b\xb5\xb5\xf5\xdb\x8b\xd5\xd5\xa5" "\xfa\xed\xf9\x67\xbe\x02\x1b\x00\x00\x00\xd8\x43\x27\xbe\xfb\xf0\x8d\x24" "\x22\x36\x7e\x7c\xa4\x55\x9a\x0e\xe5\x9d\x14\xb0\x27\x92\x17\xb9\xf3\xdb" "\xbb\x97\x07\xb0\xf7\x06\xf2\x4e\x00\xc8\xcd\x60\xde\x09\x00\xb9\x29\xe4" "\x9d\x00\x90\xbb\xed\xce\x03\xf4\x5c\xbc\xf3\xdf\xfe\xe7\x02\x00\x00\xec" "\x8e\xd1\x6f\xf7\xbe\xfe\xef\xdc\x00\xec\x6f\x69\xde\x09\x00\x00\x7b\xce" "\xf5\x7f\x38\xb8\x0a\x56\x00\xc2\x81\xf7\xf5\x6d\x6e\x7f\xf9\xeb\xff\x8d" "\xc6\x0b\x25\x04\x00\x00\xf4\xdd\x50\xab\x24\x69\x31\xbb\x16\x38\x14\x69" "\x5a\x2c\x46\x1c\x6f\x7d\x2d\x40\x21\x99\x9d\xaf\x94\xc7\xb2\xf9\xc1\xff" "\x87\x0b\x5f\x6b\xb6\xc7\x5b\x8f\x4c\x5e\xec\x7f\x87\x01\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x6b\x34" "\x92\x68\x00\x00\x00\x00\xfb\x5a\x44\xfa\x6e\xd2\xfa\x34\xff\x88\xd1\xe1" "\x73\x43\x5b\xcf\x0f\x1c\x4a\x3e\x19\x6e\x6d\x23\xe2\xee\xdf\x6e\xfd\xe5" "\xde\x54\xbd\xbe\x32\xde\xdc\xff\xe1\xd3\xfd\xf5\xbf\x66\xfb\x2f\xe5\x71" "\x06\x03\x00\x00\x00\xd8\xaa\x33\x4f\xef\xcc\xe3\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\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x9f\x9e\x3c\xbe" "\x3f\xdd\x29\x7b\x19\xf7\xfd\x9f\x46\xc4\x48\xb7\xf8\x83\x71\xb8\xb5\x3d" "\x1c\x85\x88\x38\xfa\x51\x12\x83\x9b\x1e\x97\x44\xc4\x40\x1f\xe2\x6f\x3c" "\x88\x88\x93\xdd\xe2\x27\xcd\xb4\x62\x24\xcb\xa2\x5b\xfc\x23\x39\xc6\x4f" "\x23\xe2\x58\x1f\xe2\xc3\x41\xf6\xb0\x79\xfc\xb9\xde\xed\xf5\x97\xc6\x99" "\xd6\xb6\xfb\xeb\x6f\x30\x2b\x2f\xab\xf7\xf1\x2f\x7d\x7a\xfc\x1b\xe8\x71" "\xfc\x39\xbe\xc3\x18\xa7\x1e\xfd\xab\xd4\x33\xfe\x83\x88\x53\x83\xdd\x8f" "\x3f\x9d\xf8\x49\x8f\xf8\x67\x77\x18\xff\x37\xbf\x5e\x5f\xef\x75\x5b\xe3" "\xef\x11\xa3\x5d\xdf\x7f\x92\x67\x62\x95\xea\x8b\xcb\xa5\xda\xda\xfa\xc5" "\xf9\xc5\xa9\xb9\xf2\x5c\x79\x69\x62\x62\xfc\xca\xe4\xd5\xc9\xcb\x93\x63" "\xa5\xd9\xf9\x4a\x39\xfb\xd9\x35\xc6\x1f\xbf\xf3\xef\xcf\x9f\xd7\xff\xa3" "\x3d\xe2\x8f\x6c\xd3\xff\x73\x3b\xec\xff\x67\x8f\xee\x3d\xfe\x66\xbb\x5a" "\xe8\x16\xff\xfc\xd9\xee\xef\xbf\x27\x7b\xc4\x4f\xb3\xf7\xbe\xef\x67\xf5" "\xe6\xed\xa3\x9d\xfa\x46\xbb\xbe\xd9\xe9\x7f\xfe\xef\xf4\xf3\xfa\x3f\xd3" "\xa3\xff\xdb\xfd\xfd\xcf\xef\xb0\xff\x17\x7e\xf9\xfb\xb7\x76\x78\x57\x00" "\x60\x0f\xd4\xd6\xd6\x17\xa6\x2a\x95\xf2\xca\x6b\x56\x69\x8e\x3f\x5e\x81" "\x34\x54\x5e\xc9\x4a\x73\x7c\xfa\x0a\xa4\xf1\x5a\x57\xf2\x3e\x32\x01\x00" "\x00\xfd\xf6\xe5\xa0\x3f\xef\x4c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\xe0\xe0\xda\x8b\x8f\x13\xdb\x1a\x73\x23\x9f\xae\x02" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x3c\xd7\x17\x01\x00\x00\xff\xff\x9e\x80\xd1\x9e", 1222); syz_mount_image( /*fs=*/0x20000040, /*dir=*/0x20000500, /*flags=MS_REC|MS_RDONLY|MS_NOSUID|MS_NODIRATIME|0x544*/ 0x4d47, /*opts=*/0x200002c0, /*chdir=*/0x12, /*size=*/0x4c5, /*img=*/0x20000ec0); } 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; }