// https://syzkaller.appspot.com/bug?id=235c340d15618abbde31cd7bed00c7e4009d04d7 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } //% This code is derived from puff.{c,h}, found in the zlib development. The //% original files come with the following copyright notice: //% Copyright (C) 2002-2013 Mark Adler, all rights reserved //% version 2.3, 21 Jan 2013 //% This software is provided 'as-is', without any express or implied //% warranty. In no event will the author be held liable for any damages //% arising from the use of this software. //% Permission is granted to anyone to use this software for any purpose, //% including commercial applications, and to alter it and redistribute it //% freely, subject to the following restrictions: //% 1. The origin of this software must not be misrepresented; you must not //% claim that you wrote the original software. If you use this software //% in a product, an acknowledgment in the product documentation would be //% appreciated but is not required. //% 2. Altered source versions must be plainly marked as such, and must not be //% misrepresented as being the original software. //% 3. This notice may not be removed or altered from any source distribution. //% Mark Adler madler@alumni.caltech.edu //% BEGIN CODE DERIVED FROM puff.{c,h} #define MAXBITS 15 #define MAXLCODES 286 #define MAXDCODES 30 #define MAXCODES (MAXLCODES + MAXDCODES) #define FIXLCODES 288 struct puff_state { unsigned char* out; unsigned long outlen; unsigned long outcnt; const unsigned char* in; unsigned long inlen; unsigned long incnt; int bitbuf; int bitcnt; jmp_buf env; }; static int puff_bits(struct puff_state* s, int need) { long val = s->bitbuf; while (s->bitcnt < need) { if (s->incnt == s->inlen) longjmp(s->env, 1); val |= (long)(s->in[s->incnt++]) << s->bitcnt; s->bitcnt += 8; } s->bitbuf = (int)(val >> need); s->bitcnt -= need; return (int)(val & ((1L << need) - 1)); } static int puff_stored(struct puff_state* s) { s->bitbuf = 0; s->bitcnt = 0; if (s->incnt + 4 > s->inlen) return 2; unsigned len = s->in[s->incnt++]; len |= s->in[s->incnt++] << 8; if (s->in[s->incnt++] != (~len & 0xff) || s->in[s->incnt++] != ((~len >> 8) & 0xff)) return -2; if (s->incnt + len > s->inlen) return 2; if (s->outcnt + len > s->outlen) return 1; for (; len--; s->outcnt++, s->incnt++) { if (s->in[s->incnt]) s->out[s->outcnt] = s->in[s->incnt]; } return 0; } struct puff_huffman { short* count; short* symbol; }; static int puff_decode(struct puff_state* s, const struct puff_huffman* h) { int first = 0; int index = 0; int bitbuf = s->bitbuf; int left = s->bitcnt; int code = first = index = 0; int len = 1; short* next = h->count + 1; while (1) { while (left--) { code |= bitbuf & 1; bitbuf >>= 1; int count = *next++; if (code - count < first) { s->bitbuf = bitbuf; s->bitcnt = (s->bitcnt - len) & 7; return h->symbol[index + (code - first)]; } index += count; first += count; first <<= 1; code <<= 1; len++; } left = (MAXBITS + 1) - len; if (left == 0) break; if (s->incnt == s->inlen) longjmp(s->env, 1); bitbuf = s->in[s->incnt++]; if (left > 8) left = 8; } return -10; } static int puff_construct(struct puff_huffman* h, const short* length, int n) { int len; for (len = 0; len <= MAXBITS; len++) h->count[len] = 0; int symbol; for (symbol = 0; symbol < n; symbol++) (h->count[length[symbol]])++; if (h->count[0] == n) return 0; int left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= h->count[len]; if (left < 0) return left; } short offs[MAXBITS + 1]; offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + h->count[len]; for (symbol = 0; symbol < n; symbol++) if (length[symbol] != 0) h->symbol[offs[length[symbol]]++] = symbol; return left; } static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode, const struct puff_huffman* distcode) { static const short lens[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; static const short dists[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static const short dext[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; int symbol; do { symbol = puff_decode(s, lencode); if (symbol < 0) return symbol; if (symbol < 256) { if (s->outcnt == s->outlen) return 1; if (symbol) s->out[s->outcnt] = symbol; s->outcnt++; } else if (symbol > 256) { symbol -= 257; if (symbol >= 29) return -10; int len = lens[symbol] + puff_bits(s, lext[symbol]); symbol = puff_decode(s, distcode); if (symbol < 0) return symbol; unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]); if (dist > s->outcnt) return -11; if (s->outcnt + len > s->outlen) return 1; while (len--) { if (dist <= s->outcnt && s->out[s->outcnt - dist]) s->out[s->outcnt] = s->out[s->outcnt - dist]; s->outcnt++; } } } while (symbol != 256); return 0; } static int puff_fixed(struct puff_state* s) { static int virgin = 1; static short lencnt[MAXBITS + 1], lensym[FIXLCODES]; static short distcnt[MAXBITS + 1], distsym[MAXDCODES]; static struct puff_huffman lencode, distcode; if (virgin) { lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; short lengths[FIXLCODES]; int symbol; for (symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; for (; symbol < 256; symbol++) lengths[symbol] = 9; for (; symbol < 280; symbol++) lengths[symbol] = 7; for (; symbol < FIXLCODES; symbol++) lengths[symbol] = 8; puff_construct(&lencode, lengths, FIXLCODES); for (symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 5; puff_construct(&distcode, lengths, MAXDCODES); virgin = 0; } return puff_codes(s, &lencode, &distcode); } static int puff_dynamic(struct puff_state* s) { static const short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; int nlen = puff_bits(s, 5) + 257; int ndist = puff_bits(s, 5) + 1; int ncode = puff_bits(s, 4) + 4; if (nlen > MAXLCODES || ndist > MAXDCODES) return -3; short lengths[MAXCODES]; int index; for (index = 0; index < ncode; index++) lengths[order[index]] = puff_bits(s, 3); for (; index < 19; index++) lengths[order[index]] = 0; short lencnt[MAXBITS + 1], lensym[MAXLCODES]; struct puff_huffman lencode = {lencnt, lensym}; int err = puff_construct(&lencode, lengths, 19); if (err != 0) return -4; index = 0; while (index < nlen + ndist) { int symbol; int len; symbol = puff_decode(s, &lencode); if (symbol < 0) return symbol; if (symbol < 16) lengths[index++] = symbol; else { len = 0; if (symbol == 16) { if (index == 0) return -5; len = lengths[index - 1]; symbol = 3 + puff_bits(s, 2); } else if (symbol == 17) symbol = 3 + puff_bits(s, 3); else symbol = 11 + puff_bits(s, 7); if (index + symbol > nlen + ndist) return -6; while (symbol--) lengths[index++] = len; } } if (lengths[256] == 0) return -9; err = puff_construct(&lencode, lengths, nlen); if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) return -7; short distcnt[MAXBITS + 1], distsym[MAXDCODES]; struct puff_huffman distcode = {distcnt, distsym}; err = puff_construct(&distcode, lengths + nlen, ndist); if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) return -8; return puff_codes(s, &lencode, &distcode); } static int puff(unsigned char* dest, unsigned long* destlen, const unsigned char* source, unsigned long sourcelen) { struct puff_state s = { .out = dest, .outlen = *destlen, .outcnt = 0, .in = source, .inlen = sourcelen, .incnt = 0, .bitbuf = 0, .bitcnt = 0, }; int err; if (setjmp(s.env) != 0) err = 2; else { int last; do { last = puff_bits(&s, 1); int type = puff_bits(&s, 2); err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1)); if (err != 0) break; } while (!last); } *destlen = s.outcnt; return err; } //% END CODE DERIVED FROM puff.{c,h} #define ZLIB_HEADER_WIDTH 2 static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd) { if (sourcelen < ZLIB_HEADER_WIDTH) return 0; source += ZLIB_HEADER_WIDTH; sourcelen -= ZLIB_HEADER_WIDTH; const unsigned long max_destlen = 132 << 20; void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); if (ret == MAP_FAILED) return -1; unsigned char* dest = (unsigned char*)ret; unsigned long destlen = max_destlen; int err = puff(dest, &destlen, source, sourcelen); if (err) { munmap(dest, max_destlen); errno = -err; return -1; } if (write(dest_fd, dest, destlen) != (ssize_t)destlen) { munmap(dest, max_destlen); return -1; } return munmap(dest, destlen); } static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p) { int err = 0, loopfd = -1; int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; goto error; } if (puff_zlib_to_file(data, size, memfd)) { err = errno; goto error_close_memfd; } loopfd = open(loopname, O_RDWR); if (loopfd == -1) { err = errno; goto error_close_memfd; } if (ioctl(loopfd, LOOP_SET_FD, memfd)) { if (errno != EBUSY) { err = errno; goto error_close_loop; } ioctl(loopfd, LOOP_CLR_FD, 0); usleep(1000); if (ioctl(loopfd, LOOP_SET_FD, memfd)) { err = errno; goto error_close_loop; } } close(memfd); *loopfd_p = loopfd; return 0; error_close_loop: close(loopfd); error_close_memfd: close(memfd); error: errno = err; return -1; } static long syz_mount_image(volatile long fsarg, volatile long dir, volatile long flags, volatile long optsarg, volatile long change_dir, volatile unsigned long size, volatile long image) { unsigned char* data = (unsigned char*)image; int res = -1, err = 0, loopfd = -1, need_loop_device = !!size; char* mount_opts = (char*)optsarg; char* target = (char*)dir; char* fs = (char*)fsarg; char* source = NULL; char loopname[64]; if (need_loop_device) { memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } errno = err; return res; } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; retry: while (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) { } dp = opendir(dir); if (dp == NULL) { if (errno == EMFILE) { exit(1); } exit(1); } struct dirent* ep = 0; while ((ep = readdir(dp))) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; char filename[FILENAME_MAX]; snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); while (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) { } struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } int i; for (i = 0;; i++) { if (unlink(filename) == 0) break; if (errno == EPERM) { int fd = open(filename, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno != EBUSY || i > 100) exit(1); if (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW)) exit(1); } } closedir(dp); for (int i = 0;; i++) { if (rmdir(dir) == 0) break; if (i < 100) { if (errno == EPERM) { int fd = open(dir, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno == EBUSY) { if (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW)) exit(1); continue; } if (errno == ENOTEMPTY) { if (iter < 100) { iter++; goto retry; } } } exit(1); } } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void reset_loop() { char buf[64]; snprintf(buf, sizeof(buf), "/dev/loop%llu", procid); int loopfd = open(buf, O_RDWR); if (loopfd != -1) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); if (symlink("/dev/binderfs", "./binderfs")) { } } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; memcpy((void*)0x20000180, "udf\000", 4); memcpy((void*)0x20000040, "./file0\000", 8); memcpy((void*)0x20000100, "fileset", 7); *(uint8_t*)0x20000107 = 0x3d; sprintf((char*)0x20000108, "%020llu", (long long)0x400); *(uint8_t*)0x2000011c = 0x2c; memcpy((void*)0x2000011d, "gid=forget", 10); *(uint8_t*)0x20000127 = 0x2c; memcpy((void*)0x20000128, "longad", 6); *(uint8_t*)0x2000012e = 0x2c; *(uint8_t*)0x2000012f = 0; memcpy( (void*)0x20001600, "\x78\x9c\xec\xdd\x4f\x6c\x1c\xd7\x7d\x07\xf0\xdf\x1b\x91\x22\x29\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\xae\xd4\x85\xa9\x25\x41" "\x52\x8d\x6c\xa4\x05\xd3\x4b\x0f\x3d\x04\x28\x8a\x1e\x72\x22\xd0\x1a\x05" "\x52\x34\x30\x9a\x22\xe8\x91\x6d\x5d\x20\xb9\xf8\x50\xe4\xd4\x13\xd1\xc2" "\x46\x50\xf4\xc0\x16\x01\x72\x0a\x58\xcc\xec\x5b\x71\x49\x51\x96\x2a\x8a" "\x12\x65\x7d\x3e\xf6\xea\xbb\x3b\xf3\xde\xec\x7b\x33\xa3\x19\x49\xe0\x9b" "\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\x40\xc4\xef\xbe" "\x7e\xe1\xe4\xa9\xf4\xa8\x5b\x01\x00\x3c\x4c\x97\x26\xbf\x7a\xf2\xb4\xfb" "\x3f\x00\x3c\x51\x2e\xfb\xfb\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x1c\x74\x29\x8a\x78\x3a\x52\x2c\x5c\xda\x48\xd3\xd5\xe7\x8e\xc1\x8b" "\xad\xf6\x8d\x9b\x53\x63\xe3\xbb\x57\x1b\x4a\x55\xcd\x43\x55\xf9\xf2\x35" "\x78\xea\xf4\x99\xb3\x5f\x7a\x79\xf4\x5c\x37\x3f\xbe\xfe\x83\xf6\x5c\xbc" "\x39\x79\xf9\x42\xed\xb5\xf9\xeb\x0b\x8b\xcd\xa5\xa5\xe6\x6c\x6d\xaa\xdd" "\x9a\x99\x9f\x6d\xde\xf3\x16\xf6\x5a\x7f\xa7\x91\x6a\x07\xd4\xae\xbf\x75" "\x63\xf6\xea\xd5\xa5\xda\xe9\x97\xce\x6c\x5b\x7d\x73\xf8\xa3\x81\xa7\x8e" "\x0d\x9f\x1f\x7d\xe1\xc4\xf3\xdd\xb2\x53\x63\xe3\xe3\x93\x3d\x65\xfa\xfa" "\xef\xfb\xdb\x6f\x73\xa7\x11\x1e\x87\xa3\x88\x13\x91\xe2\xc5\xef\xfd\x24" "\x35\x22\xa2\x88\xbd\xef\x8b\xbb\x9c\x3b\xfb\x6d\xa8\xea\xc4\x48\xd5\x89" "\xa9\xb1\xf1\xaa\x23\x73\xad\x46\x7b\xb9\x5c\x39\xd1\xdd\x11\x45\x44\xad" "\xa7\x52\xbd\xbb\x8f\x1e\xc2\xb1\xd8\x93\x7a\xc4\x4a\xd9\xfc\xb2\xc1\x23" "\x65\xf7\x26\x17\x1a\x8b\x8d\x2b\x73\xcd\xda\x44\x63\x71\xb9\xb5\xdc\x9a" "\x6f\x4f\xa4\x4e\x6b\xcb\xfe\xd4\xa2\x88\x73\x29\x62\x35\x22\xd6\x07\x6e" "\xdf\x5c\x7f\x14\xd1\x17\x29\xbe\x73\x74\x23\x5d\x89\x88\x43\xdd\xfd\xf0" "\xc5\x6a\x60\xf0\x9d\xdb\x51\xec\x63\x1f\xef\x41\xd9\xce\x5a\x7f\xc4\x6a" "\xf1\x18\x1c\xb3\x03\x6c\x20\x8a\x78\x23\x52\xfc\xf4\xfd\xe3\x31\x53\xee" "\xb3\xfc\x8a\x2f\x44\xbc\x51\xe6\x0f\x22\xde\x2d\xf3\xd5\x88\x54\x9e\x18" "\x67\x23\x3e\xdc\xe5\x3c\xe2\xf1\xd4\x17\x45\xfc\x59\x79\xfc\xcf\x6f\xa4" "\xd9\xea\x7a\xd0\xbd\xae\x5c\xfc\x5a\xed\x2b\xed\xab\xf3\x3d\x65\xbb\xd7" "\x95\xc7\xf4\xfe\x30\xb4\x23\x1f\x8e\x03\x7e\x6d\x1a\x8c\x22\x1a\xd5\x15" "\x7f\x23\xdd\xff\x1f\x76\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x78\xd0\x86\xa2\x88\xe7\x22\xc5\xeb\xff\xf6\x87\xd5\xb8\xe2\xa8\xc6" "\xa5\x1f\x3d\x3f\xfa\x7b\xc3\xbf\xd8\x3b\x66\xfc\xd9\xbb\x6c\xa7\x2c\xfb" "\x52\x44\xac\x14\xf7\x36\x26\xf7\x70\x1e\x42\x3c\x91\x26\x52\x7a\xc4\x63" "\x89\x9f\x64\x83\x51\xc4\x1f\xe5\xf1\x7f\xdf\x7a\xd4\x8d\x01\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\xa2\x15\xf1\xe3\x48\xf1" "\xca\x07\xc7\xd3\x6a\xf4\xce\x29\xde\x6a\x5f\xab\x5d\x6e\x5c\x99\xeb\xcc" "\x0a\xdb\x9d\xfb\xb7\x3b\x67\xfa\xe6\xe6\xe6\x66\x2d\x75\xb2\x9e\x73\x3a" "\xe7\x4a\xce\xd5\x9c\x6b\x39\xd7\x73\x46\x91\xeb\xe7\xac\xe7\x9c\xce\xb9" "\x92\x73\x35\xe7\x5a\xce\xf5\x9c\x71\x28\xd7\xcf\x59\xcf\x39\x9d\x73\x25" "\xe7\x6a\xce\xb5\x9c\xeb\x39\xa3\x2f\xd7\xcf\x59\xcf\x39\x9d\x73\x25\xe7" "\x6a\xce\xb5\x9c\xeb\x39\xe3\x80\xcc\xdd\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xf0\x49\x52\x44\x11\x3f\x8f\x14\xdf\xfe\xc6\x46\x8a\x14\x11" "\xf5\x88\xe9\xe8\xe4\xda\xc0\xa3\x6e\x1d\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x1a\x48\x45\x7c\x3f\x52" "\xd4\x7e\xbf\x7e\x6b\x59\x5f\x44\xa4\xea\xff\x8e\xe3\xe5\x2f\x67\xa3\x7e" "\xb8\xcc\x4f\x47\x7d\xb4\xcc\x57\xa3\x7e\x21\x67\xa3\xca\xbe\xfa\xb7\x1e" "\x41\xfb\xd9\x9b\xfe\x54\xc4\x8f\x22\xc5\xc0\xe0\x7b\xb7\x0e\x78\x3e\xfe" "\xfd\x9d\x4f\xb7\x4e\x83\x78\xf7\x9b\x5b\x9f\x7e\xb9\xaf\x93\x87\xba\x2b" "\x87\x3f\x1a\x78\xea\xd8\xd1\xf3\xa3\xe3\xbf\xfa\xec\x9d\xde\xa7\xdd\x1a" "\x30\x72\xb1\xd5\xbe\x71\xb3\x36\x35\x36\x3e\x3e\xd9\xb3\xb8\x2f\x7f\xfb" "\xa7\x7b\x96\x0d\xe7\xef\x2d\x1e\x4c\xd7\x89\x88\xa5\xb7\xdf\x79\xab\x31" "\x37\xd7\x5c\xbc\xff\x37\xe5\x29\xb0\x87\xea\xde\x78\x73\x50\xdf\x44\xdf" "\x81\x68\xc6\xa3\xe9\x3b\x4f\x80\xf2\xfe\xff\x61\xa4\xf8\xad\x0f\xfe\xbd" "\x7b\xc3\xef\xde\xff\x7f\xa1\xf3\xe9\xd6\x1d\x3e\x7e\xf6\xc7\x5b\xf7\xff" "\x57\x76\x6e\x68\x9f\xee\xff\x4f\xf7\x2c\x7b\x25\xff\x69\xa4\xbf\x2f\x62" "\x70\xf9\xfa\x42\xff\xb1\x88\xc1\xa5\xb7\xdf\x39\xd1\xba\xde\xb8\xd6\xbc" "\xd6\x6c\x9f\x3d\x79\xf2\xcb\xa3\xa3\x5f\x3e\x73\xb2\xff\x70\xc4\xe0\xd5" "\xd6\x5c\xb3\xe7\xdd\x9e\x77\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xc0\xc3\x95\x8a\xf8\x9d\x48\xd1\xf8\xd1\x46\xaa\x45\xc4\xcd\x6a" "\xbc\xd6\xf0\xf9\xd1\x17\x4e\x3c\x7f\x28\x0e\x55\xe3\xad\xb6\x8d\xdb\x7a" "\x73\xf2\xf2\x85\xda\x6b\xf3\xd7\x17\x16\x9b\x4b\x4b\xcd\xd9\xda\x54\xbb" "\x35\x33\x3f\xdb\xbc\xd7\xaf\x1b\xac\x86\x7b\x4d\x8d\x8d\xef\x4b\x67\xee" "\x6a\x68\x9f\xdb\x3f\x34\xf8\xda\xfc\xc2\xdb\x8b\xad\x6b\x7f\xb0\xbc\xeb" "\xfa\x23\x83\x17\xae\x2c\x2d\x2f\x36\x66\x76\x5f\x1d\x43\x51\x44\xd4\x7b" "\x97\x8c\x54\x0d\x9e\x1a\x1b\xaf\x1a\x3d\xd7\x6a\xb4\xab\xaa\x13\xbb\x0e" "\xa6\xfb\xff\xeb\x4f\x45\xfc\x47\xa4\x98\x39\x5b\x4b\x9f\xcf\xcb\xf2\xf8" "\xbf\x9d\x23\xfc\xb7\x8d\xff\x5f\xd9\xb9\xa1\x7d\x1a\xff\xf7\xa9\x9e\x65" "\xe5\x77\xa6\x54\xc4\xcf\x22\xc5\x6f\xfe\xf9\xb3\xf1\xf9\xaa\x9d\x47\xe2" "\xb6\x7d\x96\xcb\xfd\x75\xa4\x18\x39\xf7\xb9\x5c\x2e\x0e\x97\xe5\xba\x6d" "\xe8\x3c\x57\xa0\x33\x32\xb0\x2c\xfb\x3f\x91\xe2\xef\x7f\xbe\xbd\x6c\x77" "\x3c\xe4\xd3\x5b\x65\x4f\xdd\xf3\x8e\x7d\x4c\x94\xc7\xff\x68\xa4\xf8\xfe" "\x9f\x7e\x37\x7e\x2d\x2f\xdb\xfe\xfc\x87\xdd\x8f\xff\x91\x9d\x1b\xda\xa7" "\xe3\xff\x4c\xcf\xb2\x23\xdb\x9e\x57\x50\x2d\x3a\xbc\xc7\xee\x3f\xf1\xca" "\xe3\x7f\x22\x52\xbc\xfa\xf4\x7b\xf1\xeb\x79\xd9\xc7\x3d\xff\xa3\xfb\xec" "\x8d\xe3\xb9\xf0\xad\xe7\x73\xec\xd3\xf1\xff\x4c\xcf\xb2\xe1\xfc\xbd\xbf" "\xf1\x60\xba\x0e\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x58\xeb\x4f\x45\xfc" "\x4d\xa4\x78\x7e\xbc\x2f\xbd\x9c\x97\xdd\xcb\xcf\xff\xcd\xee\xdc\xd0\x3e" "\xfd\xfc\xd7\x67\x7b\x96\xcd\x3e\x98\xf9\x8a\xee\xfa\x66\xcf\x3b\x15\x00" "\x00\x00\x00\x0e\x88\xfe\x54\xc4\x8f\x23\xc5\xb5\xe5\xf7\x6e\x8d\xa1\xde" "\x3e\xfe\xbb\x67\xfc\xe7\x6f\x6f\x8d\xff\x1c\x4b\x3b\xd6\x56\xff\xce\xf7" "\x4b\xd5\x73\x03\x1e\xe4\xbf\xff\xf5\x1a\xce\xdf\x3b\xbd\xf7\x6e\x03\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x81\x92\x52\x11" "\x2f\xe7\xf9\xd4\xa7\xef\x32\x9f\xfa\x5a\xa4\x78\xfd\xbf\x5e\xcc\xe5\xd2" "\xb1\xb2\x5c\x77\x1e\xf8\xe1\xea\xd7\xc1\x4b\xf3\xed\x13\x17\xe6\xe6\xe6" "\x67\x1a\xcb\x8d\x2b\x73\xcd\xda\xe4\x42\x63\xa6\x59\xd6\x7d\x26\x52\x6c" "\xfc\xd5\xe7\x72\xdd\xa2\x9a\x5f\xbd\x3b\xdf\x7c\x67\x8e\xf7\xad\xb9\xd8" "\x17\x23\xc5\xf8\xdf\x76\xcb\x76\xe6\x62\xef\xce\x4d\xfe\xcc\x56\xd9\x53" "\x65\xd9\x4f\x45\x8a\xff\xfc\xbb\xed\x65\xbb\xf3\x58\x7f\x66\xab\xec\xe9" "\xb2\xec\x5f\x46\x8a\xaf\xff\xe3\xee\x65\x8f\x6d\x95\x3d\x53\x96\xfd\x6e" "\xa4\xf8\xe1\xd7\x6b\xdd\xb2\x47\xca\xb2\xdd\xe7\xa3\x7e\x76\xab\xec\x4b" "\x33\xf3\xc5\x3e\x1c\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x9e\x34\xfd\xa9\x88\x3f\x89\x14\xff\x7d\x7d\xf5\xd6\x58\xfe" "\x3c\xff\x7f\x7f\xcf\xc7\xca\xbb\xdf\xec\x99\xef\x7f\x87\x9b\xd5\x3c\xff" "\xc3\xd5\xfc\xff\x77\x7a\x7f\x3f\xf3\xff\x0f\x3f\x98\x6e\x02\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x63\x25\x45\x11" "\xef\x44\x8a\x85\x4b\x1b\x69\x6d\xa0\xfc\xdc\x31\x78\xb1\xd5\xbe\x71\x73" "\x6a\x6c\x7c\xf7\x6a\x43\xa9\xaa\x79\xa8\x2a\x5f\xbe\x06\x4f\x9d\x3e\x73" "\xf6\x4b\x2f\x8f\x9e\xeb\xe6\xc7\xd7\x7f\xd0\x9e\x8b\x37\x27\x2f\x5f\xa8" "\xbd\x36\x7f\x7d\x61\xb1\xb9\xb4\xd4\x9c\xad\x4d\xb5\x5b\x33\xf3\xb3\xcd" "\x7b\xde\xc2\x5e\xeb\xef\x34\x52\xed\x80\xda\xf5\xb7\x6e\xcc\x5e\xbd\xba" "\x54\x3b\xfd\xd2\x99\x6d\xab\x6f\x0e\x7f\x34\xf0\xd4\xb1\xe1\xf3\xa3\x2f" "\x9c\x78\xbe\x5b\x76\x6a\x6c\x7c\x7c\xb2\xa7\x4c\x5f\xff\x7d\x7f\xfb\x6d" "\xd2\x1d\x96\x1f\x8e\x22\xfe\x22\x52\xbc\xf8\xbd\x9f\xa4\x7f\x1a\x88\x28" "\x62\xef\xfb\xe2\x2e\xe7\xce\x7e\x1b\xaa\x3a\x31\x52\x75\x62\x6a\x6c\xbc" "\xea\xc8\x5c\xab\xd1\x5e\x2e\x57\x4e\x74\x77\x44\x11\x51\xeb\xa9\x54\xcf" "\xfb\x28\xaf\x5e\xd9\xcf\x63\xb1\x27\xf5\x88\x95\xb2\xf9\x65\x83\x47\xca" "\xee\x4d\x2e\x34\x16\x1b\x57\xe6\x9a\xb5\x89\xc6\xe2\x72\x6b\xb9\x35\xdf" "\x9e\x48\x9d\xd6\x96\x7d\xa9\x45\x11\xe7\x52\xc4\x6a\x44\xac\x0f\xdc\xbe" "\xb9\xfe\x28\xe2\xad\x48\xf1\x9d\xa3\x1b\xe9\x9f\x07\x22\x0e\x75\xf7\xc1" "\x17\x2f\x4d\x7e\xf5\xe4\xe9\x3b\xb7\xa3\xd8\xc7\x3e\xde\x83\xb2\x9d\xb5" "\xfe\x88\xd5\x62\xeb\xf7\xda\x81\x3d\x66\x07\xd8\x40\x14\xf1\x0f\x91\xe2" "\xa7\xef\x1f\x8f\x7f\x19\x88\xe8\x8b\xce\x2b\xbe\x10\xf1\x46\x99\x3f\x88" "\x78\x37\x3a\xc7\x3b\x95\x27\xc6\xd9\x88\x0f\x77\x39\x8f\x78\x3c\xf5\x45" "\x11\xff\x5b\x1e\xff\xf3\x1b\xe9\xfd\x81\xf2\x7a\xd0\xbd\xae\x5c\xfc\x5a" "\xed\x2b\xed\xab\xf3\x3d\x65\xbb\xd7\x95\xc7\xfe\xfe\xf0\x30\x1d\xf0\x6b" "\xd3\x60\x14\xf1\xc3\xea\x8a\xbf\x91\xfe\xd5\xef\x6b\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x80\x03\xa4\x88\x5f\x89\x14\xaf\x7c\x70\x3c" "\x55\xe3\x83\x6f\x8d\x29\x6e\xb5\xaf\xd5\x2e\x37\xae\xcc\x75\x86\xf5\x75" "\xc7\xfe\x75\xc7\x4c\x6f\x6e\x6e\x6e\xd6\x52\x27\xeb\x39\xa7\x73\xae\xe4" "\x5c\xcd\xb9\x96\x73\x3d\x67\x14\xb9\x7e\xce\x7a\x99\x83\x9b\x9b\xd3\xf9" "\xf3\x4a\xce\xd5\x9c\x6b\x39\xd7\x73\xc6\xa1\x5c\x3f\x67\x3d\xe7\x74\xce" "\x95\x9c\xab\x39\xd7\x72\xae\xe7\x8c\xbe\x5c\x3f\x67\x3d\xe7\x74\xce\x95" "\x9c\xab\x39\xd7\x72\xae\xe7\x8c\x03\x32\x76\x0f\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x64\x29\xaa\xff\x52\x7c\xfb\x1b\x1b" "\x69\x73\xa0\x33\xbf\xf4\x74\x74\x72\xcd\x7c\xa0\x9f\x78\xff\x17\x00\x00" "\xff\xff\xc8\xb8\xf8\x6c", 3084); syz_mount_image(0x20000180, 0x20000040, 0x201c092, 0x20000100, 5, 0xc0c, 0x20001600); memcpy((void*)0x200000c0, "./bus\000", 6); syscall(__NR_open, 0x200000c0ul, 0x15da43ul, 0ul); memcpy((void*)0x20000380, "/dev/loop", 9); *(uint8_t*)0x20000389 = 0x30; *(uint8_t*)0x2000038a = 0; memcpy((void*)0x20000000, "./bus\000", 6); syscall(__NR_mount, 0x20000380ul, 0x20000000ul, 0ul, 0x1000ul, 0ul); memcpy((void*)0x20000000, "./bus\000", 6); res = syscall(__NR_openat, 0xffffff9c, 0x20000000ul, 0ul, 0ul); if (res != -1) r[0] = res; memcpy((void*)0x20004400, "./bus\000", 6); res = syscall(__NR_openat, 0xffffff9c, 0x20004400ul, 0x1c1002ul, 0ul); if (res != -1) r[1] = res; memcpy((void*)0x200001c0, "htcp\000", 5); syscall(__NR_write, r[1], 0x200001c0ul, 5ul); syscall(__NR_sendfile, r[1], r[0], 0ul, 0x1fffful); } 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); use_temporary_dir(); loop(); return 0; }