// https://syzkaller.appspot.com/bug?id=ba4286c15d3479ff087fb1af311a1aa27fc32afc // 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 #ifndef __NR_renameat2 #define __NR_renameat2 316 #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*)0x20000c00, "udf\000", 4); memcpy((void*)0x20000200, "./file0\000", 8); memcpy((void*)0x20000180, "unhide", 6); *(uint8_t*)0x20000186 = 0x2c; memcpy((void*)0x20000187, "umask", 5); *(uint8_t*)0x2000018c = 0x3d; sprintf((char*)0x2000018d, "%023llo", (long long)0x1ff); *(uint8_t*)0x200001a4 = 0x2c; memcpy((void*)0x200001a5, "gid", 3); *(uint8_t*)0x200001a8 = 0x3d; sprintf((char*)0x200001a9, "%020llu", (long long)0); *(uint8_t*)0x200001bd = 0x2c; memcpy((void*)0x200001be, "noadinicb", 9); *(uint8_t*)0x200001c7 = 0x2c; memcpy((void*)0x200001c8, "gid=ignore", 10); *(uint8_t*)0x200001d2 = 0x2c; *(uint8_t*)0x200001d3 = 0; memcpy( (void*)0x20000c40, "\x78\x9c\xec\xdd\x4f\x6c\x1c\xd7\x7d\x07\xf0\xdf\x1b\x92\x22\x25\xb7\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\xb6\x2e\x90\x5c\x7c\x28\x72\xea\x89\x68\x61" "\x23\x28\x7a\x60\x8b\x00\x39\x05\x0c\x66\xf6\xad\xb8\xa4\x28\x8b\x36\x45" "\x89\xb4\x3e\x1f\x69\xf9\xdd\x9d\x79\x6f\xf6\xbd\x99\xd5\x0c\x45\xf0\xcd" "\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\xe2\xf7\x5f" "\xbd\x74\xfa\x4c\x7a\xd4\xad\x00\x00\x1e\xa6\x2b\xe3\x5f\x3d\x7d\xd6\xf5" "\x1f\x00\x1e\x2b\x57\xfd\xff\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x0e\xba\x14\x45\x3c\x19\x29\xe6\xaf\xac\xa7\xc9\xea\x75\xdb\xc0\xe5" "\x66\xeb\xd6\xed\x89\x91\xd1\x9d\xab\x1d\x4d\x55\xcd\x9e\xaa\x7c\xf9\x18" "\x38\x73\xf6\xdc\xf9\x2f\xbd\x38\x7c\xa1\x93\x1f\x5e\xff\x41\x7b\x26\x5e" "\x1f\xbf\x7a\xa9\xf6\xca\xdc\xcd\xf9\x85\x99\xc5\xc5\x99\xe9\xda\x44\xab" "\x39\x35\x37\x3d\xb3\xeb\x2d\xec\xb5\xfe\x76\x43\xd5\x0e\xa8\xdd\x7c\xe3" "\xd6\xf4\xf5\xeb\x8b\xb5\xb3\x2f\x9c\xdb\xb2\xfa\xf6\xe0\x07\xfd\x4f\x9c" "\x18\xbc\x38\xfc\xdc\xa9\x67\x3b\x65\x27\x46\x46\x47\xc7\xbb\xca\xf4\xf6" "\x7d\xec\x77\xbf\xcb\xbd\x46\x78\x1c\x89\x22\x4e\x45\x8a\xe7\xbf\xf7\x93" "\xd4\x88\x88\x22\xf6\xbe\x2f\xee\xf3\xd9\xd9\x6f\x47\xab\x4e\x0c\x55\x9d" "\x98\x18\x19\xad\x3a\x32\xdb\x6c\xb4\x96\xca\x95\x63\x9d\x1d\x51\x44\xd4" "\xba\x2a\xd5\x3b\xfb\xe8\x21\x1c\x8b\x3d\xa9\x47\x2c\x97\xcd\x2f\x1b\x3c" "\x54\x76\x6f\x7c\xbe\xb1\xd0\xb8\x36\x3b\x53\x1b\x6b\x2c\x2c\x35\x97\x9a" "\x73\xad\xb1\xd4\x6e\x6d\xd9\x9f\x5a\x14\x71\x21\x45\xac\x44\xc4\x5a\xff" "\xdd\x9b\xeb\x8b\x22\x7a\x23\xc5\x77\x8e\xaf\xa7\x6b\x11\xd1\xd3\xd9\x0f" "\x5f\xac\x06\x06\xdf\xbb\x1d\xc5\x3e\xf6\x71\x17\xca\x76\xd6\xfa\x22\x56" "\x8a\x43\x70\xcc\x0e\xb0\xfe\x28\xe2\xb5\x48\xf1\xd3\x77\x8b\x98\x2a\xf7" "\x59\x7e\xc4\x17\x22\x5e\x2b\xf3\x07\x11\x6f\x97\xf9\x72\x44\x2a\x3f\x18" "\xe7\x23\xde\xdf\xe1\x73\xc4\xe1\xd4\x1b\x45\xfc\x45\x79\xfc\x2f\xae\xa7" "\xe9\xea\x7c\xd0\x39\xaf\x5c\xfe\x5a\xed\x2b\xad\xeb\x73\x5d\x65\x3b\xe7" "\x95\x43\x7f\x7d\x78\x98\x0e\xf8\xb9\x69\x20\x8a\x68\x54\x67\xfc\xf5\xf4" "\xf1\xbf\xd9\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x41" "\x3b\x1a\x45\x3c\x13\x29\x5e\xfd\x8f\x3f\xae\xc6\x15\x47\x35\x2e\xfd\xf8" "\xc5\xe1\x3f\x18\xfc\xe5\xee\x31\xe3\x4f\xdf\x67\x3b\x65\xd9\x17\x22\x62" "\xb9\xd8\xdd\x98\xdc\x23\x79\x08\xf1\x58\x1a\x4b\xe9\x11\x8f\x25\x7e\x9c" "\x0d\x44\x11\x7f\x92\xc7\xff\x7d\xeb\x51\x37\x06\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xb1\x56\xc4\x8f\x23\xc5\x4b\xef\x9d" "\x4c\x2b\xd1\x3d\xa7\x78\xb3\x75\xa3\x76\xb5\x71\x6d\xb6\x3d\x2b\x6c\x67" "\xee\xdf\xce\x9c\xe9\x1b\x1b\x1b\x1b\xb5\xd4\xce\x7a\xce\xc9\x9c\xcb\x39" "\x57\x72\xae\xe6\x5c\xcb\x19\x45\xae\x9f\xb3\x9e\x73\x32\xe7\x72\xce\x95" "\x9c\xab\x39\xd7\x72\x46\x4f\xae\x9f\xb3\x9e\x73\x32\xe7\x72\xce\x95\x9c" "\xab\x39\xd7\x72\x46\x6f\xae\x9f\xb3\x9e\x73\x32\xe7\x72\xce\x95\x9c\xab" "\x39\xd7\x72\xc6\x01\x99\xbb\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\xe0\x93\xa4\x88\x22\x7e\x1e\x29\xbe\xfd\x8d\xf5\x14\x29\x22\xea\x11\x93" "\xd1\xce\xd5\xfe\x47\xdd\x3a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\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\xd4\x9f\x8a\xf8\x7e\xa4\xa8\xfd\x61" "\xfd\xce\xb2\xde\x88\x48\xd5\xdf\xb6\x93\xe5\x97\xf3\x51\x3f\x52\xe6\xa7" "\xa3\x3e\x5c\xe6\xcb\x51\xbf\x94\xb3\x51\x65\x6f\xfd\x5b\x8f\xa0\xfd\xec" "\x4d\x5f\x2a\xe2\x47\x91\xa2\x7f\xe0\x9d\x3b\x07\x3c\x1f\xff\xbe\xf6\xab" "\x3b\x1f\x83\x78\xfb\x9b\x9b\xaf\x7e\xb5\xb7\x9d\x3d\x9d\x95\x83\x1f\xf4" "\x3f\x71\xe2\xf8\xc5\xe1\xd1\x5f\x7f\xfa\x5e\xcf\xd3\x4e\x0d\x18\xba\xdc" "\x6c\xdd\xba\x5d\x9b\x18\x19\x1d\x1d\xef\x5a\xdc\x9b\xdf\xfd\xd3\x5d\xcb" "\x06\xf3\xfb\x16\x0f\xa6\xeb\x44\xc4\xe2\x9b\x6f\xbd\xd1\x98\x9d\x9d\x59" "\xf0\xc4\x13\x4f\x3e\x01\x4f\x62\x20\xe2\x81\x6c\x87\xc7\x40\x79\xfd\x7f" "\x3f\x52\xfc\xce\x7b\xff\xd9\xb9\xe0\x77\xae\xff\xbf\xd4\x7e\x75\xe7\x0a" "\x1f\x3f\xfb\xd3\xcd\xeb\xff\x4b\xdb\x37\xb4\x4f\xd7\xff\x27\xbb\x96\xbd" "\x94\xbf\x1b\xe9\xeb\x8d\x18\x58\xba\x39\xdf\x77\x22\x62\x60\xf1\xcd\xb7" "\x4e\x35\x6f\x36\x6e\xcc\xdc\x98\x69\x9d\x3f\x7d\xfa\xcb\xc3\xc3\x5f\x3e" "\x77\xba\xef\x48\xc4\xc0\xf5\xe6\xec\x4c\xd7\xb3\x3d\xef\x2a\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x87\x2b\x15\xf1\x7b\x91\xa2\xf1" "\xa3\xf5\x54\x8b\x88\xdb\xd5\x78\xad\xc1\x8b\xc3\xcf\x9d\x7a\xb6\x27\x7a" "\xaa\xf1\x56\x5b\xc6\x6d\xbd\x3e\x7e\xf5\x52\xed\x95\xb9\x9b\xf3\x0b\x33" "\x8b\x8b\x33\xd3\xb5\x89\x56\x73\x6a\x6e\x7a\x66\xb7\x6f\x37\x50\x0d\xf7" "\x9a\x18\x19\xdd\x97\xce\xdc\xd7\xd1\x7d\x6e\xff\xd1\x81\x57\xe6\xe6\xdf" "\x5c\x68\xde\xf8\xa3\xa5\x1d\xd7\x1f\x1b\xb8\x74\x6d\x71\x69\xa1\x31\xb5" "\xf3\xea\x38\x1a\x45\x44\xbd\x7b\xc9\x50\xd5\xe0\x89\x91\xd1\xaa\xd1\xb3" "\xcd\x46\xab\xaa\x3a\xb6\xe3\x60\xba\x8f\xae\x2f\x15\xf1\x5f\x91\x62\xea" "\x7c\x2d\x7d\x3e\x2f\xcb\xe3\xff\xb6\x8f\xf0\xdf\x32\xfe\x7f\x79\xfb\x86" "\xf6\x69\xfc\xdf\xa7\xba\x96\x95\xef\x99\x52\x11\x3f\x8b\x14\xbf\xfd\x97" "\x4f\xc7\xe7\xab\x76\x1e\x8b\xbb\xf6\x59\x2e\xf7\xb7\x91\x62\xe8\xc2\xe7" "\x72\xb9\x38\x52\x96\xeb\xb4\xa1\x7d\x5f\x81\xf6\xc8\xc0\xb2\xec\xff\x45" "\x8a\x7f\xfc\xf9\xd6\xb2\x9d\xf1\x90\x4f\x6e\x96\x3d\xb3\xeb\x1d\x7b\x48" "\x94\xc7\xff\x78\xa4\xf8\xfe\x9f\x7f\x37\x7e\x23\x2f\xdb\x7a\xff\x87\x9d" "\x8f\xff\xb1\xed\x1b\xda\xa7\xe3\xff\x54\xd7\xb2\x63\x5b\xee\x57\xb0\xe7" "\xae\x93\x8f\xff\xa9\x48\xf1\xf2\x93\xef\xc4\x6f\xe6\x65\x1f\x76\xff\x8f" "\xce\xbd\x37\x4e\xe6\xc2\x77\xee\xcf\xb1\x4f\xc7\xff\x33\x5d\xcb\x06\xf3" "\xfb\xfe\xd6\x83\xe9\x3a\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xa1\xd6\x97" "\x8a\xf8\xbb\x48\xf1\xec\x68\x6f\x7a\x31\x2f\xdb\xcd\xef\xff\x4d\x6f\xdf" "\xd0\x3e\xfd\xfe\xd7\x67\xbb\x96\x4d\x3f\xa4\xf9\x8a\xf6\xbc\x53\x01\x00" "\x00\x00\xe0\x80\xe8\x4b\x45\xfc\x38\x52\xdc\x58\x7a\xe7\xce\x18\xea\xad" "\xe3\xbf\xbb\xc6\x7f\xfe\xee\xe6\xf8\xcf\x91\xb4\x6d\x6d\xf5\x73\xbe\x5f" "\xa9\xee\x1b\xf0\x20\x7f\xfe\xd7\x6d\x30\xbf\xef\xe4\xde\xbb\x0d\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x4a\x4a\x45\xbc" "\x98\xe7\x53\x9f\xbc\xcf\x7c\xea\xab\x91\xe2\xd5\xff\x79\x3e\x97\x4b\x27" "\xca\x72\x9d\x79\xe0\x07\xab\xaf\x03\x57\xe6\x5a\xa7\x2e\xcd\xce\xce\x4d" "\x35\x96\x1a\xd7\x66\x67\x6a\xe3\xf3\x8d\xa9\x99\xb2\xee\x53\x91\x62\xfd" "\x6f\x3e\x97\xeb\x16\xd5\xfc\xea\x9d\xf9\xe6\xdb\x73\xbc\x6f\xce\xc5\xbe" "\x10\x29\x46\xff\xbe\x53\xb6\x3d\x17\x7b\x67\x6e\xf2\xa7\x36\xcb\x9e\x29" "\xcb\x7e\x2a\x52\xfc\xf7\x3f\x6c\x2d\xdb\x99\xc7\xfa\x33\x9b\x65\xcf\x96" "\x65\xff\x3a\x52\x7c\xfd\x9f\x77\x2e\x7b\x62\xb3\xec\xb9\xb2\xec\x77\x23" "\xc5\x0f\xbf\x5e\xeb\x94\x3d\x56\x96\xed\xdc\x1f\xf5\xb3\x9b\x65\x5f\x98" "\x9a\x9b\xbd\xeb\x56\xa8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xf0\x51\xf5\xa5\x22\xfe\x2c\x52\xfc\xef\xcd\x95\x3b\x63\xf9" "\xf3\xfc\xff\x7d\x5d\x2f\x2b\x6f\x7f\xb3\x6b\xbe\xff\x6d\x6e\x57\xf3\xfc" "\x0f\x56\xf3\xff\xdf\xeb\xf9\xc7\x99\xff\x7f\xf0\xc1\x74\x13\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x95\x14\x45" "\xbc\x15\x29\xe6\xaf\xac\xa7\xd5\xfe\xf2\x75\xdb\xc0\xe5\x66\xeb\xd6\xed" "\x89\x91\xd1\x9d\xab\x1d\x4d\x55\xcd\x9e\xaa\x7c\xf9\x18\x38\x73\xf6\xdc" "\xf9\x2f\xbd\x38\x7c\xa1\x93\x1f\x5e\xff\x41\x7b\x26\x5e\x1f\xbf\x7a\xa9" "\xf6\xca\xdc\xcd\xf9\x85\x99\xc5\xc5\x99\xe9\xda\x44\xab\x39\x35\x37\x3d" "\xb3\xeb\x2d\x7c\xd4\xfa\x1b\x69\xfb\x92\xad\x0b\x86\xaa\x1d\x50\xbb\xf9" "\xc6\xad\xe9\xeb\xd7\x17\x6b\x67\x5f\x38\xb7\x65\xf5\xed\xc1\x0f\xfa\x9f" "\x38\x31\x78\x71\xf8\xb9\x53\xcf\x76\xca\x4e\x8c\x8c\x8e\x8e\x77\x95\xe9" "\xed\xdb\x75\xeb\xef\xeb\xae\xd6\x66\x47\xa2\x88\xbf\x8a\x14\xcf\x7f\xef" "\x27\xe9\x5f\xfa\x23\x8a\xf8\x18\xfb\x62\x9b\xfb\x7c\x76\xf6\xdb\xd1\xaa" "\x13\x43\x55\x27\x26\x46\x46\xab\x8e\xcc\x36\x1b\xad\xa5\x72\xe5\x58\x67" "\x47\x14\x11\xb5\xae\x4a\xf5\xce\x3e\x7a\x08\xc7\x62\x4f\xea\x11\xcb\x65" "\xf3\xcb\x06\x0f\x95\xdd\x1b\x9f\x6f\x2c\x34\xae\xcd\xce\xd4\xc6\x1a\x0b" "\x4b\xcd\xa5\xe6\x5c\x6b\x2c\xb5\x5b\x5b\xf6\xa7\x16\x45\x5c\x48\x11\x2b" "\x11\xb1\xd6\x7f\xf7\xe6\xfa\xa2\x88\x37\x22\xc5\x77\x8e\xaf\xa7\x7f\xed" "\x8f\xe8\xe9\xec\x87\x2f\x5e\x19\xff\xea\xe9\xb3\xf7\x6e\x47\xb1\x8f\x7d" "\xdc\x85\xb2\x9d\xb5\xbe\x88\x95\xe2\x10\x1c\xb3\x03\xac\x3f\x8a\xf8\xa7" "\x48\xf1\xd3\x77\x4f\xc6\xbf\xf5\x47\xf4\x46\xfb\x11\x5f\x88\x78\xad\xcc" "\x1f\x44\xbc\x5d\xe6\xcb\x11\xa9\xfc\x60\x9c\x8f\x78\x7f\x87\xcf\x11\x87" "\x53\x6f\x14\xf1\xff\xe5\xf1\xbf\xb8\x9e\xde\xed\x2f\xcf\x07\x9d\xf3\xca" "\xe5\xaf\xd5\xbe\xd2\xba\x3e\xd7\x55\xb6\x73\x5e\x39\xf4\xd7\x87\x87\xe9" "\x80\x9f\x9b\x06\xa2\x88\x1f\x56\x67\xfc\xf5\xf4\xef\xfe\x5d\x03\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x20\x45\xfc\x5a\xa4\x78\xe9" "\xbd\x93\xa9\x1a\x1f\x7c\x67\x4c\x71\xb3\x75\xa3\x76\xb5\x71\x6d\xb6\x3d" "\xac\xaf\x33\xf6\xaf\x33\x66\x7a\x63\x63\x63\xa3\x96\xda\x59\xcf\x39\x99" "\x73\x39\xe7\x4a\xce\xd5\x9c\x6b\x39\xa3\xc8\xf5\x73\xd6\x73\x4e\xe6\x5c" "\xce\xb9\x92\x73\x35\xe7\x5a\xce\xe8\xc9\xf5\x73\xd6\x73\x4e\xe6\x5c\xce" "\xb9\x92\x73\x35\xe7\x5a\xce\xe8\xcd\xf5\xcb\xac\x6d\x6c\xd4\xf3\xeb\xc9" "\x9c\xcb\x39\x57\x72\xae\xe6\x5c\xcb\x19\x07\x64\xec\x1e\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xc9\x52\x54\x7f\x52\x7c\xfb" "\x1b\xeb\x69\xa3\xbf\x3d\xbf\xf4\x64\xb4\x73\xd5\x7c\xa0\x9f\x78\xbf\x08" "\x00\x00\xff\xff\xd6\x96\xfc\xed", 3068); syz_mount_image(/*fs=*/0x20000c00, /*dir=*/0x20000200, /*flags=*/0x44, /*opts=*/0x20000180, /*chdir=*/1, /*size=*/0xbfc, /*img=*/0x20000c40); memcpy((void*)0x20000040, ".\000", 2); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000040ul, /*flags=*/0ul, /*mode=*/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, /*oldfd=*/r[0], /*old=*/0x200001c0ul, /*newfd=*/r[0], /*new=*/0x20000200ul, /*flags=*/0ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); setup_fault(); use_temporary_dir(); loop(); return 0; }