// https://syzkaller.appspot.com/bug?id=a3d085c934448d325eba613246a150873080b331 // 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, 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 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, loopfd = -1, 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) { memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; 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) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } 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); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; memcpy((void*)0x20000040, "nilfs2\000", 7); memcpy((void*)0x20000080, "./file2\000", 8); memcpy( (void*)0x20000ac0, "\x78\x9c\xec\xdd\x4d\x6c\x5c\x47\x1d\x00\xf0\x79\x6b\xaf\x53\xb7\x29\xd9" "\x94\x84\x9a\x34\xb4\x09\x85\xb6\x7c\xd4\x6e\x1c\x37\x7c\x44\xd0\x54\xcd" "\x85\xa8\xa9\xb8\x55\xaa\xb8\x44\x69\x5a\x22\xd2\x80\x48\x25\x68\xd5\x43" "\x92\x13\x37\x5a\x55\xe1\xca\x87\x38\xf5\x52\x01\x42\xa2\x17\x14\xf5\xc4" "\xa5\x12\x8d\xc4\xa5\xa7\xc2\x81\x03\x51\x90\x2a\x71\x80\x42\x62\x14\x7b" "\x66\xbd\xfe\x67\x57\x6f\xd7\x49\xbc\x5e\xef\xef\x27\x8d\x67\xe7\xcd\xec" "\xce\xbc\xf5\xdb\xb7\x6f\xdf\x7b\x33\x93\x80\xb1\xd5\x58\xfa\xbb\xb0\x30" "\x53\xa5\x74\xe1\x9d\x37\x0f\xff\xe3\xa1\xbf\x4f\x5f\x5f\xf2\x44\xbb\x44" "\x6b\xe9\xef\x64\x47\xaa\x99\x52\xaa\x72\x7a\x32\xbc\xde\x87\x13\xcb\xf1" "\xd5\x8f\x5e\x3b\xde\x2d\xae\xd2\xfc\xd2\xdf\x92\x4e\xcf\x5c\x69\x3f\xf7" "\xae\x94\xd2\xd9\xb4\x27\x5d\x4c\xad\xb4\xeb\xc2\xa5\x37\xde\x9b\x7f\xfa" "\xe8\xb9\x23\xe7\xf7\xbe\xff\xd6\xc1\xcb\xb7\x67\xed\x01\x00\x60\xbc\x7c" "\xfb\xe2\xc1\x85\x9d\x7f\xfd\xf3\x7d\xdb\x3f\x7e\xfb\xfe\x43\x69\x4b\x7b" "\x79\x39\x3e\x6f\xe5\xf4\xd6\x7c\xdc\x7f\x28\x1f\xf8\x97\xe3\xff\x46\x5a" "\x9d\xae\x3a\x42\xa7\xa9\x50\x6e\x32\x87\x46\x28\x37\xd1\xa5\x5c\x67\x3d" "\xcd\x50\x6e\xb2\x47\xfd\x53\xe1\x75\x9b\x3d\xca\x6d\xa9\xa9\x7f\xa2\x63" "\x59\xb7\xf5\x86\x51\x56\xb6\xe3\x56\xaa\x1a\xb3\xab\xd2\x8d\xc6\xec\xec" "\xf2\x6f\xf2\xb4\xf4\xbb\x7e\xaa\x9a\x3d\x7d\xf2\xd4\x0b\x67\x86\xd4\x50" "\xe0\x96\xfb\xd7\x03\x29\xa5\x3d\x82\x20\x8c\x63\x58\xdc\x36\xec\x3d\x10" "\xc0\xb2\x78\xbd\xf0\x06\x67\xe3\x99\x85\x9b\xb3\xfc\x6a\x67\xdb\x27\x12" "\xea\xea\xbf\xf2\x64\xa3\xcb\xf3\xe1\xd6\x58\xef\xed\x5f\xfd\xa3\x55\xff" "\xaf\xcf\xd9\xe3\x70\xeb\x6c\xd6\xad\xa9\xac\x57\xf9\x1c\x6d\xcd\xe9\x78" "\x1d\x21\xde\xbf\x34\xe8\xe7\xbf\xbc\x5e\xbc\x1e\xd1\xec\xb3\x9d\xbd\xae" "\x23\x8c\xca\xf5\x85\x5e\xed\x9c\x58\xe7\x76\xac\x55\xaf\xf6\xc7\xed\x62" "\xb3\xfa\x46\x8e\xcb\xfb\xf0\xcd\x90\xdf\xf9\xf9\x89\xff\xd3\x51\xf9\x1f" "\x03\xdd\xfd\x7b\xcc\xce\xff\xb7\xf7\x59\x1b\xa0\x2d\x82\x30\xec\xb0\x38" "\xdc\xdd\x0f\xb0\x81\xc5\xfb\xe6\x16\xb3\x92\x1f\xef\xeb\x8b\xf9\x5b\x6a" "\xf2\xef\xa8\xc9\x9f\xae\xc9\xbf\xb3\x26\xff\xae\x9a\x7c\x18\x67\xbf\x7b" "\xf9\xa7\xe9\xf5\x6a\xe5\x77\x7e\xfc\x4d\x3f\xe8\xf9\xb0\x72\x9e\xed\xee" "\x1c\x7f\x62\xc0\xf6\xc4\xf3\x91\x83\xd6\x1f\xef\xfb\x1d\xd4\xcd\xd6\x1f" "\xef\x27\x86\x8d\xec\x0f\xc7\x9e\x3d\xf1\xd5\xe7\x9f\xbb\xb4\x7c\xff\x7f" "\xd5\xde\xfe\xaf\xe5\xed\x7d\x4f\x4e\xb7\xf2\x67\xeb\x62\x2e\x50\xce\x17" "\xc6\xf3\xea\xed\x7b\xff\x5b\xab\xeb\x69\xf4\x28\x77\x4f\x68\xcf\xdd\x5d" "\xca\x2f\x3d\xde\xb1\xba\x5c\xb5\x63\xe5\x75\x52\xc7\x7e\xe6\x86\x76\xcc" "\xac\x7e\xde\xb6\x5e\xe5\x76\xaf\x2e\xd7\x0a\xe5\xa6\x73\xb8\x23\xb4\x77" "\x3a\xec\x33\xee\x0c\xcf\x2b\xc7\x1f\x65\xbf\x5a\xde\xaf\xc9\xb0\xbe\xcd" "\xb0\x1e\x53\xa1\x1d\x65\xbf\xb2\x3d\xc7\xb1\x1d\xb0\x16\x65\x7b\xec\x75" "\xff\x7f\xd9\x3e\x67\x52\xb3\x7a\xe1\xe4\xa9\x13\x8f\xe5\x74\xd9\x4e\xff" "\x34\xd1\xdc\x72\x7d\xf9\xbe\x75\x6e\x37\x70\xf3\xfa\xed\xff\x33\x93\x56" "\xf7\xff\xd9\xda\x5e\xde\x6c\x74\xee\x17\xb6\xad\x2c\xaf\x3a\xf7\x0b\xad" "\xb0\x7c\xbe\xc7\xf2\xfd\x39\x5d\xbe\xe7\xbe\x3b\x31\xbd\xb4\x7c\xf6\xf8" "\xf7\x4f\x3d\x7f\xab\x57\x1e\xc6\xdc\x99\x57\x5e\xfd\xde\xb1\x53\xa7\x4e" "\xfc\xd0\x03\x0f\x3c\xf0\xa0\xfd\x60\xd8\x7b\x26\xe0\x76\x9b\x7b\xf9\xa5" "\x1f\xcc\x9d\x79\xe5\xd5\x47\x4f\xbe\x74\xec\xc5\x13\x2f\x9e\x38\xbd\xff" "\xc0\x81\xfd\xf3\xf3\x07\xbe\xb6\x7f\x61\x6e\xe9\xb8\x7e\xae\xf3\xe8\x1e" "\xd8\x4c\x56\xbe\xf4\x87\xdd\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0" "\x5f\x3f\x3a\x72\xf8\xd2\x5f\xde\xfd\xca\x07\xcb\xfd\xff\x57\xfa\xff\x95" "\xfe\xff\xe5\xce\xdf\xd2\xff\xff\x27\xa1\xff\x7f\xec\x27\x5f\xfa\xc2\x97" "\x7e\x80\xdb\xbb\xe4\x57\x29\x4d\xc6\x01\x56\xa7\x42\xb9\x66\x0e\x9f\x0c" "\xed\xdd\x11\xea\xd9\x19\x9e\xf7\xa9\x1c\xb7\xe7\xf1\xcb\xfd\xff\x4b\x75" "\x71\x5c\xd7\xd2\xff\xff\xde\xb0\x3c\x8e\xdf\x5b\xca\x85\xe1\x04\x6e\x18" "\x2f\x65\x2a\x8c\x41\x12\xe7\x0b\xfc\x6c\x8e\xcf\xe7\xf8\x57\x09\x86\xa8" "\x9a\xee\xbe\x38\xc7\x75\xe3\x5b\x97\x6d\xbd\x8c\x4f\x61\x5c\x8a\xd1\x54" "\xfe\x6f\x65\x6b\x28\xe3\x98\x94\xfe\xdf\xbd\xc6\x75\x2a\xfb\xff\xed\xeb" "\xd0\x46\x6e\xbd\xf5\xe8\x4e\x38\xec\x75\x04\xba\xfb\xe7\x98\x8d\xff\x2d" "\x08\xc2\x4a\x58\x5c\x34\x8b\x07\xb0\x31\x0c\x67\xfe\xcf\x95\x13\x1b\xe5" "\xbc\x67\x89\x4f\xff\xf1\x5b\x77\x5c\x0f\xa5\xd8\x95\x27\x57\xef\x2f\xe3" "\xf8\xa5\x70\x33\x36\xfa\xfc\x93\xea\xdf\x5c\xf3\x7f\xb6\xe7\xbf\xeb\x7b" "\xff\x17\x66\xcc\x6b\xad\xad\xde\xff\xfc\xfc\xf2\x07\x1d\xd5\xa6\x5d\xfd" "\xd6\x1f\xd7\xbf\x8c\x03\xbd\x63\xb0\xfa\x3f\xce\xf5\x97\xb5\x79\x38\xf5" "\x57\xff\xe2\x2f\x43\xfd\xf1\x82\x50\x9f\xfe\x1b\xea\xbf\xb3\xcf\xfa\x6f" "\x58\xff\xdd\x6b\xab\xff\x7f\xb9\xfe\xf2\xb6\x3d\xf2\x60\xbf\xf5\x2f\xb7" "\xb8\x6a\xac\x6e\x47\x3c\x6f\x5c\xae\xff\xc5\xf3\xc6\xc5\xd5\xb0\xfe\x65" "\x6c\xcf\x81\xd7\x7f\x8d\x13\x35\x5e\xcb\xf5\xc3\x38\x1b\x95\x79\x66\x07" "\x35\x2a\xf3\xff\xf6\x12\xef\xc3\x78\x3c\xa7\xcb\x8e\xb0\xdc\xe7\x10\xe7" "\x3b\x19\xb4\xfd\xe5\xfe\x8a\xf2\x3d\xb0\x33\xbc\x7e\x55\xf3\xfd\x66\xfe" "\xdf\xd1\xf6\xf5\x1c\xd7\x7d\x1e\xca\xfc\xbf\x65\x7b\x6c\x75\x49\x37\x3a" "\xd2\xcd\x2e\xef\xed\x66\xdd\xd7\xc0\xa8\xfa\xd0\xf5\x3f\x41\x18\xdb\xb0" "\xb8\xb8\x78\x7b\x4f\x68\xd5\x18\x6a\xe5\x0c\xfd\xfd\x1f\xf6\xef\x84\x61" "\xd7\x3f\xec\xf7\xbf\x4e\x9c\xff\x77\xf5\x31\xfc\xe3\x37\xcc\xff\x1b\x8f" "\xf1\xe3\xfc\xbf\x31\x3f\xce\xff\x1b\xf3\xe3\xfc\xbf\x31\x3f\xce\xff\x1b" "\xdf\xcf\x38\xff\x6f\xcc\xbf\x37\xbc\x6e\x9c\x1f\x78\xa6\x26\xff\xd3\x2b" "\xf9\x17\xbb\xe5\xef\xaa\x79\xfe\x7d\x35\xf9\xbb\x6b\xf2\x3f\x53\x93\xbf" "\xb7\x26\xff\xfe\x9a\xfc\x07\x6a\xf2\xef\xa9\xc9\x7f\xb0\x26\xff\x73\x35" "\xf9\x9f\xaf\xc9\x7f\xa8\x26\xff\x91\x9a\xfc\x2f\xd4\xe4\x6f\x76\xa5\x3f" "\xca\xb8\xae\x3f\x8c\xb3\xd8\x3f\xcf\xe7\x1f\xc6\x47\xb9\xfe\xd3\xeb\xf3" "\xbf\xa3\x26\x1f\x18\x5d\x3f\x7b\x7b\xdf\x53\xcf\xfd\xf6\x3b\xad\xe5\xfe" "\xff\x53\xed\xf3\x21\xe5\x3a\xde\xa1\x9c\x6e\xe6\xdf\xce\x3f\xce\xe9\x78" "\xdd\x3b\x75\xa4\xaf\xe7\xbd\x9b\xd3\x7f\x0b\xf9\x1b\xfd\x7c\x07\x8c\x93" "\x38\x7e\x46\xfc\x7e\x7f\xb8\x26\x1f\x18\x5d\xe5\x3e\x2f\x9f\x6f\x18\x43" "\x55\xf7\x11\x7b\xfa\x1d\xb7\xaa\xd7\x71\x3e\xa3\xe5\x8b\x39\xfe\x52\x8e" "\xbf\x9c\xe3\x47\x73\x3c\x9b\xe3\xb9\x1c\xef\xcb\xf1\xfc\x3a\xb5\x8f\xdb" "\xe3\xa9\xdf\xfc\xfe\xe0\xeb\xd5\xca\xef\xfd\x6d\x21\xbf\xdf\xfb\xc9\x63" "\x7f\xa0\x38\x4e\xd4\xfe\x3e\xdb\x13\xcf\x0f\x0c\x7a\x3f\x7b\x1c\xc7\x6f" "\x50\x37\x5b\xff\x1a\xbb\x83\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x4d\x63\xe9\xef" "\xc2\xc2\x4c\x95\xd2\x85\x77\xde\x3c\xfc\xec\xd1\x93\x73\xd7\x97\x3c\xd1" "\x2e\xd1\x5a\xfa\x3b\xd9\x91\x6a\xb6\x9f\x97\xd2\x63\x39\x9e\xc8\xf1\x2f" "\xf2\x83\xab\x1f\xbd\x76\xbc\x33\xbe\x96\xe3\x2a\xcd\xa7\x2a\x55\xed\xe5" "\xe9\x99\x2b\xed\x9a\xee\x4a\x29\x9d\x4d\x7b\xd2\xc5\xd4\x4a\xbb\x2e\x5c" "\x7a\xe3\xbd\xf9\xa7\x8f\x9e\x3b\x72\x7e\xef\xfb\x6f\x1d\xbc\x7c\xfb\xde" "\x01\x00\x00\x00\xd8\xfc\xfe\x1f\x00\x00\xff\xff\x4a\x0a\x0e\xd9", 2590); syz_mount_image(0x20000040, 0x20000080, 0, 0x20000140, 1, 0xa1e, 0x20000ac0); memcpy((void*)0x200000c0, "./file2\000", 8); res = syscall(__NR_open, 0x200000c0ul, 0x147042ul, 0ul); if (res != -1) r[0] = res; syscall(__NR_ftruncate, r[0], 0ul); sprintf((char*)0x20000180, "0x%016llx", (long long)0); syscall(__NR_write, r[0], 0x20000180ul, 0x12ul); syscall(__NR_fchdir, -1); syscall(__NR_creat, 0ul, 0ul); syscall(__NR_ioctl, -1, 0x40286608, 0ul); syscall(__NR_openat, -1, 0ul, 0x420881ul, 0x42ul); syscall(__NR_openat, 0xffffffffffffff9cul, 0ul, 2ul, 0ul); syscall(__NR_ioctl, -1, 0x81f8943c, 0ul); syscall(__NR_ioctl, -1, 0xc4009420, 0ul); *(uint32_t*)0x200001c0 = 0xb; *(uint16_t*)0x200001c4 = 0x10; *(uint16_t*)0x200001c6 = 0xfa00; *(uint64_t*)0x200001c8 = 0; *(uint32_t*)0x200001d0 = -1; *(uint32_t*)0x200001d4 = 0; syscall(__NR_write, r[0], 0x200001c0ul, 0x18ul); } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); for (procid = 0; procid < 6; procid++) { if (fork() == 0) { use_temporary_dir(); loop(); } } sleep(1000000); return 0; }