// 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_mkdirat #define __NR_mkdirat 34 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_openat #define __NR_openat 56 #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); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; memcpy((void*)0x20000100, "ext4\000", 5); memcpy((void*)0x20000500, "./file0\000", 8); memcpy( (void*)0x20000a80, "\x78\x9c\xec\xdd\xcf\x6f\x23\x57\x1d\x00\xf0\xef\x4c\x7e\x76\x9b\x36\xbb" "\xd0\x03\x54\xc0\x2e\x50\x58\xd0\x6a\xed\x8d\xb7\x5d\x55\xbd\xb4\x7b\x01" "\xa1\xaa\x12\xa2\xe2\x80\x38\x6c\x43\xe2\x8d\x42\xec\x38\xc4\x4e\x69\x42" "\x24\xd2\xbf\x01\x24\x90\x38\xc1\x9f\xc0\x01\x89\x03\x52\x4f\x1c\xb8\x71" "\x44\xe2\x80\x90\xca\x01\x69\x81\x08\xb4\x41\x02\xc9\x68\xc6\x93\xd4\x4d" "\x9c\xc6\x34\x8e\x0d\xf1\xe7\x23\x8d\x66\xde\x3c\xfb\x7d\xdf\x5b\xef\xcc" "\x9b\x79\x76\xe6\x05\x30\xb6\x6e\x44\xc4\x5e\x44\x4c\x47\xc4\x1b\x11\x31" "\x5f\xec\x4f\x8a\x25\x5e\xe9\x2c\xd9\xeb\x1e\xef\xef\x2e\x1d\xec\xef\x2e" "\x25\xd1\x6e\xbf\xfe\xd7\x24\xcf\xcf\xf6\x45\xd7\x7b\x32\x4f\x16\x65\xce" "\x46\xc4\xd7\xbe\x1c\xf1\xad\xe4\x64\xdc\xe6\xf6\xce\xda\x62\xad\x56\xdd" "\x2c\xd2\xe5\x56\x7d\xa3\xdc\xdc\xde\xb9\xbd\x5a\x5f\x5c\xa9\xae\x54\xd7" "\x2b\x95\x7b\x0b\xf7\xee\xbc\x78\xf7\x85\xca\xc0\xda\x7a\xbd\xfe\xf3\x47" "\x5f\x5a\x7d\xf5\xeb\xbf\xfa\xe5\x27\xdf\xfd\xed\xde\x17\xbf\x97\x55\x6b" "\xae\xc8\xeb\x6e\xc7\x20\x75\x9a\x3e\x75\x14\x27\x33\x19\x11\xaf\x5e\x44" "\xb0\x11\x98\x28\xd6\xd3\x23\xae\x07\x1f\x4e\x1a\x11\x1f\x89\x88\xcf\xe4" "\xc7\xff\x7c\x4c\xe4\xff\x3b\x01\x80\xcb\xac\xdd\x9e\x8f\xf6\x7c\x77\x1a" "\x00\xb8\xec\xd2\x7c\x0c\x2c\x49\x4b\xc5\x58\xc0\x5c\xa4\x69\xa9\xd4\x19" "\xc3\x7b\x26\xae\xa4\xb5\x46\xb3\x75\xeb\x61\x63\x6b\x7d\xb9\x33\x56\x76" "\x35\xa6\xd2\x87\xab\xb5\xea\x9d\x6b\x33\xbf\xff\x4e\x7e\xc5\x30\x95\x64" "\xe9\x85\x3c\x2f\xcf\xcf\xd3\x95\x63\xe9\xbb\x11\x71\x2d\x22\x7e\x38\xf3" "\x44\x9e\x2e\x2d\x35\x6a\xcb\xa3\xbb\xec\x01\x80\xb1\xf6\xe4\xb1\xfe\xff" "\x1f\x33\x9d\xfe\xbf\x0f\x3d\xbe\xd5\x03\x00\xfe\x6f\xcc\x8e\xba\x02\x00" "\xc0\xd0\xe9\xff\x01\x60\xfc\xe8\xff\x01\x60\xfc\xf4\xd1\xff\x17\x5f\xf6" "\xef\x5d\x78\x5d\x00\x80\xe1\x70\xff\x0f\x00\xe3\x47\xff\x0f\x00\xe3\x47" "\xff\x0f\x00\x63\xe5\xab\xaf\xbd\x96\x2d\xed\x83\xe2\xf9\xd7\xcb\x6f\x6e" "\x6f\xad\x35\xde\xbc\xbd\x5c\x6d\xae\x95\xea\x5b\x4b\xa5\xa5\xc6\xe6\x46" "\x69\xa5\xd1\x58\xc9\x9f\xd9\x53\x3f\xab\xbc\x5a\xa3\xb1\xb1\xf0\x7c\x6c" "\xbd\x55\x6e\x55\x9b\xad\x72\x73\x7b\xe7\x41\xbd\xb1\xb5\xde\x7a\x90\x3f" "\xd7\xfb\x41\x75\x6a\x28\xad\x02\x00\x3e\xc8\xb5\xeb\xef\xfc\x2e\x89\x88" "\xbd\x97\x9e\xc8\x97\xe8\x9a\xcb\x41\x5f\x0d\x97\x5b\x3a\xea\x0a\x00\x23" "\x33\x31\xea\x0a\x00\x23\x63\xb6\x2f\x18\x5f\xfd\xdf\xe3\xff\xe6\x42\xeb" "\x01\x8c\x4e\xcf\x87\x79\xcf\xf6\xdc\x7c\xbf\x1f\xff\x17\x41\xfc\xce\x08" "\xfe\xa7\xdc\xfc\x78\xff\xe3\xff\xe6\x78\x86\xcb\xc5\xf8\x3f\x8c\xaf\x0f" "\x37\xfe\xff\xf2\xc0\xeb\x01\x0c\x9f\xf1\x7f\x18\x5f\xed\x76\x72\x7c\xce" "\xff\xe9\xa3\x2c\x00\xe0\x52\x3a\xc7\x6f\xfc\xdb\xdf\x1f\xd4\x45\x08\x30" "\x52\x67\x4d\xe6\x3d\x90\xef\xff\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x92\x99\x8b" "\x88\x6f\x47\x92\x96\x8a\xb9\xc0\xe7\x22\x4d\x4b\xa5\x88\xa7\x22\xe2\x6a" "\x4c\x25\x0f\x57\x6b\xd5\x3b\x11\xf1\x74\x5c\x8f\x88\xa9\x99\x2c\xbd\x30" "\xea\x4a\x03\x00\xe7\x94\xfe\x39\x29\xe6\xff\xba\x39\xff\xdc\xdc\xf1\xdc" "\xe9\xe4\x9f\x33\xf9\x3a\x22\xbe\xfb\x93\xd7\x7f\xf4\xd6\x62\xab\xb5\xb9" "\x90\xed\xff\xdb\xd1\xfe\x99\xc3\xe9\xc3\x2a\xef\xbd\xef\x1c\xf3\x0a\x02" "\x00\x03\x96\xf7\xdf\x95\x62\xdd\x75\x23\xff\x78\x7f\x77\xe9\x70\x19\x66" "\x7d\x1e\xdd\x8f\x7f\x17\x53\x11\x2f\x1d\xec\xef\xe6\x4b\x27\x67\x32\x26" "\xf3\xf5\x6c\x7e\x2d\x71\xe5\xef\x49\x91\xee\xcc\x45\xfa\x6c\x44\x4c\x0c" "\x20\xfe\xde\xdb\x11\xf1\xb1\x5e\xed\x4f\xf2\xb1\x91\xab\xc5\xcc\xa7\xdd" "\xf1\xa3\x88\xfd\xd4\x50\xe3\xa7\xef\x8b\x9f\xe6\x79\x9d\x75\x76\xf1\xf5" "\xd1\x01\xd4\x05\xc6\xcd\x3b\xf7\x23\xe2\x95\x5e\xc7\x5f\x1a\x37\xf2\x75" "\xef\xe3\x7f\x36\x3f\x43\x9d\xdf\xa3\xfb\x9d\xc2\x0e\xcf\x7d\x07\x5d\xf1" "\x0f\xcf\x7f\x13\x3d\xe2\x67\xc7\xfc\x8d\x7e\x63\x3c\xff\xeb\xaf\x9c\xd8" "\xd9\x9e\xef\xe4\xbd\x1d\xf1\xec\x64\xaf\xf8\xc9\x51\xfc\xe4\x94\xf8\xcf" "\xf5\x19\xff\x0f\x9f\xf8\xd4\x0f\x5e\x3e\x25\xaf\xfd\xd3\x88\x9b\xd1\x3b" "\x7e\x77\xac\x72\xab\xbe\x51\x6e\x6e\xef\xdc\x5e\xad\x2f\xae\x54\x57\xaa" "\xeb\x95\xca\xbd\x85\x7b\x77\x5e\xbc\xfb\x42\xa5\x9c\x8f\x51\x97\x0f\x47" "\xaa\x4f\xfa\xcb\x4b\xb7\x9e\x3e\xad\x6e\x59\xfb\xaf\x9c\x12\x7f\xb6\x67" "\xfb\xa7\x8f\xde\xfb\xb9\x3e\xdb\xff\xb3\x7f\xbd\xf1\xcd\x4f\x7f\x40\xfc" "\x2f\x7c\xb6\xf7\xe7\xff\x4c\xcf\xf8\x1d\x59\x9f\xf8\xf9\x3e\xe3\x2f\x5e" "\xf9\xc5\xa9\xd3\x77\x67\xf1\x97\x4f\x69\xff\x59\x9f\xff\xad\x3e\xe3\xbf" "\xfb\xa7\x9d\xe5\x3e\x5f\x0a\x00\x0c\x41\x73\x7b\x67\x6d\xb1\x56\xab\x6e" "\x9e\x6b\x23\xbb\x0b\x1d\x44\x39\x27\x36\xb2\x2a\x0e\xb4\xc0\x33\x36\xfe" "\x18\xc3\x8b\x75\xe6\xc6\xd4\x45\xfd\xab\x5e\xf8\xc6\xe4\xd1\xb5\xe2\x60" "\x4b\xfe\x46\x56\xe2\x90\x9b\x93\x0e\xbc\x15\xe7\xda\x78\x3c\xac\x58\xa3" "\x3d\x2f\x01\x17\xef\xbd\x83\x7e\xd4\x35\x01\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x4e\x33\x8c\x3f\x5d\x1a\x75\x1b\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" "\xb8\xbc\xfe\x13\x00\x00\xff\xff\xb6\x28\xcc\x8d", 1326); syz_mount_image(/*fs=*/0x20000100, /*dir=*/0x20000500, /*flags=MS_LAZYTIME|MS_NOSUID*/ 0x2000002, /*opts=*/0x20000080, /*chdir=*/1, /*size=*/0x52e, /*img=*/0x20000a80); memcpy((void*)0x200005c0, "./file0\000", 8); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200005c0ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[0] = res; memcpy((void*)0x20000000, "./bus\000", 6); syscall(__NR_mkdirat, /*fd=*/r[0], /*path=*/0x20000000ul, /*mode=*/0ul); memcpy((void*)0x20000040, "ext4\000", 5); memcpy((void*)0x20000300, "./file0\000", 8); memcpy((void*)0x20000140, "orlov,noblock_validity,usrquota,errors=remount-ro,nojournal_checksum," "jqfmt=vfsold,noinit_itable,inode_readahead_blks=0x0000000000000001," "resuid=", 143); sprintf((char*)0x200001cf, "0x%016llx", (long long)0); memset((void*)0x200001e1, 0, 2); memcpy( (void*)0x20000bc0, "\x78\x9c\xec\xdd\x5d\x6b\x5b\xe7\x1d\x00\xf0\xff\x39\xb6\xf2\xea\xcc\x0e" "\xdb\x45\x16\x58\x16\x96\x0c\x3b\x6c\x91\xec\x78\x49\xcc\x2e\xb2\x6c\x8c" "\xed\x2a\xb0\x2d\xbb\x5e\xe6\xd9\xb2\x31\x96\x2d\x63\xc9\x49\x6c\xc2\xe6" "\xb0\x0f\x30\x18\x63\x1b\x0c\x06\xbd\xea\x4d\xa1\x1f\xa0\x50\xf2\x11\x4a" "\x21\xd0\xde\x97\xb6\xb4\x94\x36\x69\x2f\x72\xd1\x46\x45\x6f\x79\x71\x24" "\xbf\x10\xd9\x0a\xd6\xef\x07\xc7\xe7\x79\xce\x8b\xff\xcf\x5f\x42\x47\x7a" "\xce\x79\x38\x27\x80\x9e\x75\x3a\x22\xce\x44\xc4\xe3\x4a\xa5\x72\x2e\x22" "\x06\x1b\xcb\xd3\xc6\x74\xb5\x5a\x59\xaf\x6f\xf7\xf0\xc1\x9d\xa9\xea\x94" "\x44\xa5\x72\xfd\xf3\x24\x22\xa9\x2f\xab\x6e\x32\xf2\xcc\xff\x3c\x5a\xdf" "\x25\x0e\x45\xc4\x1f\x7e\x1b\xf1\x97\xe4\xc5\xb8\xa5\xd5\xb5\xf9\xc9\x42" "\x21\xbf\xdc\xa8\xe7\xca\x0b\x4b\xb9\xd2\xea\xda\xf9\xb9\x85\xc9\xd9\xfc" "\x6c\x7e\x71\x7c\x7c\xec\xd2\xc4\xe5\x89\x8b\x13\xa3\x1d\xc9\x73\x20\x22" "\xae\xfc\xfa\xe3\x7f\xff\xe3\xf5\xdf\x5c\x79\xfb\xa7\xb7\x3e\xb8\xf1\xe9" "\xc8\x5f\x93\xc6\xf2\x88\xa7\x79\x74\x5a\x3d\xf5\x4c\xed\xb5\x68\xea\x8f" "\x88\xe5\xdd\x08\xd6\x05\x7d\x8d\x7c\x32\xdb\xdf\xe5\xe0\x6e\xb6\x07\x00" "\x80\xcd\x35\x7f\xe7\xff\x28\x22\xce\xc5\x60\xf4\xd5\x7e\xcd\x01\x00\x00" "\x00\xfb\x49\xe5\x17\x03\xf1\x75\x12\x51\x01\x00\x00\x00\xf6\xad\xb4\x36" "\x06\x36\x49\xb3\x8d\x71\x00\x03\x91\xa6\xd9\x6c\x7d\x0c\xef\xf7\xe2\x48" "\x5a\x28\x96\xca\x3f\x99\x29\xae\x2c\x4e\xd7\xc7\xca\x0e\x45\x26\x9d\x99" "\x2b\xe4\x47\x1b\x63\x85\x87\x22\x93\x54\xeb\x63\xb5\xf2\xd3\xfa\x85\x0d" "\xf5\xf1\x88\x38\x1e\x11\xff\x1a\x3c\x5c\xab\x67\xa7\x8a\x85\xe9\x6e\x9f" "\xfc\x00\x00\x00\x80\x1e\x71\x74\x43\xff\xff\xab\xc1\x7a\xff\x1f\x00\x00" "\x00\xd8\x67\x86\xba\xdd\x00\x00\x00\x00\x60\xd7\xe9\xff\x03\x00\x00\xc0" "\xfe\xa7\xff\x0f\x00\x00\x00\xfb\xda\xef\xae\x5d\xab\x4e\x95\xe6\xf3\xaf" "\xa7\x6f\xae\xae\xcc\x17\x6f\x9e\x9f\xce\x97\xe6\xb3\x0b\x2b\x53\xd9\xa9" "\xe2\xf2\x52\x76\xb6\x58\x9c\xad\xdd\xb3\x6f\x61\xab\xff\x57\x28\x16\x97" "\x7e\x16\x8b\x2b\xb7\x73\xe5\x7c\xa9\x9c\x2b\xad\xae\xdd\x58\x28\xae\x2c" "\x96\x6f\xcc\x3d\xf7\x08\x6c\x00\x00\x00\x60\x0f\x1d\xff\xe1\xbd\xf7\x93" "\x88\x58\xff\xf9\xe1\xda\x54\x75\xa0\xdb\x8d\x02\xf6\x44\xff\x4e\x36\xfe" "\x68\xf7\xda\x01\xec\xbd\xbe\x6e\x37\x00\xe8\x9a\x1d\x7d\xff\x03\xfb\x4a" "\xa6\xdb\x0d\x00\xba\x2e\x89\x88\xff\x6f\xb2\xbe\xed\xe0\x9d\x77\x76\xa7" "\x3d\x00\x00\x40\xe7\x0d\x7f\xbf\xf5\xf5\xff\x64\xcb\x73\x03\xeb\xe9\x1e" "\x35\x11\xd8\x25\xce\xff\x41\xef\x72\xfd\x1f\x7a\x97\xeb\xff\xd0\xbb\x32" "\xd1\x17\x3a\xf2\xd0\xdb\x92\x2d\xd6\xbf\xfc\xf5\xff\x4a\x65\x47\x0d\x02" "\x00\x00\x3a\x6e\xa0\x36\x25\x69\x36\xa2\x76\x1e\x60\x20\xd2\x34\x9b\x8d" "\x38\x56\x7b\x2c\x40\x26\x99\x99\x2b\xe4\x47\x23\xe2\x3b\x11\xf1\xde\x60" "\xe6\x60\xb5\x3e\x56\xdb\x33\xd9\xb2\xcf\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd4\x55\x2a\x49\x54\x00" "\x00\x00\x80\x7d\x2d\x22\xfd\x24\x69\x3c\xff\x6b\x78\xf0\xec\xc0\xc6\xf3" "\x03\x07\x92\x47\x83\xb5\x79\x44\xdc\xfa\xdf\xf5\xff\xdc\x9e\x2c\x97\x97" "\xc7\xaa\xcb\xbf\x78\xb2\xbc\xfc\xdf\xc6\xf2\x0b\xdd\x38\x83\x01\x00\x00" "\x00\x6c\xd4\xec\xa7\x37\xfb\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\x49\x0f\x1f\xdc\x99\x6a\x4e\x7b" "\x19\xf7\xb3\x5f\x46\xc4\x50\xab\xf8\xfd\x71\xa8\x36\x3f\x14\x99\x88\x38" "\xf2\x65\x12\xfd\xcf\xec\x97\x44\x44\x5f\x07\xe2\xaf\xdf\x8d\x88\x5f\xfd" "\xa9\x45\xfc\xa4\xda\xac\x18\x6a\xb4\xa2\x55\xfc\xc3\x9d\x8a\x7f\xa2\x55" "\xfe\x9b\xc7\x4f\x23\xe2\x68\x07\xe2\x43\x2f\xbb\x57\x3d\xfe\x5c\x6d\xf5" "\xf9\x4b\xe3\x74\x6d\xbe\xf1\xf3\x77\xf0\xc9\xbe\xfd\x1d\x88\xdf\xfe\xf8" "\x97\x3e\x39\xfe\xf5\xb5\x39\xfe\x1c\xdb\x66\x8c\x93\xf7\xdf\xcc\xb5\x8d" "\x7f\x37\xe2\x64\x7f\xeb\xe3\x4f\x33\x7e\xd2\x26\xfe\x99\x6d\xc6\xff\xf3" "\x1f\xd7\xd6\xda\xad\xab\xbc\x16\x31\xdc\xf2\xfb\x27\x79\x2e\x56\xae\xbc" "\xb0\x94\x2b\xad\xae\x9d\x9f\x5b\x98\x9c\xcd\xcf\xe6\x17\xc7\xc7\xc7\x2e" "\x4d\x5c\x9e\xb8\x38\x31\x9a\x9b\x99\x2b\xe4\x1b\x7f\x5b\xc6\xf8\xe7\x0f" "\xde\x7a\xbc\x59\xfe\x47\xda\xc4\x1f\xda\x22\xff\xb3\xdb\xcc\xff\x9b\xfb" "\xb7\x1f\x7c\xb7\x5e\xcc\xb4\x8a\x3f\x72\xa6\xf5\xfb\x7f\xa2\x4d\xfc\xb4" "\xf1\xdd\xf7\xe3\x46\xb9\xba\x7e\xb8\x59\x5e\xaf\x97\x9f\x75\xea\x8d\x77" "\x4f\x6d\x96\xff\x74\x9b\xfc\xb7\x7a\xff\x47\xb6\x99\xff\xb9\xdf\xff\xfd" "\xc3\x6d\x6e\x0a\x00\xec\x81\xd2\xea\xda\xfc\x64\xa1\x90\x5f\xee\xe9\xc2" "\x4b\xbd\x1a\xd5\x9f\x45\xaf\x44\x16\x0a\x3b\x2d\xfc\xed\xd5\x68\xc6\x2b" "\x59\x68\x7e\x26\x1e\x75\xed\xd8\x04\x00\x00\x74\xd6\x8b\x7d\x60\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\xaf\x75\xe6\x9e" "\x61\xcd\x7b\x62\x6f\x7e\x77\xbd\xa6\xf5\xfa\xec\x85\x7b\x21\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\x74\xd3\xb7\x01\x00\x00\xff\xff\xe0\xfb\xd2\xde", 1256); syz_mount_image(/*fs=*/0x20000040, /*dir=*/0x20000300, /*flags=MS_RDONLY|MS_DIRSYNC|0x400000*/ 0x400081, /*opts=*/0x20000140, /*chdir=*/0x1b, /*size=*/0x4e8, /*img=*/0x20000bc0); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); use_temporary_dir(); loop(); return 0; }