// https://syzkaller.appspot.com/bug?id=a7cac9d0ffe70c269e582ecfb859da13ae31e5bc // 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"); } else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) { strcat(opts, ",errors=withdraw"); } 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); } } void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$iso9660 arguments: [ // fs: ptr[in, buffer] { // buffer: {69 73 6f 39 36 36 30 00} (length 0x8) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // flags: mount_flags = 0x0 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYRES8: ANYRES8 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {c0 14 ef 44 04 23 6f 9d 64 6f ae 87 87 90 85 13 // 3a d8 97 52 19 d7 c5 b0 e1 7d d8 6d 11 be de 6a df c3 2e ed 7f 19 // fa 34 88 0c ce 7e c7 99 0f 63 e5 d7 99 6e 33 04 4e e8 a4 b2 e6 b4 // 3a 7c 6d 25 d5 08 06 2b d3 33 3b 86 45 3b c2 f0 2b 26 17 ad ec d3 // d5 a0 ea 75 61 f9 f6 3d ea 03 c7 f7 d0 fd ec 63 3a 94 74 1d 77 d3 // 10 4b a5 7f 74 dc e4 b0 1b e3 42 dc c7 b2 df 0a 45 0a c4 0e 4f be // 4b eb d4 f6 0d f3 18 fb 46 9f 80 23 75 dc 7a 08 f4 64 9f 9e d5 b3 // 84 d3 0b 0f d9 64 d7 4d 91 db 02 3b 61 78 88 d7 b5 6c b0} (length // 0xa7) // } // union ANYUNION { // ANYRESOCT: ANYRES64 (resource) // } // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0x570 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x570) // } // ] // returns fd_dir memcpy((void*)0x200000000080, "iso9660\000", 8); memcpy((void*)0x2000000000c0, "./file0\000", 8); *(uint8_t*)0x2000000001c0 = 0; memcpy((void*)0x2000000001c1, "\xc0\x14\xef\x44\x04\x23\x6f\x9d\x64\x6f\xae\x87\x87\x90\x85\x13\x3a" "\xd8\x97\x52\x19\xd7\xc5\xb0\xe1\x7d\xd8\x6d\x11\xbe\xde\x6a\xdf\xc3" "\x2e\xed\x7f\x19\xfa\x34\x88\x0c\xce\x7e\xc7\x99\x0f\x63\xe5\xd7\x99" "\x6e\x33\x04\x4e\xe8\xa4\xb2\xe6\xb4\x3a\x7c\x6d\x25\xd5\x08\x06\x2b" "\xd3\x33\x3b\x86\x45\x3b\xc2\xf0\x2b\x26\x17\xad\xec\xd3\xd5\xa0\xea" "\x75\x61\xf9\xf6\x3d\xea\x03\xc7\xf7\xd0\xfd\xec\x63\x3a\x94\x74\x1d" "\x77\xd3\x10\x4b\xa5\x7f\x74\xdc\xe4\xb0\x1b\xe3\x42\xdc\xc7\xb2\xdf" "\x0a\x45\x0a\xc4\x0e\x4f\xbe\x4b\xeb\xd4\xf6\x0d\xf3\x18\xfb\x46\x9f" "\x80\x23\x75\xdc\x7a\x08\xf4\x64\x9f\x9e\xd5\xb3\x84\xd3\x0b\x0f\xd9" "\x64\xd7\x4d\x91\xdb\x02\x3b\x61\x78\x88\xd7\xb5\x6c\xb0", 167); sprintf((char*)0x200000000268, "%023llo", (long long)-1); memcpy( (void*)0x200000001080, "\x78\x9c\xec\xdd\x51\x6f\xd3\x56\x1b\xc0\xf1\xc7\xa5\x85\x92\x57\x42\xe8" "\xe5\x15\x42\x55\x81\x43\x79\x27\x15\xa9\x04\x27\x85\xa0\x88\x2b\xcf\x39" "\x49\x0f\x38\x76\x64\x3b\xa8\xbd\x42\x15\x4d\x51\x45\x0a\x13\x65\xd2\xda" "\x9b\x8d\x1b\xb6\x49\xdb\x87\xe0\x76\x1f\x62\x9f\x60\xdf\x63\x57\x68\xdf" "\x60\x9d\x6c\x27\x6d\xb3\x36\x0d\xd0\x36\x41\xe5\xff\xab\xe0\x38\xf6\xb1" "\xcf\x73\x9c\xc8\x8f\x4e\x1b\x1f\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\x00\x10\xcb\xad\xd8\x76\xc1\x12\xcf\xf8\xcd\x45\xd5\x9f\x5b\x09\x83" "\xfa\xee\xcb\xce\xde\xfb\x56\xc8\xad\x9e\xe2\x90\x76\x45\xac\xe4\x9f\x4c" "\x4e\xca\x95\x6c\xd5\x95\xff\x89\x8c\x75\x36\x5f\x4e\xfe\x9b\x91\xe9\xec" "\xd5\xb4\x4c\x26\xc5\xa4\x6c\xfd\xe7\xf2\xc5\x07\x97\xc6\xc7\xba\xfb\x1f" "\x12\xf0\x50\x6c\x6c\x6e\x3d\x5f\x6e\xb7\x5b\xaf\x46\x1d\xc8\x09\xba\x7a" "\xae\xff\xb6\x9a\xf6\x4d\x14\x98\xba\x53\xd3\xca\x44\x81\x2a\x97\x4a\xf6" "\x9d\x85\x6a\xa4\xaa\xc6\xd3\xd1\x52\x14\xeb\xba\x72\x43\xed\xc4\x41\xa8" "\x66\xdd\x5b\xaa\x50\x2e\xcf\x2b\x9d\x5f\x0a\x9a\x7e\xad\xe2\x78\xba\xbb" "\xf2\xfe\xed\xa2\x6d\x97\xd4\xc3\x7c\x43\x3b\x61\x14\xf8\x77\x1e\xe6\x23" "\x77\xc1\x78\x9e\xf1\x6b\x69\x9d\x64\x73\x52\xe7\x7e\xf2\x41\x7c\x64\x62" "\x15\x6b\xa7\xae\xd4\xea\x5a\xbb\x35\x3f\xa8\x03\x49\xa5\xc2\x87\x54\x2a" "\x0e\xaa\x54\xb4\x8b\xc5\x42\xa1\x58\x2c\x94\xee\x95\xef\xdd\xb7\xed\xf1" "\x7d\x2b\xec\x7f\x91\x7d\x35\xba\x1f\xda\x3f\xfe\xdc\xde\x1e\xd4\x1e\x4e" "\xa3\xe3\xbd\x80\x03\x47\x30\xd6\xc9\xff\xe2\x89\x11\x5f\x9a\xb2\x28\xea" "\xc0\x1f\x57\x2a\x12\x4a\x20\xf5\x3e\xdb\x3b\xba\xf9\xff\xab\x3b\xfa\xd0" "\x76\xf7\xe6\xff\x6e\x96\xbf\xb2\xbb\x79\x4a\xd2\xfc\x7f\x2d\x7b\x75\xad" "\x5f\xfe\xef\x13\xcb\xf0\x7e\x36\x64\x53\xb6\xe4\xb9\x2c\x4b\x5b\xda\xd2" "\x92\x57\x23\x8f\x68\xb8\x3f\x35\xd1\xe2\x8b\x91\x48\x02\x31\x52\x17\x27" "\x5d\xa3\x3a\x6b\x94\x94\xa5\x24\x25\xb1\xe5\x89\x2c\x48\x55\x22\x51\x52" "\x15\x23\x9e\x68\x89\x64\x49\x22\x89\x45\xa7\x9f\x28\x57\x42\xd1\xe2\x48" "\x2c\x81\x84\xa2\x64\x56\x5c\xb9\x25\x4a\x0a\x52\x96\xb2\xcc\x8b\x12\x2d" "\x79\x59\x92\x40\x9a\xe2\x4b\x4d\x2a\xe2\xa4\x47\x59\x95\xb5\xf4\xbc\xcf" "\x8b\xb2\xfa\xc5\xb8\x53\xa9\xd0\xb7\x1b\xb9\xee\xe7\xae\x25\xc5\x43\x7a" "\x7b\x9c\xf9\x1f\x5f\xaa\x63\xbd\x7e\x03\x47\xb1\xdd\xcd\xff\x00\x00\x00" "\x00\x00\xe0\xd4\xb2\xd2\xdf\xbe\x27\xe3\xff\x09\xb9\x9a\x2e\x55\x8d\xa7" "\xed\x51\x87\x05\x00\x00\x00\x00\x00\x8e\x51\xfa\x97\xff\xe9\xa4\x98\x48" "\x96\xae\x8a\xc5\xf8\x1f\x00\x00\x00\x00\x80\xd3\xc6\x4a\xef\xb1\xb3\x44" "\x24\x27\xd7\xb3\xa5\x55\xb1\xd2\xdb\xa5\xf8\x25\x00\x00\x00\x00\x00\x00" "\xa7\x44\xfa\xf7\xff\x6b\x49\x91\xce\x81\x72\x5d\xac\x9d\xe9\x52\x18\xff" "\x03\x00\x00\x00\x00\x70\x4a\xfc\x34\x70\x8e\xfd\xa8\x71\xce\xfa\xfd\x2f" "\x09\xc3\x09\xeb\x4d\x63\xf1\xff\xd6\xba\x93\xd4\x73\xd6\xcf\x64\xfb\x65" "\xc5\x9b\xdd\x23\xc6\xd5\x29\xeb\x42\xe7\x20\x69\x51\xca\x8a\xf1\x71\x57" "\x4f\x5b\x93\x59\xa5\x9d\x49\x30\xdf\x77\x8a\xd5\x41\x71\x58\x07\x05\xf0" "\xc3\x4e\x00\x32\x38\x80\x4b\xe3\xf2\x8b\xdc\xc8\xea\xdc\x58\xc9\xca\x95" "\xee\x96\xac\x95\x5c\xd5\x78\x3a\xef\x06\xde\x83\x82\x38\xce\x85\xb1\x58" "\x2f\xc6\xdf\xbe\x58\xfb\x4e\xd2\xee\xff\xec\xd7\x2f\x58\xb2\xba\xd6\x6e" "\xe5\x9f\xbe\x6c\xaf\xa4\xb1\xa4\x1d\x7f\xb3\xde\x99\x40\x71\xdf\x3c\x8a" "\x87\xc4\xf2\x3a\x9d\x6f\x21\xbd\xe7\xa2\xa7\xc7\xde\xdf\xd9\xea\x89\xf4" "\x46\x8c\x4e\xbb\xb9\xac\x5d\x7b\x6f\xff\x3b\xcf\x4a\x18\xfb\x88\x36\xdf" "\xca\x4c\x56\x67\xa6\x33\xe3\x6d\xae\xb7\xff\x93\x49\x9b\x85\x7c\x4f\xef" "\x93\x6d\x3b\x51\x4c\xca\x5a\xbb\x55\x38\x62\xcf\xdf\xca\xcd\xac\xce\xcd" "\xd9\x9b\x59\x71\x40\x14\xc5\x7c\xbf\xf7\xa0\x73\x2e\x8a\x7b\xa3\xf8\xa4" "\x73\xb1\x3f\x0a\xab\x27\x8a\xf3\x22\x32\x28\x8a\xf9\x7e\x51\x58\x1f\x16" "\x05\x00\x8c\xca\x6a\x9f\x2c\xb4\x9b\xff\xf7\xe5\xdd\x4f\xb8\xd6\x7e\x5a" "\x76\x97\x8f\xcc\xee\x6f\x65\x36\xab\x33\x3b\x95\x5e\x58\xc7\xa7\x0e\xc8" "\x2b\xf6\xa0\x2b\xba\x7d\xc4\xec\xf6\xdb\xbe\x67\x20\xf5\xcb\xb1\x49\xbb" "\xbf\xee\xb4\x9b\x65\xd5\x77\xc9\x0e\xef\xfa\xb6\x1b\x79\x45\x2b\x39\x85" "\x67\x5e\xaf\x7f\x23\x97\x37\x36\xb7\x6e\xaf\xad\x2f\x3f\x6b\x3d\x6b\xbd" "\x28\x16\xe7\x4b\xf6\x5d\xdb\xbe\x57\x94\x89\xb4\x1b\x9d\x62\x4f\xa4\xdb" "\xe7\xc8\x3d\x00\x80\xcc\xe0\x67\xec\x0c\xac\x61\xdd\xcd\x46\xd5\x17\x45" "\x0e\x1e\x55\xff\x77\xe7\x2b\x05\x79\x79\x2a\x2f\xa5\x2d\x2b\x32\x97\xde" "\x6d\x90\x7e\xe3\xe0\xc0\xa3\xe6\xf6\x7c\x0d\x61\x6e\xc0\xa8\x35\x97\xa6" "\xc9\xec\x09\x2f\x73\x87\x8c\x2d\xcf\xa6\x77\x39\x74\x8f\x5b\x3c\xb4\x6e" "\x6f\x0c\xf3\xc3\x78\x2b\x00\x00\x18\x9a\x99\x01\x79\xf8\x43\xf2\xff\xdc" "\x80\x71\x77\x6f\x2e\xef\x1d\x1d\x9f\x95\x7e\x75\x0b\x43\x3f\x17\x00\x00" "\x7c\x29\x74\xf8\xde\xca\xc5\x3f\x5a\x61\x68\x1a\x4f\x0a\xe5\x72\xc1\x89" "\x17\xb4\x0a\x03\xf7\x91\x0a\x4d\xa5\xa6\x95\xf1\x63\x1d\xba\x0b\x8e\x5f" "\xd3\xaa\x11\x06\x71\xe0\x06\x5e\xb2\xf0\xd8\x54\x74\xa4\xa2\x66\xa3\x11" "\x84\xb1\xaa\x06\xa1\x6a\x04\x91\x59\x4c\x9f\xfc\xae\x3a\x8f\x7e\x8f\x74" "\xdd\xf1\x63\xe3\x46\x0d\x4f\x3b\x91\x56\x6e\xe0\xc7\x8e\x1b\xab\x8a\x89" "\xce\xab\x46\xf3\x6b\xcf\x44\x0b\x3a\x4c\x77\x8e\x1a\xda\x35\x55\xe3\x3a" "\xb1\x09\x7c\x15\x05\xcd\xd0\xd5\x79\xa5\x22\xad\xf7\x54\x34\x15\xed\xc7" "\xa6\x6a\x92\x45\x5f\x35\x42\x53\x77\xc2\x25\xf5\x38\xf0\x9a\x75\xad\x2c" "\xb1\x24\x34\x8d\x38\xc8\x0e\xd8\x6d\xcb\xf8\xd5\x20\xac\xa7\x87\xcd\x8f" "\xfa\x64\x03\x00\xf0\x99\xd8\xd8\xdc\x7a\xbe\xdc\x6e\xb7\x5e\x9d\xe0\xc2" "\xa8\xfb\x08\x00\x00\x7a\x91\xa5\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\xf8\xfc\x0d\xe3\xfe\x3f\x16\x46\xb1\x70\xb6" "\xf3\x0e\x0f\xa1\xad\xee\x54\xd0\xa3\xee\xf2\x09\x2f\x58\x43\xed\xe0\xb8" "\x88\x8c\xb2\xcb\x03\x2f\x1d\xdf\x9f\xe8\x85\x09\xc0\x89\xfb\x27\x00\x00" "\xff\xff\x18\x49\x4b\x68", 1392); syz_mount_image(/*fs=*/0x200000000080, /*dir=*/0x2000000000c0, /*flags=*/0, /*opts=*/0x2000000001c0, /*chdir=*/1, /*size=*/0x570, /*img=*/0x200000001080); // open_by_handle_at arguments: [ // mountdirfd: fd (resource) // handle: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {20 00 00 00 02 00 00 00 1d} (length 0x9) // } // } // } // flags: open_flags = 0x0 (8 bytes) // ] memcpy((void*)0x200000000180, "\x20\x00\x00\x00\x02\x00\x00\x00\x1d", 9); syscall(__NR_open_by_handle_at, /*mountdirfd=*/0xffffff9c, /*handle=*/0x200000000180ul, /*flags=*/0ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; use_temporary_dir(); loop(); return 0; }