// https://syzkaller.appspot.com/bug?id=fcf0b68b63113416159649a5145d26759b9865ba // 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 #ifndef __NR_openat #define __NR_openat 56 #endif #ifndef __NR_renameat2 #define __NR_renameat2 276 #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 int inject_fault(int nth) { int fd; fd = open("/proc/thread-self/fail-nth", O_RDWR); if (fd == -1) exit(1); char buf[16]; sprintf(buf, "%d", nth); if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) exit(1); return fd; } 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 setup_fault() { static struct { const char* file; const char* val; bool fatal; } files[] = { {"/sys/kernel/debug/failslab/ignore-gfp-wait", "N", true}, {"/sys/kernel/debug/fail_futex/ignore-private", "N", false}, {"/sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem", "N", false}, {"/sys/kernel/debug/fail_page_alloc/ignore-gfp-wait", "N", false}, {"/sys/kernel/debug/fail_page_alloc/min-order", "0", false}, }; unsigned i; for (i = 0; i < sizeof(files) / sizeof(files[0]); i++) { if (!write_file(files[i].file, files[i].val)) { if (files[i].fatal) exit(1); } } } 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*)0x20000000, "udf\000", 4); memcpy((void*)0x20000040, "./file0\000", 8); memcpy((void*)0x20000100, "noadinicb", 9); *(uint8_t*)0x20000109 = 0x2c; memcpy((void*)0x2000010a, "iocharset", 9); *(uint8_t*)0x20000113 = 0x3d; memcpy((void*)0x20000114, "cp866", 5); *(uint8_t*)0x20000119 = 0x2c; memcpy((void*)0x2000011a, "gid=forget", 10); *(uint8_t*)0x20000124 = 0x2c; memcpy((void*)0x20000125, "partition", 9); *(uint8_t*)0x2000012e = 0x3d; sprintf((char*)0x2000012f, "%020llu", (long long)6); *(uint8_t*)0x20000143 = 0x2c; memcpy((void*)0x20000144, "iocharset", 9); *(uint8_t*)0x2000014d = 0x3d; memcpy((void*)0x2000014e, "cp863", 5); *(uint8_t*)0x20000153 = 0x2c; memcpy((void*)0x20000154, "adinicb", 7); *(uint8_t*)0x2000015b = 0x2c; memcpy((void*)0x2000015c, "lastblock", 9); *(uint8_t*)0x20000165 = 0x3d; sprintf((char*)0x20000166, "%020llu", (long long)7); *(uint8_t*)0x2000017a = 0x2c; *(uint8_t*)0x2000017b = 0; memcpy( (void*)0x20000e00, "\x78\x9c\xec\xdd\x4f\x6c\x1c\xd7\x7d\x07\xf0\xdf\x1b\x92\x22\xa9\xb4\x15" "\x13\x3b\x8a\xdd\xc6\xc5\xa6\x2d\x52\x99\xb1\x5c\xfd\x8b\xa9\x58\x85\xbb" "\xaa\x69\xb6\x01\x64\x99\x08\xc5\xdc\x02\x70\x45\x52\xea\xc2\xd4\x92\x20" "\xa9\x46\x36\xd2\x82\xe9\xa5\x87\x1e\x02\x14\x45\x0f\x39\x11\x68\x8d\x02" "\x29\x1a\x18\x4d\x11\xf4\xc8\xb4\x2e\x90\x5c\x7c\x28\x72\xea\x89\x68\x61" "\x23\x28\x7a\x60\x8b\x00\x39\x05\x2c\x66\xf6\xad\xb8\xa4\x28\x8b\x11\x45" "\x89\xb2\x3e\x1f\x9b\xfa\xee\xce\xbc\x37\xf3\xde\xcc\x78\x46\x16\xf4\xe6" "\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\x10\xf1\xfb\xaf" "\x5d\x3c\x75\x3a\x3d\xea\x56\x00\x00\x0f\xd3\xe5\x89\xaf\x9c\x3a\xe3\xf9" "\x0f\x00\x4f\x94\x2b\xfe\xff\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x0e\xbb\x14\x45\x3c\x15\x29\x16\x2e\x6f\xa4\xa9\xea\x7b\xdb\xc0\xa5" "\x66\xeb\xe6\xad\xc9\xd1\xb1\xdd\xab\x0d\xa6\xaa\x66\x4f\x55\xbe\xfc\x19" "\x38\x7d\xe6\xec\xb9\x2f\xbe\x34\x72\xbe\x93\x1f\x5d\xff\x41\x7b\x36\xde" "\x98\xb8\x72\xb1\xf6\xea\xfc\x8d\x85\xc5\xd9\xa5\xa5\xd9\x99\xda\x64\xab" "\x39\x3d\x3f\x33\xbb\xe7\x2d\xec\xb7\xfe\x4e\xc3\xd5\x01\xa8\xdd\x78\xf3" "\xe6\xcc\xb5\x6b\x4b\xb5\x33\x2f\x9e\xdd\xb6\xfa\xd6\xd0\x87\xfd\x9f\x38" "\x3e\x74\x61\xe4\xf9\x93\xcf\x75\xca\x4e\x8e\x8e\x8d\x4d\x6c\x15\x19\xb8" "\xef\x7d\xef\xe2\x6e\x23\x3c\x8e\x44\x11\x27\x23\xc5\x0b\xdf\xfd\x49\x6a" "\x44\x44\x11\xfb\x3f\x16\xf7\xb8\x76\x0e\xda\x60\xd5\x89\xe1\xaa\x13\x93" "\xa3\x63\x55\x47\xe6\x9a\x8d\xd6\x72\xb9\x72\xbc\x73\x20\x8a\x88\x5a\x57" "\xa5\x7a\xe7\x18\xed\x7e\x2e\xa2\xb7\xef\xa1\xf6\xe1\xee\xea\x11\x2b\x65" "\xf3\xcb\x06\x0f\x97\xdd\x9b\x58\x68\x2c\x36\xae\xce\xcd\xd6\xc6\x1b\x8b" "\xcb\xcd\xe5\xe6\x7c\x6b\x3c\xb5\x5b\x5b\xf6\xa7\x16\x45\x9c\x4f\x11\xab" "\x11\xb1\xde\x7f\xe7\xe6\xfa\xa2\x88\xde\x48\xf1\xed\x63\x1b\xe9\x6a\x44" "\xf4\x74\x8e\xc3\x17\xaa\x81\xc1\x77\x6f\x47\x71\x80\x7d\xdc\x83\xb2\x9d" "\xb5\xbe\x88\xd5\xe2\x31\x38\x67\x87\x58\x7f\x14\xf1\x7a\xa4\xf8\xe9\x7b" "\x27\x62\xba\x3c\x66\xf9\x27\x3e\x1f\xf1\x7a\x99\xdf\x8f\x78\xa7\xcc\x57" "\x22\x52\x79\x61\x9c\x8b\xf8\x60\x97\xeb\x88\xc7\x53\x6f\x14\xf1\x17\xe5" "\xf9\xbf\xb0\x91\x66\xaa\xfb\x41\xe7\xbe\x72\xe9\xab\xb5\x2f\xb7\xae\xcd" "\x77\x95\xed\xdc\x57\x7e\xc1\xe7\xc3\x1d\x77\x8a\x47\xf4\x7c\x18\xdc\x91" "\x0f\xc7\x21\xbf\x37\x0d\x44\x11\x8d\xea\x8e\xbf\x91\xee\xff\x37\x3b\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x68\x83\x51\xc4\xb3" "\x91\xe2\xb5\x7f\xff\xe3\x6a\x5c\x71\x54\xe3\xd2\x8f\x5d\x18\xf9\x83\xa1" "\x5f\xee\x1e\x33\xfe\xcc\x3d\xb6\x53\x96\x7d\x31\x22\x56\x8a\xbd\x8d\xc9" "\x3d\x92\x07\x06\x8e\xa7\xf1\x94\x1e\xf1\x58\xe2\x27\xd9\x40\x14\xf1\x27" "\x79\xfc\xdf\x37\x1f\x75\x63\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x9e\x68\x45\xfc\x38\x52\xbc\xfc\xfe\x89\xb4\x1a\xdd\x73" "\x8a\x37\x5b\xd7\x6b\x57\x1a\x57\xe7\xda\xb3\xc2\x76\xe6\xfe\xed\xcc\x99" "\xbe\xb9\xb9\xb9\x59\x4b\xed\xac\xe7\x9c\xca\xb9\x92\x73\x35\xe7\x5a\xce" "\xf5\x9c\x51\xe4\xfa\x39\xeb\x39\xa7\x72\xae\xe4\x5c\xcd\xb9\x96\x73\x3d" "\x67\xf4\xe4\xfa\x39\xeb\x39\xa7\x72\xae\xe4\x5c\xcd\xb9\x96\x73\x3d\x67" "\xf4\xe6\xfa\x39\xeb\x39\xa7\x72\xae\xe4\x5c\xcd\xb9\x96\x73\x3d\x67\x1c" "\x92\xb9\x7b\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\x3e\x4e\x8a\x28" "\xe2\xe7\x91\xe2\x5b\x5f\xdf\x48\x91\x22\xa2\x1e\x31\x15\xed\x5c\xeb\x7f" "\xd4\xad\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x4a\xfd\xa9\x88\xef\x45\x8a\xda\x1f\xd6\x6f\x2f\xeb\x8d" "\x88\x54\xfd\xdb\x76\xa2\xfc\xe5\x5c\xd4\x8f\x94\xf9\xa9\xa8\x8f\x94\xf9" "\x4a\xd4\x2f\xe6\x6c\x54\xd9\x5b\xff\xe6\x23\x68\x3f\xfb\xd3\x97\x8a\xf8" "\x51\xa4\xe8\x1f\x78\xf7\xf6\x09\xcf\xe7\xbf\xaf\xfd\xed\xf6\x65\x10\xef" "\x7c\x63\xeb\xdb\xaf\xf6\xb6\xb3\xa7\xb3\x72\xe8\xc3\xfe\x4f\x1c\x3f\x76" "\x61\x64\xec\xd7\x9f\xb9\xdb\xe7\xb4\x5b\x03\x86\x2f\x35\x5b\x37\x6f\xd5" "\x26\x47\xc7\xc6\x26\xba\x16\xf7\xe6\xbd\x7f\xaa\x6b\xd9\x50\xde\x6f\xf1" "\x60\xba\x4e\x44\x2c\xbd\xf5\xf6\x9b\x8d\xb9\xb9\xd9\xc5\xfb\xff\x50\x5e" "\x02\xfb\xa8\xee\x83\x0f\x87\xf5\x43\xf4\x1e\x8a\x66\x3c\x9a\xbe\xf3\x04" "\x28\x9f\xff\x1f\x44\x8a\xdf\x79\xff\x3f\x3a\x0f\xfc\xce\xf3\xff\x97\xda" "\xdf\x6e\x3f\xe1\xe3\x67\x7f\xba\xf5\xfc\x7f\x79\xe7\x86\xf6\xf8\xfc\xef" "\xdd\x59\xef\x1e\xcf\xff\xa7\xba\x96\xbd\x9c\x7f\x37\xd2\xd7\x1b\x31\xb0" "\x7c\x63\xa1\xef\x78\xc4\xc0\xd2\x5b\x6f\x9f\x6c\xde\x68\x5c\x9f\xbd\x3e" "\xdb\x3a\x77\xea\xd4\x97\x46\x46\xbe\x74\xf6\x54\xdf\x91\x88\x81\x6b\xcd" "\xb9\xd9\xae\x4f\x0f\xe4\x70\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x3c\x3c\xa9\x88\xdf\x8b\x14\x8d\x1f\x6d\xa4\x5a\x44\xdc\xaa\xc6" "\x6b\x0d\x5d\x18\x79\xfe\xe4\x73\x3d\xd1\x53\x8d\xb7\xda\x36\x6e\xfb\x8d" "\x89\x2b\x17\x6b\xaf\xce\xdf\x58\x58\x9c\x5d\x5a\x9a\x9d\xa9\x4d\xb6\x9a" "\xd3\xf3\x33\xb3\x7b\xdd\xdd\x40\x35\xdc\x6b\x72\x74\xec\x40\x3a\x73\x4f" "\x83\x07\xdc\xfe\xc1\x81\x57\xe7\x17\xde\x5a\x6c\x5e\xff\xa3\xe5\x5d\xd7" "\x1f\x1d\xb8\x78\x75\x69\x79\xb1\x31\xbd\xfb\xea\x18\x8c\x22\xa2\xde\xbd" "\x64\xb8\x6a\xf0\xe4\xe8\x58\xd5\xe8\xb9\x66\xa3\x55\x55\x1d\xdf\x75\x30" "\xfd\x2f\xae\x2f\x15\xf1\x9f\x91\x62\xfa\x5c\x2d\x7d\x2e\x2f\xcb\xe3\xff" "\x76\x8e\xf0\xdf\x36\xfe\x7f\x65\xe7\x86\x0e\x68\xfc\xff\x27\xbb\x96\x95" "\xfb\x4c\xa9\x88\x9f\x45\x8a\xdf\xfe\xcb\x67\xe2\x73\x55\x3b\x8f\xc6\x1d" "\xc7\x2c\x97\xfb\xdb\x48\x31\x7c\xfe\xb3\xb9\x5c\x1c\x29\xcb\x75\xda\xd0" "\x7e\xaf\x40\x7b\x64\x60\x59\xf6\x7f\x23\xc5\x3f\xfe\x7c\x7b\xd9\xce\x78" "\xc8\xa7\xb6\xca\x9e\xde\xf3\x81\x7d\x4c\x94\xe7\xff\x58\xa4\xf8\xde\x9f" "\x7f\x27\x7e\x23\x2f\xdb\xfe\xfe\x87\xdd\xcf\xff\xd1\x9d\x1b\x3a\xa0\xf3" "\xff\x74\xd7\xb2\xa3\xdb\xde\x57\xb0\xef\xae\x93\xcf\xff\xc9\x48\xf1\xca" "\x53\xef\xc6\x6f\xe6\x65\x1f\xf5\xfe\x8f\xce\xbb\x37\x4e\xe4\xc2\xb7\xdf" "\xcf\x71\x40\xe7\xff\xd3\x5d\xcb\x86\xf2\x7e\x7f\xeb\xc1\x74\x1d\x00\x00" "\x00\x00\x00\x00\x00\x00\xe0\xb1\xd6\x97\x8a\xf8\xbb\x48\xf1\x83\xb1\xde" "\xf4\x52\x5e\xb6\x97\xbf\xff\x37\xb3\x73\x43\x07\xf4\xf7\xbf\x3e\xd3\xb5" "\x6c\xe6\xc1\xcc\x57\x74\xcf\x0f\xfb\x3e\xa8\x00\x00\x00\x00\x70\x48\xf4" "\xa5\x22\x7e\x1c\x29\xae\x2f\xbf\x7b\x7b\x0c\xf5\xf6\xf1\xdf\x5d\xe3\x3f" "\x7f\x77\x6b\xfc\xe7\x68\xda\xb1\xb6\xfa\x73\xbe\x5f\xa9\xde\x1b\xf0\x20" "\xff\xfc\xaf\xdb\x50\xde\xef\xd4\xfe\xbb\x0d\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x87\x4a\x4a\x45\xbc\x94\xe7\x53\x9f\xba" "\xc7\x7c\xea\x6b\x91\xe2\xb5\xff\x7e\x21\x97\x4b\xc7\xcb\x72\x9d\x79\xe0" "\x87\xaa\x5f\x07\x2e\xcf\xb7\x4e\x5e\x9c\x9b\x9b\x9f\x6e\x2c\x37\xae\xce" "\xcd\xd6\x26\x16\x1a\xd3\xb3\x65\xdd\xa7\x23\xc5\xc6\xdf\x7c\x36\xd7\x2d" "\xaa\xf9\xd5\x3b\xf3\xcd\xb7\xe7\x78\xdf\x9a\x8b\x7d\x31\x52\x8c\xfd\x7d" "\xa7\x6c\x7b\x2e\xf6\xce\xdc\xe4\x4f\x6f\x95\x3d\x5d\x96\xfd\x64\xa4\xf8" "\xaf\x7f\xd8\x5e\xb6\x33\x8f\xf5\xa7\xb7\xca\x9e\x29\xcb\xfe\x75\xa4\xf8" "\xda\x3f\xef\x5e\xf6\xf8\x56\xd9\xb3\x65\xd9\xef\x44\x8a\x1f\x7e\xad\xd6" "\x29\x7b\xb4\x2c\xdb\x79\x3f\xea\x67\xb6\xca\xbe\x38\x3d\x5f\x1c\xc0\x59" "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x49\xd3" "\x97\x8a\xf8\xb3\x48\xf1\x3f\x37\x56\x6f\x8f\xe5\xcf\xf3\xff\xf7\x75\x7d" "\xad\xbc\xf3\x8d\xae\xf9\xfe\x77\xb8\x55\xcd\xf3\x3f\x54\xcd\xff\x7f\xb7" "\xcf\xf7\x33\xff\x7f\xf5\x5e\x81\x95\xbb\xed\x15\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3e\x9e\x52\x14\xf1\x76\xa4" "\x58\xb8\xbc\x91\xd6\xfa\xcb\xef\x6d\x03\x97\x9a\xad\x9b\xb7\x26\x47\xc7" "\x76\xaf\x36\x98\xaa\x9a\x3d\x55\xf9\xf2\x67\xe0\xf4\x99\xb3\xe7\xbe\xf8" "\xd2\xc8\xf9\x4e\x7e\x74\xfd\x07\xed\xd9\x78\x63\xe2\xca\xc5\xda\xab\xf3" "\x37\x16\x16\x67\x97\x96\x66\x67\x6a\x93\xad\xe6\xf4\xfc\xcc\xec\x9e\xb7" "\xb0\xdf\xfa\x3b\x0d\x57\x07\xa0\x76\xe3\xcd\x9b\x33\xd7\xae\x2d\xd5\xce" "\xbc\x78\x76\xdb\xea\x5b\x43\x1f\xf6\x7f\xe2\xf8\xd0\x85\x91\xe7\x4f\x3e" "\xd7\x29\x3b\x39\x3a\x36\x36\xd1\x55\xa6\xb7\xef\xbe\xf7\x7e\x87\x74\x97" "\xe5\x47\xa2\x88\xbf\x8a\x14\x2f\x7c\xf7\x27\xe9\x07\xfd\x11\x45\xec\xff" "\x58\xdc\xe3\xda\x39\x68\x83\x55\x27\x86\xab\x4e\x4c\x8e\x8e\x55\x1d\x99" "\x6b\x36\x5a\xcb\xe5\xca\xf1\xce\x81\x28\x22\x6a\x5d\x95\xea\x9d\x63\xf4" "\x10\xce\xc5\xbe\xd4\x23\x56\xca\xe6\x97\x0d\x1e\x2e\xbb\x37\xb1\xd0\x58" "\x6c\x5c\x9d\x9b\xad\x8d\x37\x16\x97\x9b\xcb\xcd\xf9\xd6\x78\x6a\xb7\xb6" "\xec\x4f\x2d\x8a\x38\x9f\x22\x56\x23\x62\xbd\xff\xce\xcd\xf5\x45\x11\x6f" "\x46\x8a\x6f\x1f\xdb\x48\xff\xd2\x1f\xd1\xd3\x39\x0e\x5f\xb8\x3c\xf1\x95" "\x53\x67\xee\xde\x8e\xe2\x00\xfb\xb8\x07\x65\x3b\x6b\x7d\x11\xab\xc5\x63" "\x70\xce\x0e\xb1\xfe\x28\xe2\x9f\x22\xc5\x4f\xdf\x3b\x11\xff\xda\x1f\xd1" "\x1b\xed\x9f\xf8\x7c\xc4\xeb\x65\x7e\x3f\xe2\x9d\x68\x9f\xef\x54\x5e\x18" "\xe7\x22\x3e\xd8\xe5\x3a\xe2\xf1\xd4\x1b\x45\xfc\x5f\x79\xfe\x2f\x6c\xa4" "\xf7\xfa\xcb\xfb\x41\xe7\xbe\x72\xe9\xab\xb5\x2f\xb7\xae\xcd\x77\x95\xed" "\xdc\x57\x1e\xfb\xe7\xc3\xc3\x74\xc8\xef\x4d\x03\x51\xc4\x0f\xab\x3b\xfe" "\x46\xfa\x37\xff\x5d\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x1c\x22\x45\xfc\x5a\xa4\x78\xf9\xfd\x13\xa9\x1a\x1f\x7c\x7b\x4c\x71\xb3" "\x75\xbd\x76\xa5\x71\x75\xae\x3d\xac\xaf\x33\xf6\xaf\x33\x66\x7a\x73\x73" "\x73\xb3\x96\xda\x59\xcf\x39\x95\x73\x25\xe7\x6a\xce\xb5\x9c\xeb\x39\xa3" "\xc8\xf5\x73\xd6\xcb\x1c\xd8\xdc\x9c\xca\xdf\x57\x72\xae\xe6\x5c\xcb\xb9" "\x9e\x33\x7a\x72\xfd\x9c\xf5\x9c\x53\x39\x57\x72\xae\xe6\x5c\xcb\xb9\x9e" "\x33\x7a\x73\xfd\x9c\xf5\x9c\x53\x39\x57\x72\xae\xe6\x5c\xcb\xb9\x9e\x33" "\x0e\xc9\xd8\x3d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\xe0\xe3\xa5\xa8\xfe\x49\xf1\xad\xaf\x6f\xa4\xcd\xfe\xf6\xfc\xd2\x53\xd1" "\xce\x35\xf3\x81\x7e\xec\xfd\x7f\x00\x00\x00\xff\xff\x5a\x46\xfb\x69", 3095); syz_mount_image(0x20000000, 0x20000040, 0x2000002, 0x20000100, 1, 0xc17, 0x20000e00); memcpy((void*)0x20000040, ".\000", 2); res = syscall(__NR_openat, 0xffffff9c, 0x20000040ul, 0ul, 0ul); if (res != -1) r[0] = res; memcpy((void*)0x200001c0, "./file0\000", 8); memcpy((void*)0x20000200, "./bus\000", 6); inject_fault(19); syscall(__NR_renameat2, r[0], 0x200001c0ul, r[0], 0x20000200ul, 0ul); } 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); setup_fault(); use_temporary_dir(); loop(); return 0; }