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