// https://syzkaller.appspot.com/bug?id=676138e64e348729fecccffe885483bd88f24d20 // 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; const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW; retry: while (umount2(dir, umount_flags) == 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, umount_flags) == 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, umount_flags)) 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, umount_flags)) 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; 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; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x200001c0, "squashfs\000", 9); memcpy((void*)0x20000200, "./file0\000", 8); memcpy( (void*)0x20000440, "\x78\x9c\xec\xd0\xbf\x6b\x13\x61\x1c\xc7\xf1\xf7\xf7\xb9\x27\xbf\x84\x2a" "\x51\x71\xa8\x60\x03\x16\xcf\x0b\x95\xe4\xae\xea\xe0\x14\x9c\x22\xe4\xc0" "\xa1\x8b\x60\xd0\xd0\xc6\xa6\x98\xa8\xe9\x65\xb0\xa5\x05\x17\x29\x48\xb5" "\xff\x82\x4e\x75\x54\x41\x27\x11\x05\xe7\xea\x20\x38\xe8\xb9\x74\x93\x66" "\x28\x0e\x4e\x12\xc9\xe5\x89\xe0\xdf\xd0\xe7\x35\xdc\xe7\xbe\x1f\xb8\x7b" "\x1e\xbe\xad\xa8\x1b\x65\x80\x3f\xfb\x6b\xf3\x54\x48\x38\x1c\xe6\x33\x82" "\x06\xa6\x64\xd4\x29\x35\xca\x37\x66\xfe\x69\x72\x6b\x14\x5c\x36\xf3\xa6" "\xc9\xe7\x26\x27\xa3\x95\xd5\xdb\x8d\x76\xbb\xb9\x5c\xb8\x54\x20\xff\x5f" "\x01\xfc\x4a\xba\x7f\x55\xf4\x92\x13\x8a\xbe\x50\x41\xbe\xee\xaf\xcd\x37" "\xe4\x66\xc8\xa0\x42\x47\x2d\x84\xe4\x6b\x14\x1f\xe3\xd4\xe9\x7a\x4f\x98" "\xd4\x13\x1c\xbf\x81\xc3\xc0\xdd\xe4\x8a\xa2\x2b\x6e\x0d\x8e\x94\x7a\x9d" "\x7b\xa5\x68\x65\xf5\xdc\x52\xa7\xb1\xd8\x5c\x6c\xde\x09\x82\xd9\x8b\xe5" "\xf3\xe5\xf2\x85\xa0\x74\x6b\xa9\xdd\x2c\xbf\x46\xbc\x47\xa2\x78\xca\x3a" "\x5e\x48\x26\x24\xe7\xad\x93\xaa\xf3\x70\x47\x1f\x62\x46\x10\xaf\xa5\x62" "\x47\x8a\x7d\xd2\x75\xb6\x76\x9c\xb3\xa7\x67\xfa\x28\x6f\x8f\x01\x39\xde" "\xbb\x7d\x32\xdf\x75\xab\xa0\xe6\x38\x43\xf6\xfa\xf0\xf2\x55\x8e\x09\xcf" "\x70\x42\xa6\x6b\xe4\x14\x9a\xe4\xa0\x2a\x72\x55\xbd\x12\x5f\x7f\xd1\xbf" "\x53\x73\x9f\x46\xdb\xb8\xdb\x5e\xd8\xb8\xa6\xb2\xa4\xb7\x2b\xb2\x97\x15" "\x7f\x97\x94\xeb\x13\x14\x7d\x66\x87\xab\xe1\x28\x1f\xd8\x88\x99\x8e\xa9" "\xc6\x6c\xc7\xec\xfe\x60\x4a\xde\x0e\x4f\x19\xef\x55\x3f\x18\x3e\x5f\x98" "\xe9\x24\xa7\x20\xcd\xfd\x46\xaf\xb7\xec\xa7\xe1\xa3\xe8\x90\xc0\x0d\x09" "\xf2\x30\x91\xfc\x4e\x25\xf7\xca\xc3\x3b\xf3\x8d\x09\xbe\x8d\x5f\x2c\xcb" "\xb2\x2c\xcb\xb2\x2c\xcb\xb2\xac\x03\xe0\x6f\x00\x00\x00\xff\xff\x7c\x4f" "\x63\x0d", 416); syz_mount_image(/*fs=*/0x200001c0, /*dir=*/0x20000200, /*flags=MS_MANDLOCK*/ 0x40, /*opts=*/0x200043c0, /*chdir=*/1, /*size=*/0x1a0, /*img=*/0x20000440); memcpy((void*)0x20000a40, "udf\000", 4); memcpy((void*)0x20000000, "./" "file1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000", 108); memcpy((void*)0x20000100, "\x73\x68\x6f\x72\x74\x61\x64\x00\x00\x00\x00\x6d\x65\x3d\x30\x30\x30" "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\xb0\x30\x34" "\x2c\x6e\x6f\x61\x64\x69\x6e\x69\x63\x62\x2c\x75\x69\x64\x3d\x00", 50); sprintf((char*)0x20000132, "0x%016llx", (long long)-1); *(uint64_t*)0x20000144 = 0; memcpy( (void*)0x20000a80, "\x78\x9c\xec\xdb\x4f\x6c\x9b\xe7\x7d\x07\xf0\xdf\xc3\x57\xb2\x69\xa7\x6b" "\x15\xb7\x75\x93\x36\xcb\x58\xb4\x08\x3c\xa5\x0d\xe4\xff\x4a\xbc\x01\xf6" "\xac\x0a\x6d\xe6\x26\x46\x65\x65\xf3\x65\x30\x65\xc9\x0e\x11\xfd\xab\x24" "\x17\x4e\x37\xb4\x1e\x36\xa0\x08\xd0\x83\x51\x60\x3d\x6c\xc0\x90\xcb\x0e" "\x03\x76\xf0\x0e\xbb\xec\x14\xec\x30\x0c\x18\x36\x18\x3b\x0c\xc5\x8a\x76" "\x5a\xba\x66\xe9\x69\x0c\x36\x20\xa7\x4d\xc3\xfb\xf2\xa1\x44\xc9\x72\xac" "\xc5\xb1\x25\xdb\x9f\x8f\x61\x7f\xc9\x97\xbf\x97\x7c\xfe\xd0\xe4\x4b\x3e" "\x7c\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\x88\xf8\x8d" "\xaf\x9c\x1a\x3a\x98\xb6\xbb\x15\x00\xc0\xfd\xf4\xd2\xd8\x37\x86\x0e\x7b" "\xff\x07\x80\x47\xca\x39\x9f\xff\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x60\xa7\x4b\x51\xc4\x9f\x44\x8a\x57\x7f\xd2\x4e\x17\xaa\xeb\x1d\xf5" "\x33\xad\xd9\x2b\x57\xc7\x47\x46\x37\xdf\x6d\x4f\x8a\x14\xb5\x28\xaa\xfa" "\xf2\x6f\xfd\xe0\xa1\xc3\x47\x8e\x1e\x3b\x3e\xdc\xcd\x0f\xde\xff\xa3\xf6" "\x64\xbc\x3c\x76\xee\x54\xe3\xf4\xdc\xcc\xfc\xc2\xd4\xe2\xe2\xd4\x64\x63" "\x7c\xb6\x75\x71\x6e\x72\x6a\xcb\xf7\x70\xb7\xfb\x6f\x34\x58\x0d\x40\x63" "\xe6\xb5\x2b\x93\x97\x2e\x2d\x36\x0e\x3d\x77\x78\xdd\xcd\x57\x07\xde\xd9" "\xfd\xd8\xfe\x81\x13\xc7\x5f\x3c\xbf\xaf\x5b\x3b\x3e\x32\x3a\x3a\xd6\x53" "\xd3\xd7\xff\xa1\x1f\xfd\x16\xb7\x3b\xc3\x63\x57\x14\xf1\xb3\x48\x51\xff" "\xde\xbb\xa9\x19\x11\xb5\xb8\xfb\xb1\xb8\xc3\x73\xe7\x5e\xdb\x53\x75\x62" "\xb0\xea\xc4\xf8\xc8\x68\xd5\x91\xe9\x56\x73\x76\xa9\xbc\x31\xd5\x72\x55" "\x2d\x62\xa0\x67\xa7\x93\xdd\x31\xba\x0f\x73\x71\x57\x1a\x11\xd7\xca\xe6" "\x97\x0d\x1e\x2c\xbb\x37\x36\xdf\x5c\x68\x4e\x4c\x4f\x35\xce\x36\x17\x96" "\x5a\x4b\xad\xb9\xd9\x54\xeb\xb4\xb6\xec\xcf\x40\xd4\x62\x38\x45\xcc\x47" "\x44\xbb\xb8\xf5\xee\xfa\xa3\x88\x7f\x8d\x14\xdf\x7f\xbf\x9d\x26\x22\xa2" "\xe8\x8e\xc3\xb3\xd5\x89\xc1\x77\x6e\x4f\xed\x1e\xf4\x71\x0b\xfa\xca\xbe" "\x15\x11\x37\xe3\x01\x98\xb3\x1d\x6c\x77\x14\xf1\x46\xa4\xf8\xc1\xf9\xa1" "\xb8\x98\xc7\xb5\x1a\xb6\x67\x22\xbe\x5e\xe6\xd3\x11\xdf\x2c\x73\x39\xe2" "\x7a\xbe\x9e\xca\x27\xc8\x53\x11\xef\x6d\xf2\x7c\xe2\xc1\xd2\x17\x45\xfc" "\x43\xa4\x98\x4b\xed\x34\xd9\x9d\xfb\xea\x75\xe5\xcc\x2b\x8d\xaf\xcd\x5e" "\x9a\xeb\xa9\xed\xbe\xae\x3c\xf0\xef\x0f\xf7\xd3\x0e\x7f\x6d\xaa\x47\x11" "\x13\xd5\x2b\x7e\x3b\x7d\xf8\x83\x1d\x00\x00\x00\x00\x00\x76\x9e\x22\xfe" "\x3a\x52\xdc\x98\x39\x90\xe6\xa3\x77\x4d\xb1\x35\x7b\xb9\x71\xae\x39\x31" "\xdd\xf9\x56\xb8\xfb\xdd\x7f\x23\xef\xb5\xb2\xb2\xb2\x32\x90\x3a\xd9\xc8" "\x39\x94\xf3\x64\xce\xb3\x39\x2f\xe4\x9c\xcf\x79\x2d\xe7\xf5\x9c\x6f\xe6" "\xbc\x91\xf3\xad\x9c\x37\x73\x2e\xe7\x6c\xe7\x8c\x5a\x7e\xfc\x9c\x8d\x9c" "\x43\x39\x4f\xe6\x3c\x9b\xf3\x42\xce\xf9\x9c\xd7\x72\x5e\xcf\xf9\x66\xce" "\x1b\x39\xdf\xca\x79\x33\xe7\x72\xce\x76\xce\xb0\xee\x05\x00\x00\x00\x00" "\x00\x00\xc0\x0e\xb3\x27\x8a\xf8\x71\xa4\xf8\xc2\x5f\x7d\xab\x3a\xaf\x38" "\xaa\xf3\xd2\x3f\x71\x62\xf8\xc0\x57\xbf\xd8\x7b\xce\xf8\x67\xee\x70\x3f" "\x65\xed\x73\x11\x71\x23\xb6\x76\x4e\x6e\x7f\x3e\x75\x38\xd5\xca\x3f\x1f" "\x7d\xbf\xd8\x9a\x7a\x14\xf1\x9d\x7c\xfe\xdf\xef\x6f\x77\x63\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x80\x6d\x55\x8b\x22\x3e\x13\x29\x7e\xf8\x46\x3b\x45" "\x8a\x88\x46\xc4\x85\xe8\xe4\x72\xb1\xdd\xad\x03\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x3e\x8c\x7a\x2a\xe2\x74\xa4\xf8\xc5\x57\xea\xd5\xf5\x9b\x11" "\xf1\xd9\x88\xf8\xdf\x95\xf2\x4f\x44\x2c\xaf\x6c\xb0\xdd\x2d\x06\x00\x00" "\x00\x00\x00\x00\x00\x6e\x91\x8a\x18\x8a\x14\x8f\x3f\xd9\x4e\x03\x11\x71" "\x75\xe0\x9d\xdd\x8f\xed\x1f\x38\x71\xfc\xc5\xf3\xfb\x8a\x28\x22\x95\x25" "\xbd\xf5\x2f\x8f\x9d\x3b\xd5\x38\x3d\x37\x33\xbf\x30\xb5\xb8\x38\x35\xd9" "\x18\x9f\x6d\x5d\x9c\x9b\x9c\xda\xea\xc3\xd5\xcf\xb4\x66\xaf\x5c\x1d\x1f" "\x19\xbd\x27\x9d\xb9\xa3\x3d\xf7\xb8\xfd\x7b\xea\xa7\xe7\xe6\x5f\x5f\x68" "\x5d\x7e\x75\x69\xd3\xdb\xf7\xd6\x4f\x4d\x2c\x2e\x2d\x34\x2f\x6e\x7e\x73" "\xec\x89\x5a\xc4\x50\xef\x96\xc1\xaa\xc1\xe3\x23\xa3\x55\xa3\xa7\x5b\xcd" "\xd9\x6a\xd7\x54\xbb\x4d\x03\x6b\x11\x8d\xad\x76\x06\x00\x00\x00\x00\x00" "\x00\x80\x87\xc6\xde\x54\xc4\xd1\x48\xf1\x6a\xeb\x48\xea\xae\x1b\xf7\x75" "\xd6\xfc\x7f\xa9\x73\xad\x58\xad\xfd\xb3\xdf\x5b\xfb\x2d\xc0\xf4\x86\xec" "\xea\xfd\xfd\xc0\x56\x2e\xa7\xad\x36\x74\xb0\x5a\x78\x6f\x8c\x8f\x8c\x8e" "\x8e\xf5\x6c\xee\xeb\xbf\xb5\xb4\x6c\x53\x4a\x45\xfc\x65\xa4\xf8\xdc\x6f" "\x3f\x51\xad\x87\xa7\xd8\xbb\xe9\xda\x78\x59\xb7\x2b\x52\x1c\xfb\xd6\x91" "\x5c\x37\xf0\xb9\xb2\xee\xe4\xba\xaa\xfa\xe0\xf8\xc8\x68\xe3\xa5\xb9\xd9" "\x2f\x9f\x9a\x9e\x9e\xbb\xd8\x5c\x6a\x4e\x4c\x4f\x35\xc6\xe6\x9b\x17\xb7" "\xfc\xc3\x01\x00\x00\x00\x00\x00\x00\x00\xb8\x87\xf6\xa6\x22\xfe\x34\x52" "\xfc\xce\xd0\xcd\xd4\x3d\xef\x3c\xaf\xff\xf7\x75\xae\xf5\xac\xff\xff\x5a" "\xb5\x84\x5e\xa9\xa7\xf5\xb9\xaa\x5a\xdb\xff\x78\xb5\xb6\xdf\xb9\xfc\x89" "\x13\xc3\x8d\xd1\x5f\xb9\xdd\xf6\x7b\xb1\xfe\x5f\xb6\x29\xa5\x22\xfe\x25" "\x52\x3c\xfe\xbb\x4f\x54\xe7\xd3\x77\xd7\xff\x87\x36\xd4\x96\x75\xff\x15" "\x29\xfe\xf9\xef\x9f\xca\x75\xb5\x5d\x65\xdd\xc1\x6e\x77\x3a\xf7\x78\xa9" "\x35\x3d\x35\x94\xf2\x58\x7d\xfe\xd9\x6e\x6d\x54\xb5\xc7\x73\xed\x27\xd7" "\x6a\x0f\x96\xb5\x9f\x8f\x14\x7f\xfe\xcc\xfa\xda\xe1\x5c\xfb\xa9\xb5\xda" "\x43\x65\xed\x1f\x46\x8a\xff\x39\xba\x79\xed\xa7\xd7\x6a\x0f\x97\xb5\x7f" "\x10\x29\x7e\xf3\xed\x46\xb7\x76\x6f\x59\x7b\x26\xd7\xee\x5f\xab\x7d\xee" "\xe2\xdc\xf4\xe4\x9d\x86\xb5\x9c\xff\xbf\x89\x14\x67\x7f\xf1\xd5\xd4\xed" "\xf3\x6d\xe7\xbf\xe7\xf7\x1f\xd7\x36\xe4\xaa\x5b\xe6\xfc\x83\x2f\x7f\x54" "\xf3\x3f\xd0\xb3\xed\x5a\x9e\xd7\x1f\xe7\xf9\x3f\x78\x87\xf9\xff\xdb\x48" "\xf1\x47\x3f\x7d\x2a\xd7\x75\xc6\xfe\x50\xbe\xfd\xf1\xea\xdf\xb5\xf9\xff" "\xad\x48\xf1\x1f\xbf\xbc\xbe\xf6\x58\xae\xdd\xb7\x56\x7b\x70\xab\xdd\xda" "\x6e\xe5\xfc\x7f\x29\x52\x9c\xf8\xd1\x8f\x56\xfb\x9c\xe7\x3f\x8f\xec\xda" "\x0c\xf5\xce\xff\x67\xfb\xd6\xe7\xea\xb3\x64\x9b\xe6\xff\xf1\x9e\x6d\x03" "\xb9\x5d\x87\xff\x9f\x63\xf1\x28\x5a\x7c\xfd\xdb\xaf\x35\xa7\xa7\xa7\x16" "\x1e\x94\x0b\xff\x99\x1b\xbe\x53\xda\xe3\x82\x0b\x0f\xe5\x85\x6d\x7e\x61" "\xe2\xbe\x28\xdf\xff\xff\x31\x52\xbc\x70\xa6\x96\xba\xc7\x31\xf9\xfd\xff" "\x63\x9d\x6b\x6b\xc7\x7f\xef\x7f\x67\xed\xfd\xff\x85\x0d\xb9\x6a\x9b\xde" "\xff\xf7\xf5\x6c\x7b\x21\x1f\xb5\xf4\xf7\x45\xd4\x97\x66\xe6\xfb\xf7\x47" "\xd4\x17\x5f\xff\xf6\x97\x5b\x33\xcd\xcb\x53\x97\xa7\x66\x87\x8f\x1d\x3d" "\xf2\xfc\xf0\xb1\x63\xcf\xf7\xef\xea\x1e\xdb\xad\x5d\xda\xf2\xd0\x3d\x14" "\xca\xf9\x3f\x13\x29\x5e\xf9\xe9\x3f\xad\x7e\x8e\x59\x7f\xfc\xb7\xf9\xf1" "\xff\xde\x0d\xb9\x6a\x9b\xe6\xff\x93\xbd\x7d\x5a\x77\x5c\xb3\xe5\xa1\x78" "\x24\x95\xf3\x7f\x3d\x52\x7c\xf7\xed\x77\x57\x3f\x6f\x7e\xd0\xf1\x7f\xf7" "\xf3\xff\x81\x2f\xac\xcf\xd5\xff\x7f\xdb\x34\xff\x9f\xea\xd9\x56\xfd\xc6" "\xff\xe3\x11\xcf\xf7\x6c\x3b\xf0\xe9\x88\x53\x5b\x7d\x2c\x00\x00\x00\x78" "\xc8\xec\xcd\xeb\xe4\x7f\xfc\xab\x7f\xb7\x7a\xce\xfb\xfa\xcf\xff\xf1\xc5" "\x6e\x6d\xef\xf7\x3f\xb7\xb3\x13\xce\xff\x07\x00\x00\x00\x00\x80\x47\xdd" "\xde\x54\xc4\x5f\x44\x8a\xff\x1e\xfa\x52\xea\x9e\x43\xb6\x95\xdf\x7f\x4e" "\x6e\xc8\x55\xdb\xf4\xfb\xbf\xfd\x3d\xdb\x26\xef\xd3\x79\x2d\x5b\x1e\x64" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x1d\x28\x45\x11\x4f\x47\x8a" "\x57\x7f\xd2\x4e\xcb\x45\x79\xbd\xa3\x7e\xa6\x35\x7b\xe5\xea\xf8\xc8\xe8" "\xe6\xbb\xed\x49\x91\xa2\x16\x45\x55\x5f\xfe\xad\x1f\x3c\x74\xf8\xc8\xd1" "\x63\xc7\x87\xbb\xf9\xc1\xfb\x7f\xd4\x9e\x8c\x97\xc7\xce\x9d\x6a\x9c\x9e" "\x9b\x99\x5f\x98\x5a\x5c\x9c\x9a\x6c\x8c\xcf\xb6\x2e\xce\x4d\x4e\x6d\xf9" "\x1e\xee\x76\xff\x8d\x06\xab\x01\x68\xcc\xbc\x76\x65\xf2\xd2\xa5\xc5\xc6" "\xa1\xe7\x0e\xaf\xbb\xf9\xea\xc0\x3b\xbb\x1f\xdb\x3f\x70\xe2\xf8\x8b\xe7" "\xf7\x75\x6b\xc7\x47\x46\x47\xc7\x7a\x6a\xfa\xfa\x3f\xf4\xa3\xdf\x22\xdd" "\x66\xfb\xae\x28\xe2\x52\xa4\xa8\x7f\xef\xdd\xf4\x6f\x45\x44\x2d\xee\x7e" "\x2c\xee\xf0\xdc\xb9\xd7\xf6\x54\x9d\x18\xac\x3a\x31\x3e\x32\x5a\x75\x64" "\xba\xd5\x9c\x5d\x2a\x6f\x4c\xb5\x5c\x55\x8b\x18\xe8\xd9\xe9\x64\x77\x8c" "\xee\xc3\x5c\xdc\x95\x46\xc4\xb5\xb2\xf9\x65\x83\x07\xcb\xee\x8d\xcd\x37" "\x17\x9a\x13\xd3\x53\x8d\xb3\xcd\x85\xa5\xd6\x52\x6b\x6e\x36\xd5\x3a\xad" "\x2d\xfb\x33\x10\xb5\x18\x4e\x11\xf3\x11\xd1\x2e\x6e\xbd\xbb\xfe\x28\x62" "\x22\x52\x7c\xff\xfd\x76\x7a\xbb\x88\x28\xba\xe3\xf0\xec\x4b\x63\xdf\x18" "\x3a\x7c\xe7\xf6\xd4\xee\x41\x1f\x7b\xad\x7c\x77\xd3\xcd\x7d\x65\xdf\x8a" "\x88\x9b\xf1\x00\xcc\xd9\x0e\xb6\x3b\x8a\xf8\x58\xa4\xf8\xc1\xf9\xa1\xf8" "\x59\xd1\x19\xd7\x6a\xd8\x9e\x89\xf8\x7a\x99\x4f\x47\x7c\xb3\xcc\xe5\x88" "\xeb\xf9\x7a\x2a\x9f\x20\x4f\x45\xbc\xb7\xc9\xf3\x89\x07\x4b\x5f\x14\x71" "\x36\x52\xcc\xa5\x76\xfa\xf7\x22\xcf\x7d\xf5\xba\x72\xe6\x95\xc6\xd7\x66" "\x2f\xcd\xf5\xd4\x76\x5f\x57\x1e\xf8\xf7\x87\xfb\x69\x87\xbf\x36\xd5\xa3" "\x88\x9f\x57\xaf\xf8\xed\xf4\x73\xff\x9f\x01\x00\x00\x00\x00\x1e\x22\x45" "\xfc\x7a\xa4\xb8\x31\x73\x20\x55\xeb\x83\xab\x6b\x8a\xad\xd9\xcb\x8d\x73" "\xcd\x89\xe9\xce\xd7\xfa\xdd\xef\xfe\x1b\x79\xaf\x95\x95\x95\x95\x81\xd4" "\xc9\x46\xce\xa1\x9c\x27\x73\x9e\xcd\x79\x21\xe7\x7c\xce\x6b\x39\xaf\xe7" "\x7c\x33\xe7\x8d\x9c\x6f\xe5\xbc\x99\x73\x39\x67\x3b\x67\xd4\xf2\xe3\xe7" "\x6c\xe4\x1c\xca\x79\x32\xe7\xd9\x9c\x17\x72\xce\xe7\xbc\x96\xf3\x7a\xce" "\x37\x73\xde\xc8\xf9\x56\xce\x9b\x39\x97\x73\xb6\x73\x86\xef\xc9\x01\x00" "\x00\x00\x00\x00\x80\x1d\xa8\x16\x45\x3c\x11\x29\x7e\xf8\x46\x3b\xad\x14" "\x9d\x05\xde\x0b\xd1\xc9\x65\xeb\x9c\x0f\xbd\xff\x0b\x00\x00\xff\xff\x0d" "\xbb\x3c\xa8", 2595); syz_mount_image(/*fs=*/0x20000a40, /*dir=*/0x20000000, /*flags=MS_REC|MS_NOATIME*/ 0x4400, /*opts=*/0x20000100, /*chdir=*/1, /*size=*/0xa23, /*img=*/0x20000a80); memcpy((void*)0x20000100, "./bus\000", 6); syscall(__NR_creat, /*file=*/0x20000100ul, /*mode=*/0ul); memcpy((void*)0x20000380, "/dev/loop", 9); *(uint8_t*)0x20000389 = 0x30; *(uint8_t*)0x2000038a = 0; memcpy((void*)0x20000140, "./bus\000", 6); syscall(__NR_mount, /*src=*/0x20000380ul, /*dst=*/0x20000140ul, /*type=*/0ul, /*flags=MS_BIND*/ 0x1000ul, /*data=*/0ul); memcpy((void*)0x200000c0, "./bus\000", 6); res = syscall(__NR_creat, /*file=*/0x200000c0ul, /*mode=*/0ul); if (res != -1) r[0] = res; syscall(__NR_write, /*fd=*/r[0], /*data=*/0x20000140ul, /*len=*/0xfd14ul); syscall(__NR_write, /*fd=*/r[0], /*data=*/0x20000140ul, /*len=*/0xfd14ul); } 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); const char* reason; (void)reason; use_temporary_dir(); loop(); return 0; }