// https://syzkaller.appspot.com/bug?id=330c57bb9492535fc883e94c3bbb1c74aa8e29af // 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, 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*)0x20000000, "nilfs2\000", 7); memcpy((void*)0x20000ec0, "./bus\000", 6); memcpy( (void*)0x20000f00, "\x78\x9c\xec\xdd\x4b\x8c\x1c\x47\xdd\x00\xf0\xea\xd9\x9d\x75\x1c\x3b\xf1" "\x38\x9f\xfd\x65\x71\x42\xb0\x09\x24\xe1\x91\xdd\x78\xbd\x98\x87\x05\x76" "\x14\x5f\xb0\xe2\x88\x5b\xa4\x88\x8b\xe5\x38\xc1\xc2\x31\x08\x47\x0a\x89" "\x2c\x61\xfb\xc4\x8d\x44\x91\xb9\xf2\x10\xa7\x5c\x22\x40\x48\xe4\x82\xac" "\x9c\xb8\x44\x22\x96\xb8\xe4\x14\x38\x70\xc0\x32\x52\x24\x0e\x10\xb0\x07" "\xed\x6c\xd7\xec\xec\xdf\x33\xee\x19\xef\x63\x76\x76\x7e\x3f\xa9\xa6\xa6" "\xba\x7a\xa6\xaa\x7b\xbb\x7b\x7b\xaa\xbb\xab\x12\x30\xb6\x6a\xad\xd7\xf9" "\xf9\xe9\x22\xa5\xcb\xef\xbc\x79\xf4\xef\x8f\xfc\x6d\xeb\xc2\x94\xc3\xed" "\x39\x1a\xad\xd7\xc9\x8e\x54\x3d\xa5\x54\x94\xe9\xc9\xf0\x7d\x1f\x4e\x2c" "\xc6\x37\x3e\x3a\x7f\xb2\x5b\x5c\xa4\xb9\xd6\x6b\x4e\xa7\x67\xae\xb7\x3f" "\xbb\x2d\xa5\x74\x21\xed\x4d\x57\x52\x23\xed\xb9\x7c\xf5\x8d\xf7\xe6\x9e" "\x3e\x7e\xf1\xd8\xa5\x7d\xef\xbf\x75\xe8\xda\xda\x2c\x3d\x00\x00\x8c\x97" "\x6f\x5d\x39\x34\xbf\xfb\x2f\x7f\x7a\x60\xe7\xc7\x6f\x3f\x74\x24\x6d\x69" "\x4f\xcf\xe7\xe7\x8d\x32\xbd\xbd\x3c\xef\x3f\x52\x9e\xf8\xe7\xf3\xff\x5a" "\x5a\x9e\x2e\x3a\x42\xa7\xa9\x30\xdf\x64\x19\x6a\x61\xbe\x89\x2e\xf3\x75" "\x96\x53\x0f\xf3\x4d\xf6\x28\x7f\x2a\x7c\x6f\xbd\xc7\x7c\x5b\x2a\xca\x9f" "\xe8\x98\xd6\x6d\xb9\x61\x94\xe5\xed\xb8\x91\x8a\xda\xcc\xb2\x74\xad\x36" "\x33\xb3\xf8\x9b\x3c\xb5\x7e\xd7\x4f\x15\x33\x67\x4f\x9f\x79\xe1\xdc\x90" "\x2a\x0a\xac\xba\x7f\x7e\x2a\xa5\xb4\x57\x18\xd1\xf0\x4a\xab\xb1\x76\xcd" "\xcb\x69\x2e\x6e\x2c\xc3\x5f\xde\x55\x0f\x17\xbb\x2f\xd7\xe4\x2a\x96\x51" "\x1b\xf6\x32\xde\x2e\x34\x77\x0c\xf7\xf8\x03\x90\xc5\xeb\x85\xb7\xb8\x10" "\x5b\x16\x56\xa6\xfd\x6d\x93\xfd\x95\x7f\xfd\xc9\x5a\xf7\xcf\xc3\x2a\x58" "\xef\xed\x5f\xf9\xa3\x55\xfe\xaf\x2e\x3a\xe2\xb0\x7a\x36\xeb\xd6\x94\x97" "\x2b\xef\x47\xdb\xcb\x74\xbc\x8e\x10\xef\x5f\x1a\x74\xff\xcf\xdf\x17\xaf" "\x47\xd4\xfb\xac\x67\xaf\xeb\x08\xa3\x72\x7d\xa1\x57\x3d\x27\xd6\xb9\x1e" "\x77\xaa\x57\xfd\xe3\x76\xb1\x59\x7d\xbd\x8c\xf3\x7a\xf8\x46\xc8\xef\xdc" "\x7f\xe2\xdf\x74\x54\xfe\xc6\x40\x77\xff\xd2\xfe\x2f\x08\x63\x1b\x9a\xc3" "\x3e\x00\x01\x1b\x56\xbc\x6f\xae\x59\xca\xf9\xf1\xbe\xbe\x98\xbf\xa5\x22" "\xff\xae\x8a\xfc\xad\x15\xf9\x77\x57\xe4\x6f\xab\xc8\x87\x71\xf6\xdb\x97" "\x7f\x92\x5e\x2f\x96\x7e\xe7\x2f\xfd\xa6\xbf\xb7\xb5\xeb\x0c\xda\x1e\x96" "\xdb\xd9\xee\xc9\xdf\x32\x60\x7d\x62\x7b\xe4\xa0\xe5\xc7\xfb\x7e\x07\x53" "\x5b\x71\xf9\xcb\xee\x27\x3e\xbc\xa2\xca\xc0\x9a\xfb\xfd\x89\x67\x4f\x7d" "\xe5\xf9\xe7\xae\x2e\xde\xff\x5f\xb4\xb7\xff\x9b\xe5\xf6\xbe\xb7\x4c\x37" "\xca\x7d\xeb\x4a\x39\x43\x6e\x2f\x8c\xed\xea\xed\x7b\xff\x1b\xcb\xcb\xa9" "\xf5\x98\xef\xbe\x50\x9f\x7b\xba\xcc\xdf\x7a\xbf\x6b\xf9\x7c\x45\x2b\xdd" "\x6c\xd7\xf7\xde\x5e\xf5\x98\x5e\xfe\xb9\x1d\xa1\xc9\xb7\x3d\xdf\x83\xcb" "\xe7\x6b\x84\xef\xdb\x5a\x86\xbb\x42\x7d\xe3\xf9\xc9\xdd\xe1\x73\xf9\xfc" "\x23\x1f\x57\xf3\xfa\x9a\x0c\xcb\x5b\x0f\xcb\x31\x15\xea\x91\x8f\x2b\x3b" "\xcb\x38\xd6\x03\xee\x44\xde\x1e\x7b\xdd\xff\x9f\xb7\xcf\xe9\x54\x2f\x5e" "\x38\x7d\xe6\xd4\x13\x65\x3a\x6f\xa7\x7f\x9c\xa8\x6f\x59\x98\xbe\x7f\x9d" "\xeb\x0d\xac\x5c\xbf\xcf\xff\x4c\xa7\xe5\xcf\xff\x6c\x6f\x4f\xaf\xd7\x3a" "\x8f\x0b\x3b\x96\xa6\x17\x9d\xc7\x85\x46\x98\x3e\xd7\x63\xfa\x81\x32\x9d" "\xff\xcf\x7d\x67\x62\x6b\x6b\xfa\xcc\xc9\xef\x9d\x79\x7e\xb5\x17\x1e\xc6" "\xdc\xb9\x57\x5f\xfb\xee\x89\x33\x67\x4e\xfd\xc0\x1b\x6f\xbc\xf1\xa6\xfd" "\x66\xd8\x47\x26\x60\xad\xcd\xbe\xfc\xd2\xf7\x67\xcf\xbd\xfa\xda\xe3\xa7" "\x5f\x3a\xf1\xe2\xa9\x17\x4f\x9d\x3d\x70\xf0\xe0\x81\xb9\xb9\x83\x5f\x3d" "\x30\x3f\xdb\x3a\xaf\x9f\xed\x3c\xbb\x07\x36\x93\xa5\x7f\xfa\xc3\xae\x09" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\xaf\x57\x8e\x1d\xbd\xfa\xe7\x77" "\xbf\xfc\xc1\xe2\xf3\xff\x4b\xcf\xff\xe5\xe7\xff\xf3\x9d\xbf\xf9\xf9\xff" "\x1f\x87\xe7\xff\xe3\x73\xf2\xf9\x39\xf8\xfc\x1c\xe0\xce\x2e\xf9\xad\x79" "\x42\x07\xab\x53\x61\xbe\x7a\x19\xfe\x2f\xd4\x77\x57\x28\x67\x77\xf8\xdc" "\xff\x97\x71\x7b\x1c\xbf\xf2\xf9\xff\x5c\x5c\xec\xd7\x35\xd7\xe7\xfe\x30" "\x3d\xf6\xdf\x9b\xe7\x0b\xdd\x09\xdc\xd2\x07\xea\x54\xe8\x83\x24\x8e\x17" "\xf8\xe9\x32\xbe\x54\xc6\xbf\x4c\x30\x44\xc5\xd6\xee\x93\xcb\xb8\xdc\x6e" "\xdb\xdd\x4d\xc4\xfe\xad\xf3\xb6\x9e\xfb\xa7\xd0\x2f\xc5\x68\xca\x7f\xb7" "\xbc\x35\xe4\x7e\x4c\xf2\xf3\xdf\xbd\xfa\x75\xca\xc7\xff\x9d\xeb\x50\x47" "\x56\xdf\xed\x1f\x03\x6c\x36\x57\xe3\x71\xc2\x61\x2f\x23\xd0\xdd\x3f\x62" "\xff\xdf\x69\xf8\x7d\x12\x0f\x12\xda\xe7\x1b\x1b\xa0\x2e\x82\x30\xa4\xd0" "\x6c\x36\x7f\x74\x47\xfb\x41\xb3\x69\x14\x0f\x60\x63\x18\xf6\xf8\x9f\xb9" "\xdd\x33\xc7\x67\xff\xf0\xcd\xbb\x16\x42\x9e\xed\xfa\x93\xcb\x8f\x97\xb1" "\xff\x52\x58\x89\x8d\x3e\xfe\xe4\x7a\x94\x5f\x1f\xf3\xe5\xbf\x5d\xf9\xab" "\x3d\xfe\x67\xbb\x33\xe4\xbe\x8f\x7f\x61\xc4\xbc\x46\xff\x65\x75\xb6\x0d" "\xff\xfb\x67\xd7\x3e\xe8\x28\x36\xed\xe9\xb7\xfc\xb8\xfc\xe5\x05\xa1\x62" "\x57\xff\xf5\x58\xf0\x71\x59\x7e\x5e\x9a\x47\x53\x7f\xe5\x37\x7f\x11\xca" "\xdf\x32\x58\xb9\xd9\x7f\x42\xf9\x77\xf7\x59\x7e\xe7\xf2\x9f\x4f\xb7\xf6" "\x5b\xdd\xaf\xff\x96\xe5\xe7\xd5\xf6\xd8\xc3\xfd\x96\xbf\x58\xe3\xa2\xb6" "\x7c\x3d\xc4\x76\xe3\x7c\xfd\x2f\xb6\x1b\x67\x37\xc2\xf2\xe7\xbe\x3d\x07" "\xfe\xfb\xdf\xe1\x40\x8d\x37\xcb\xf2\x61\x9c\x8d\xca\x38\xb3\x83\x1a\x95" "\xf1\x7f\x7b\x89\xf7\x61\x7c\xa9\x4c\xe7\x03\x61\xbe\xcf\x21\x8e\x77\x32" "\x68\xfd\xf3\xfd\x15\xf9\xff\xc0\xee\xf0\xfd\x45\xbc\xe1\xa1\x47\x3d\xa3" "\xee\xad\x4a\x17\x6f\xff\x65\x43\x30\xee\xe3\xff\x7e\xad\x8c\xab\xf6\x87" "\x3c\xfe\x6f\xde\x1e\x1b\x5d\xd2\xb5\x8e\x74\xbd\xcb\xba\xdd\xac\xc7\x1a" "\x18\x55\x1f\x1a\xff\x57\x10\xc6\x36\x34\x9b\xcd\xb5\x6d\xd0\xaa\x30\xd4" "\xc2\x19\xfa\xfa\x1f\xf6\xd5\xe7\x61\x97\x3f\xec\xf5\x5f\x25\x8e\xff\x1b" "\xcf\xe1\xe3\xf8\xbf\x31\x3f\x8e\xff\x1b\xf3\xe3\xf8\xbf\x31\x3f\x8e\xaf" "\x17\xf3\xe3\xf8\xbf\x71\x7d\xc6\xf1\x7f\x63\xfe\xfd\xe1\x7b\xe3\xf8\xc0" "\xd3\x15\xf9\x9f\xa8\xc8\xdf\x53\x91\xff\x40\x45\xfe\x83\x15\xf9\x9f\xac" "\xc8\xdf\x57\x91\xff\x50\x45\x7e\x1c\xb7\x31\xe6\xdf\x17\xda\xf5\x63\xfe" "\xc3\x15\x9f\xff\x4c\x45\xfe\x67\x2b\xf2\x1f\xa9\xc8\x7f\xac\x22\xff\x73" "\x15\xf9\x9b\x5d\x7e\x1e\x65\x5c\x97\x1f\xc6\x59\x7c\x3e\xcf\xfe\x0f\xe3" "\x23\x5f\xff\xe9\xb5\xff\xef\xaa\xc8\x07\x46\xd7\x4f\xdf\xde\xff\xd4\x73" "\xbf\xf9\x76\x63\xf1\xf9\xff\xa9\x76\x7b\x48\xbe\x8e\x77\xa4\x4c\xd7\xcb" "\xdf\xce\x3f\x2c\xd3\xf1\xba\x77\xea\x48\x2f\xe4\xbd\x5b\xa6\xff\x1a\xf2" "\x37\x7a\x7b\x07\x8c\x93\xd8\x7f\x46\xfc\xff\xfe\x68\x45\x3e\x30\xba\xf2" "\x7d\x5e\xf6\x6f\x18\x43\x45\xf7\x1e\x7b\xfa\xed\xb7\xaa\xd7\x79\x3e\xa3" "\xe5\xf3\x65\xfc\x85\x32\xfe\x62\x19\x3f\x5e\xc6\x33\x65\x3c\x5b\xc6\xfb" "\xcb\x78\x6e\x9d\xea\xc7\xda\x78\xea\xd7\xbf\x3b\xf4\x7a\xb1\xf4\x7b\x7f" "\x47\xc8\xef\xf7\x7e\xf2\xf8\x3c\x50\xec\x27\xea\x40\x9f\xf5\x89\xed\x03" "\x83\xde\xcf\x1e\xfb\xf1\x1b\xd4\x4a\xcb\xaf\xb8\x5d\x1e\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x60\xc3\xa9\xb5\x5e\xe7\xe7\xa7\x8b\x94\x2e\xbf\xf3\xe6\xd1\x67\x8f" "\x9f\x9e\x5d\x98\x72\xb8\x3d\x47\xa3\xf5\x3a\xd9\x91\xaa\xb7\x3f\x97\xd2" "\x13\x65\x3c\x51\xc6\x3f\x2f\xdf\xdc\xf8\xe8\xfc\xc9\xce\xf8\x66\x19\x17" "\x69\x2e\x15\xa9\x68\x4f\x4f\xcf\x5c\x6f\x97\xb4\x2d\xa5\x74\x21\xed\x4d" "\x57\x52\x23\xed\xb9\x7c\xf5\x8d\xf7\xe6\x9e\x3e\x7e\xf1\xd8\xa5\x7d\xef" "\xbf\x75\xe8\xda\xda\xad\x01\x00\x00\x00\xd8\xfc\xfe\x17\x00\x00\xff\xff" "\xbc\x1a\x15\x99", 2668); res = -1; res = syz_mount_image(/*fs=*/0x20000000, /*dir=*/0x20000ec0, /*flags=MS_SYNCHRONOUS|MS_MANDLOCK*/ 0x50, /*opts=*/0x20000200, /*chdir=*/0, /*size=*/0xa6c, /*img=*/0x20000f00); if (res != -1) r[0] = res; memcpy((void*)0x20000040, "./bus\000", 6); syscall(__NR_mkdirat, /*fd=*/r[0], /*path=*/0x20000040ul, /*mode=S_IXOTH|S_IXUSR|S_IWUSR|S_IRUSR*/ 0x1c1ul); } 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; }