// 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*)0x20000080, "ext4\000", 5); memcpy((void*)0x20000500, "./file1\000", 8); memcpy((void*)0x20000180, "errors=remount-ro", 17); *(uint8_t*)0x20000191 = 0x2c; memcpy((void*)0x20000192, "sysvgroups", 10); *(uint8_t*)0x2000019c = 0x2c; memcpy((void*)0x2000019d, "dioread_lock", 12); *(uint8_t*)0x200001a9 = 0x2c; memcpy((void*)0x200001aa, "init_itable", 11); *(uint8_t*)0x200001b5 = 0x2c; memcpy((void*)0x200001b6, "noauto_da_alloc", 15); *(uint8_t*)0x200001c5 = 0x2c; memcpy((void*)0x200001c6, "resgid", 6); *(uint8_t*)0x200001cc = 0x3d; sprintf((char*)0x200001cd, "0x%016llx", (long long)0); *(uint8_t*)0x200001df = 0x2c; memcpy((void*)0x200001e0, "barrier", 7); *(uint8_t*)0x200001e7 = 0x2c; memcpy((void*)0x200001e8, "init_itable", 11); *(uint8_t*)0x200001f3 = 0x3d; sprintf((char*)0x200001f4, "0x%016llx", (long long)0x100); *(uint8_t*)0x20000206 = 0x2c; memcpy((void*)0x20000207, "usrquota", 8); *(uint8_t*)0x2000020f = 0x2c; *(uint8_t*)0x20000210 = 0; memcpy( (void*)0x20000a00, "\x78\x9c\xec\xdd\xcf\x6b\x1b\xd9\x1d\x00\xf0\xef\x8c\xad\x34\x3f\x9c\x5a" "\x69\x7b\x48\x03\x4d\x43\x93\xe2\x84\x36\x92\x1d\x37\x89\xe9\x21\x4d\xa1" "\x34\xa7\x40\xdb\xf4\x9e\xba\xb6\x6c\x8c\x65\xcb\x58\x72\x12\x9b\x50\x1c" "\xfa\x07\x14\x4a\x69\x0b\x3d\xf5\xd4\x4b\xa1\x7f\x40\xa1\xe4\x4f\x28\x0b" "\x81\xdd\xfb\xb2\xbb\xec\xb2\xec\x26\xbb\x87\x3d\xec\xae\x16\x49\xa3\xfc" "\xf0\x4a\xb1\x43\x64\x0f\xd8\x9f\x0f\x3c\xcf\x7b\x33\x92\xbe\xdf\x67\xa3" "\xd1\xbc\x99\x67\x4d\x00\x07\xd6\x99\x88\xb8\x1e\x11\x43\x11\x71\x21\x22" "\x46\xb3\xf5\x69\x56\x6e\xb4\x1a\x9b\x9d\xc7\x3d\x79\x7c\x7f\xa6\x55\x92" "\x68\x36\x6f\x7d\x94\x44\x92\xad\xeb\xbe\x56\x92\x2d\x8f\x75\x9e\x12\x87" "\x23\xe2\x37\x37\x22\x7e\x9f\x7c\x3d\x6e\x7d\x7d\x63\x71\xba\x5a\xad\xac" "\x66\xed\x72\x63\x69\xa5\x5c\x5f\xdf\xb8\xb8\xb0\x34\x3d\x5f\x99\xaf\x2c" "\x4f\x4e\x4e\x5c\x99\xba\x3a\x75\x79\x6a\x7c\x20\xfd\x2c\x46\xc4\xb5\x5f" "\xbc\xf7\xd7\x3f\xfd\xeb\x97\xd7\xfe\xf7\xe3\xbb\x6f\xdf\xfe\xe0\xfc\x1f" "\x5a\x69\x8d\x64\xdb\x9f\xef\xc7\x20\x75\xba\x5e\x68\xff\x2e\xba\x86\x23" "\x62\x75\x37\x82\xe5\x60\x28\x5b\x16\x72\xce\x03\x00\x80\x9d\x69\x1d\xe3" "\x7f\x2b\x22\x7e\xd0\x3e\xfe\x1f\x8d\xa1\xf6\xd1\x29\x00\x00\x00\xb0\x9f" "\x34\x7f\x36\x12\x9f\x27\x11\x4d\x00\x00\x00\x60\xdf\x4a\xdb\x73\x60\x93" "\xb4\x94\xcd\x05\x18\x89\x34\x2d\x95\x3a\x73\x78\xbf\x13\x47\xd3\x6a\xad" "\xde\xf8\xd1\x5c\x6d\x6d\x79\xb6\x33\x57\xb6\x18\x85\x74\x6e\xa1\x5a\x19" "\xcf\xe6\x0a\x17\xa3\x90\xb4\xda\x13\xd9\x1c\xdb\x6e\xfb\x52\x44\x24\xc5" "\x67\xed\xc9\x88\x38\x11\x11\x7f\x19\x3d\xd2\x6e\x97\x66\x6a\xd5\xd9\xbc" "\x4f\x7e\x00\x00\x00\xc0\x01\x71\x6c\xcb\xf8\xff\xd3\xd1\xce\xf8\x1f\x00" "\x00\x00\xd8\x67\x8a\x79\x27\x00\x00\x00\x00\xec\x3a\xe3\x7f\x00\x00\x00" "\xd8\xff\x8c\xff\x01\x00\x00\x60\x5f\xfb\xd5\xcd\x9b\xad\xd2\xec\xde\xff" "\x7a\xf6\xce\xfa\xda\x62\xed\xce\xc5\xd9\x4a\x7d\xb1\xb4\xb4\x36\x53\x9a" "\xa9\xad\xae\x94\xe6\x6b\xb5\xf9\xf6\x77\xf6\x2d\x6d\xf7\x7a\xd5\x5a\x6d" "\xe5\x27\xb1\xbc\x76\xaf\xdc\xa8\xd4\x1b\xe5\xfa\xfa\xc6\xed\xa5\xda\xda" "\x72\xe3\xf6\xc2\x0b\xb7\xc0\x06\x00\x00\x00\xf6\xd0\x89\xef\x3f\x7c\x2b" "\x89\x88\xcd\x9f\x1e\x69\x97\x96\x43\x79\x27\x05\xec\x89\xe4\x55\x1e\xfc" "\xee\xee\xe5\x01\xec\xbd\xa1\xbc\x13\x00\x72\x33\x9c\x77\x02\x40\x6e\x0a" "\x79\x27\x00\xe4\x6e\xbb\xf3\x00\x7d\x27\xef\xfc\x7f\xf0\xb9\x00\x00\x00" "\xbb\x63\xec\xbb\xfd\xaf\xff\x3b\x37\x00\xfb\x5b\x9a\x77\x02\x00\xc0\x9e" "\x73\xfd\x1f\x0e\xae\x82\x19\x80\x70\xe0\x7d\x73\x9b\xed\xaf\x7f\xfd\xbf" "\xd9\x7c\xa5\x84\x00\x00\x80\x81\x1b\x69\x97\x24\x2d\x65\xd7\x02\x47\x22" "\x4d\x4b\xa5\x88\xe3\xed\xdb\x02\x14\x92\xb9\x85\x6a\x65\x3c\x1b\x1f\xbc" "\x39\x5a\xf8\x46\xab\x3d\xd1\x7e\x66\xf2\x6a\xff\x3b\x0c\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x58\xb3" "\x99\x44\x13\x00\x00\x00\xd8\xd7\x22\xd2\xf7\x93\xf6\xb7\xf9\x47\x8c\x8d" "\x9e\x1b\xd9\x7a\x7e\xe0\x50\xf2\xd9\x68\x7b\x19\x11\x77\xff\x71\xeb\x6f" "\xf7\xa6\x1b\x8d\xd5\x89\xd6\xfa\x8f\x9f\xae\x6f\xfc\x3d\x5b\x7f\x29\x8f" "\x33\x18\x00\x00\x00\xc0\x56\xdd\x71\x7a\x77\x1c\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\x83\xf4\xe4\xf1" "\xfd\x99\x6e\xd9\xcb\xb8\x1f\xfe\x3c\x22\x8a\xbd\xe2\x0f\xc7\xe1\xf6\xf2" "\x70\x14\x22\xe2\xe8\x27\x49\x0c\x3f\xf7\xbc\x24\x22\x86\x06\x10\x7f\xf3" "\x41\x44\x9c\xec\x15\x3f\x69\xa5\x15\xc5\x2c\x8b\x5e\xf1\x8f\xe4\x18\x3f" "\x8d\x88\x63\x03\x88\x0f\x07\xd9\xc3\xd6\xfe\xe7\x7a\xaf\xf7\x5f\x1a\x67" "\xda\xcb\xde\xef\xbf\xe1\xac\xbc\xae\xfe\xfb\xbf\xf4\xe9\xfe\x6f\xa8\xcf" "\xfe\xe7\xf8\x0e\x63\x9c\x7a\xf4\x9f\x72\xdf\xf8\x0f\x22\x4e\x0d\xf7\xde" "\xff\x74\xe3\x27\x7d\xe2\x9f\xdd\x61\xfc\xdf\xfd\x76\x63\xa3\xdf\xb6\xe6" "\x3f\x23\xc6\x7a\x7e\xfe\x24\x2f\xc4\x2a\x37\x96\x56\xca\xf5\xf5\x8d\x8b" "\x0b\x4b\xd3\xf3\x95\xf9\xca\xf2\xe4\xe4\xc4\x95\xa9\xab\x53\x97\xa7\xc6" "\xcb\x73\x0b\xd5\x4a\xf6\xb3\x67\x8c\x3f\x7f\xef\xbf\x5f\xbe\xac\xff\x47" "\xfb\xc4\x2f\x6e\xd3\xff\x73\x3b\xec\xff\x17\x8f\xee\x3d\xfe\x76\xa7\x5a" "\xe8\x15\xff\xfc\xd9\xde\x9f\xbf\x27\xfb\xc4\x4f\xb3\xcf\xbe\x1f\x66\xf5" "\xd6\xf6\xb1\x6e\x7d\xb3\x53\x7f\xde\xe9\x7f\xbf\x71\xfa\x65\xfd\x9f\xed" "\xd3\xff\xed\xfe\xfe\xe7\x77\xd8\xff\x0b\xbf\xfe\xe3\x3b\x3b\x7c\x28\x00" "\xb0\x07\xea\xeb\x1b\x8b\xd3\xd5\x6a\x65\x55\x45\x45\x45\xe5\x69\x25\xef" "\x3d\x13\x00\x00\x30\x68\xcf\x0e\xfa\xf3\xce\x04\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\xae\xbd\xf8\x3a\xb1\xad\x31\x37" "\xf3\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\x4b\x7d\x15\x00\x00\xff\xff\xc7\x70\xd4" "\xee", 1207); syz_mount_image( /*fs=*/0x20000080, /*dir=*/0x20000500, /*flags=MS_REC|MS_SYNCHRONOUS|MS_RDONLY|MS_NOATIME|0x100*/ 0x4511, /*opts=*/0x20000180, /*chdir=*/0x12, /*size=*/0x4b4, /*img=*/0x20000a00); memcpy((void*)0x20000100, "ext4\000", 5); memcpy((void*)0x20000500, "./file2\000", 8); *(uint8_t*)0x20000040 = 0; memcpy( (void*)0x200012c0, "\x78\x9c\xec\xdd\xcf\x6f\x23\x57\x1d\x00\xf0\xaf\x27\x3f\xec\x6c\xb7\x9b" "\x5d\xe8\x01\x2a\x60\x17\x28\x2c\x68\xb5\x4e\xe2\x6d\x57\x55\x2f\xed\x5e" "\x40\xa8\xaa\x84\xa8\x38\x20\x0e\xdb\x90\x78\xa3\xb0\xf6\x7a\x89\x9d\xd2" "\x84\x48\xa4\x07\xfe\x02\x90\x40\xe2\x44\x4f\x9c\x39\x20\x71\x40\xea\x89" "\x03\x37\x8e\x48\x1c\x10\x52\x91\x40\x5a\x20\x02\x6d\x90\x40\x72\x35\x63" "\x27\x71\x13\xa7\x71\x6a\xc7\x6e\xe3\xcf\x47\x9a\xcc\xcc\x7b\x33\xf3\x7d" "\x6f\xbd\xe3\xf7\x66\x26\x99\x17\xc0\xd8\xba\x16\x11\xdb\x11\x31\x1d\x11" "\xaf\x45\xc4\x6c\x3b\x3d\xd7\x9e\xe2\xa5\xd6\x94\x6e\xf7\x78\x67\x6b\x69" "\x77\x67\x6b\x29\x17\xcd\xe6\xab\xff\xcc\x65\xf9\x69\x5a\x74\xec\x93\x7a" "\xa2\x7d\xcc\x42\x44\x7c\xe3\xab\x11\xdf\xc9\x1d\x8d\x5b\xdf\xd8\xbc\xbf" "\x58\xa9\x94\xd7\xda\xeb\x73\x8d\xea\xc3\xb9\xfa\xc6\xe6\xcd\xd5\xea\xe2" "\x4a\x79\xa5\xfc\xa0\x54\xba\xbd\x70\x7b\xfe\xf9\x5b\xcf\x95\x06\x56\xd7" "\xab\xd5\x5f\x3d\xfa\xca\xea\xcb\xdf\xfc\xed\x6f\x3e\xfd\xce\x1f\xb6\xbf" "\xfc\x83\xb4\x58\x17\xdb\x79\x9d\xf5\x18\xa4\x56\xd5\xa7\xf6\xe3\xa4\x26" "\x23\xe2\xe5\xb3\x08\x36\x02\x13\xed\xf9\xf4\x5e\xc2\x2f\xbb\x7c\xd8\x7c" "\x68\x25\x11\xf1\xb1\x88\xf8\x5c\x76\xfe\xcf\xc6\x44\xf6\xbf\x13\x00\x38" "\xcf\x9a\xcd\xd9\x68\xce\x76\xae\x03\x00\xe7\x5d\x92\xdd\x03\xcb\x25\xc5" "\x88\x48\x92\x76\x27\xa0\xd8\xba\x87\xf7\x54\x5c\x48\x2a\xb5\x7a\xe3\xc6" "\xbd\xda\xfa\x83\xe5\xd6\xbd\xb2\xcb\x31\x95\xdc\x5b\xad\x94\xe7\xaf\xe4" "\xff\xf4\xbd\x6c\xe3\xa9\x5c\xba\xbe\x90\xe5\x65\xf9\xd9\x7a\xe9\xd0\xfa" "\xad\x88\xb8\x12\x11\x3f\xc9\xcf\x64\xeb\xc5\xa5\x5a\x65\x79\x34\x5d\x1e" "\x00\x18\x7b\x4f\x74\xb6\xff\x11\xf1\x9f\x7c\x92\x14\x8b\x3d\xed\xea\x41" "\x0f\x00\x7c\x94\x15\x46\x5d\x00\x00\x60\xe8\xb4\xff\x00\x30\x7e\xb4\xff" "\x00\x30\x7e\x8e\x6d\xff\x9b\xfb\x4b\xed\x87\xfd\xdb\x43\x29\x0f\x00\x70" "\xf6\x5c\xff\x03\xc0\xf8\x39\xb6\xfd\x7f\xeb\xd2\x70\x0b\x02\x00\x0c\x8d" "\xeb\x7f\x00\x18\x2b\x5f\x7f\xe5\x95\x74\x6a\xee\xb6\xdf\x7f\xbd\xfc\xfa" "\xc6\xfa\xfd\xda\xeb\x37\x97\xcb\xf5\xfb\xc5\xea\xfa\x52\x71\xa9\xb6\xf6" "\xb0\xb8\x52\xab\xad\x64\xef\xec\xa9\x9e\x74\xbc\x4a\xad\xf6\x70\xe1\xd9" "\x58\x7f\x63\xae\x51\xae\x37\xe6\xea\x1b\x9b\x77\xab\xb5\xf5\x07\x8d\xbb" "\xd9\x7b\xbd\xef\x96\xa7\x86\x52\x2b\x00\xe0\xfd\x5c\xb9\xfa\xf6\x1f\x73" "\x11\xb1\xfd\xc2\x4c\x36\x45\xc7\x58\x0e\x07\x6d\x75\x7e\x44\xa5\x03\xce" "\x52\x32\xea\x02\x00\x23\x33\xd1\xcf\xce\x2e\xe6\xe1\x23\xcd\x68\x5f\x30" "\xbe\x7a\x6a\xc2\xb3\x4e\xc2\xef\xcf\xbc\x2c\xc0\x68\x74\x7d\x99\x77\xe1" "\x7d\x73\x5b\x7e\x76\x8a\x20\x7e\xcf\x08\x3e\x54\xae\x7f\xb2\x97\xfb\xff" "\xf1\x9e\x74\xe0\x7c\xf8\xd1\x69\x36\xf6\xb0\x00\xce\x95\x0f\x76\xff\xff" "\xc5\x81\x97\x03\x18\x3e\xf7\xff\x61\x7c\x35\x9b\xb9\xc3\x63\xfe\x4f\xef" "\x67\x01\x00\xe7\x52\x1f\xbf\xc2\xd7\xfc\xe1\xa0\x3a\x21\xc0\x48\x9d\x34" "\x98\xf7\x91\x47\xf7\x7b\x3b\x9c\xe6\xf9\x3f\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" "\x33\x17\x23\xe2\xbb\x91\x4b\x8a\xd9\xf0\xde\x49\xfa\x33\x29\x16\x23\x9e" "\x8c\x88\xcb\x31\x35\x19\xab\x95\xf2\x7c\x44\x5c\x8a\xab\x11\x31\x95\xbf" "\xb7\x5a\x29\x2f\x8c\xba\xd0\x00\x40\x9f\x92\xbf\xe7\xda\xc3\x79\x5d\x9f" "\x7d\xe6\xe2\xe1\xdc\xe9\xdc\x7f\xf3\xd9\x3c\x22\xbe\xff\xf3\x57\x7f\xfa" "\xc6\x62\xa3\xb1\xb6\x90\xa6\xff\x6b\x3f\x3d\xbf\x37\x1a\x58\xe9\x60\xbf" "\x3e\xc6\x15\x04\x00\x06\x2c\x6d\xbf\xa7\x4b\xad\xf9\x5a\xc7\x85\xfc\xe3" "\x9d\xad\xa5\xbd\x69\x98\xe5\x79\x74\x27\xfe\xdf\x1e\x8a\x78\x69\x77\x67" "\x2b\x9b\x5a\x39\x93\x91\x26\x46\x14\xb2\xbe\xc4\x85\x7f\xe7\x62\xb2\xbd" "\x4f\x21\x22\x9e\x8e\x88\x89\x01\xc4\xdf\x7e\x33\x22\x3e\xd1\xad\xfe\xb9" "\xec\xde\xc8\xe5\xf6\xc8\xa7\x9d\xf1\xa3\x1d\xfb\xc9\xa1\xc6\x4f\xde\x13" "\x3f\xc9\xf2\x5a\xf3\xb4\xf3\xf5\xf1\x01\x94\x05\xc6\xcd\xdb\x77\x22\xe2" "\xa5\x6e\xe7\x5f\x12\xd7\xb2\x79\xf7\xf3\xbf\x90\x7d\x43\xf5\xef\xd1\x9d" "\xd6\xc1\xf6\xbe\xfb\x76\x3b\xe2\x4f\xb6\x23\x4d\x74\x89\x9f\x9e\xf3\xd7" "\x7a\x8d\xf1\xec\xef\xbe\x76\x24\xb1\x39\xdb\xca\x7b\x33\xe2\xe9\xc9\x6e" "\xf1\x73\xfb\xf1\x73\xc7\xc4\x7f\xa6\xc7\xf8\x7f\xfe\xd4\x67\x7e\xfc\x62" "\x6b\x71\xe6\x48\x31\x7e\x11\x71\x3d\xba\xc7\xef\x8c\x35\xd7\xa8\x3e\x9c" "\xab\x6f\x6c\xde\x5c\xad\x2e\xae\x94\x57\xca\x0f\x4a\xa5\xdb\x0b\xb7\xe7" "\x9f\xbf\xf5\x5c\x69\xee\xde\x6a\xa5\x3c\xdf\xfa\xd9\x35\xfe\x3f\x5e\xb8" "\x71\xe9\xb8\xb2\xa5\xf5\xbf\x70\x4c\xfc\x42\xd7\xfa\x4f\xef\xef\xfb\x85" "\x1e\xeb\xff\xd6\xff\x5e\xfb\xf6\x67\x0f\x56\xf3\x87\xe3\x7f\xe9\xf3\xdd" "\x3f\xff\xa7\xba\xc6\x6f\x49\xdb\xc4\x2f\xf6\x18\x7f\xf1\xc2\xaf\x8f\x0c" "\xdf\xdd\x19\x7f\xf9\x98\xfa\x9f\xf4\xf9\xdf\xe8\x31\xfe\x3b\x7f\xdd\x5c" "\xee\x71\x53\x00\x60\x08\xea\x1b\x9b\xf7\x17\x2b\x95\xf2\x5a\x5f\x0b\xe9" "\x55\xe8\xc9\x1b\x17\x4e\x7f\xe4\xb4\x88\xbd\x6d\xbc\xd7\x5d\xec\xaf\x3a" "\x7f\x89\x01\xfc\x6b\x0c\x6a\x61\xaa\xef\xea\x8c\x6a\x61\x72\xbf\xaf\x38" "\xd8\x23\x7f\x2b\x3d\xe2\x90\xab\x93\x0c\xbc\x16\xa7\x5a\x98\x39\x54\xe5" "\xc7\x87\xb7\xf9\xdb\x07\x38\xf2\x4c\x0f\x9f\xce\x68\xbe\x8f\x80\xe1\x39" "\x38\xe9\x47\x5d\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x38" "\xc3\xf8\x1b\xa6\xbd\x58\x83\x78\x5f\x06\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x7a" "\x37\x00\x00\xff\xff\x64\x24\xc9\xfb", 1395); syz_mount_image(/*fs=*/0x20000100, /*dir=*/0x20000500, /*flags=MS_LAZYTIME|MS_SILENT|MS_NOSUID*/ 0x2008002, /*opts=*/0x20000040, /*chdir=*/1, /*size=*/0x573, /*img=*/0x200012c0); memcpy((void*)0x200000c0, "vfat\000", 5); memcpy((void*)0x20000540, "./file2\000", 8); syz_mount_image(/*fs=*/0x200000c0, /*dir=*/0x20000540, /*flags=MS_MANDLOCK*/ 0x40, /*opts=*/0, /*chdir=*/0xfd, /*size=*/0, /*img=*/0x20000300); } 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); for (procid = 0; procid < 5; procid++) { if (fork() == 0) { use_temporary_dir(); loop(); } } sleep(1000000); return 0; }