// https://syzkaller.appspot.com/bug?id=f86606dfb403cc9435c0ed5f17e1d80c110cddef // 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 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; } 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"); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { 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; } } } void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$hfsplus arguments: [ // fs: ptr[in, buffer] { // buffer: {68 66 73 70 6c 75 73 00} (length 0x8) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: mount_flags = 0x2000444 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0x695 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x695) // } // ] // returns fd_dir memcpy((void*)0x200000000100, "hfsplus\000", 8); memcpy((void*)0x200000000000, "./file1\000", 8); memcpy( (void*)0x2000000026c0, "\x78\x9c\xec\xdd\x4d\x6c\x1c\x67\xfd\x07\xf0\xef\x6e\xbc\x6b\x6f\xfe\x7f" "\xa5\x4e\x9b\xa4\x01\x55\x22\x6a\xa4\x82\x88\x48\x9c\x58\x49\x31\x97\x06" "\x84\x50\x24\x2a\x54\x95\x03\xe2\x68\x25\x4e\x63\x65\xe3\x56\xb6\x8b\x9c" "\x08\x41\x78\x3f\x70\xe1\xd0\x3b\x45\xc2\x37\x2e\x20\x71\x0f\x2a\x67\xe0" "\xd4\xab\x8f\x95\x90\xb8\xf4\x14\x40\x62\xd1\xcc\xce\xda\xeb\x97\xd8\xbb" "\x4e\xe2\xb5\xc5\xe7\x13\xcd\xcc\x33\xf3\xbc\xcc\xf3\xfc\x66\x66\x67\x67" "\x56\x91\x03\xfc\xcf\xba\x71\x21\x63\x8f\x52\xcb\x8d\x0b\x6f\xae\x14\xeb" "\x6b\xab\xd3\xed\xb5\xd5\xe9\x7b\xbd\x74\x92\xf1\x24\xf5\x64\xac\xbb\x48" "\x6d\x21\xa9\x7d\x94\x5c\x4f\x77\xca\x67\x8a\x8d\x55\x73\xb5\x27\xed\xe7" "\x83\xf9\x99\xb7\x3f\xfe\x74\xed\x93\xb4\x7a\x5b\xc6\x7a\xe5\xeb\xbb\xd5" "\xdb\xe6\x5a\x7d\x87\x8d\x0f\xab\x29\xe7\x92\x1c\xab\x96\x4f\x61\x53\x7b" "\x37\xb7\xb4\xd7\x1c\xba\xb9\xda\xfa\x08\x8b\x80\x9d\xef\x05\x0e\x46\xad" "\x91\xa4\xb3\xc9\x77\xcf\x6c\xe4\xec\x69\xf0\xeb\x16\x38\xb4\x6a\xdd\xfb" "\xe6\xb6\x0b\x7a\x32\x39\x9e\x64\xa2\xfa\x1e\xd0\xbd\x2b\x76\xef\xd9\x47" "\xda\xc3\x51\x77\x00\x00\x00\x00\x0e\xc0\x0b\xbf\x2c\x1f\xe1\x4f\x8c\xba" "\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x94\x54\x7f\xff\xbf\x56\x4d" "\xf5\x5e\xfa\x5c\x6a\xbd\xbf\xff\xdf\xac\xb6\xa5\x4a\x1f\x69\x8f\x46\xdd" "\x01\x00\x00\x00\x00\x00\x00\x00\x18\xde\x37\xff\x7f\xcb\x86\xcf\x3d\xce" "\xe3\xac\xe4\x44\x6f\xbd\x53\x2b\x7f\xf3\x7f\xb5\x5c\x39\x55\xce\xff\x2f" "\xef\x67\x29\x73\x59\xcc\xc5\xac\x64\x36\xcb\x59\xce\x62\x2e\x27\x99\x2c" "\xf3\x1b\xe5\xbc\xb9\x32\xbb\xbc\xbc\x78\x79\x80\x9a\x57\xd6\x6b\xa6\xaf" "\xe6\x95\x01\x47\xd0\xda\xff\xe0\x01\x00\x00\x00\x00\x00\x00\xe0\xa8\x18" "\x1b\xbe\xca\x8f\x73\x63\xe3\xf7\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x38\x0c\x6a\xc9\xb1\xee\xa2\x9c\x4e\xf5\xd2\x93\xa9\x8f\x25\x99" "\x48\xd2\x2c\xca\x3d\x4c\xfe\xda\x4b\x1f\x4a\xbf\xfe\x53\xff\x5a\xe7\xdf" "\x9d\xd2\xb6\x62\x8f\x0e\xb2\x4f\x00\x00\x00\x30\x22\x2f\x3c\xce\xe3\xac" "\xe4\x44\x6f\xbd\x53\x2b\x9f\xf9\xcf\x94\xcf\xfd\x13\x79\x3f\x0b\x59\xce" "\x7c\x96\xd3\xce\x5c\x6e\x95\xef\x02\xba\x4f\xfd\xf5\xb5\xd5\xe9\xf6\xda" "\xea\xf4\xbd\x62\xda\xde\xee\x57\xff\x31\x54\x37\xca\x16\xd3\x7d\xf7\xb0" "\xf3\x9e\xcf\x96\x25\x5a\xb9\x9d\xf9\x72\xcb\xc5\xdc\xcc\xbb\x69\xe7\x56" "\xea\x65\xcd\xc2\xd9\x5e\x7f\x76\xee\xd7\x8f\x8a\x3e\xd5\xde\xa8\x0c\xd8" "\xb3\x5b\xd5\xb2\x18\xf9\xaf\xd2\x18\x6a\x54\xfb\x51\x1b\xb8\xe4\x64\x19" "\x91\xa2\x47\xdd\x88\x4c\x55\x75\x8b\x68\x9c\xdc\x3d\x12\x43\x1e\x9d\xc9" "\xd3\xbd\x54\x77\x4f\x97\x53\x5f\x7f\xf3\x73\xea\x59\xc6\x7c\xa5\xbb\x78" "\xfd\xb7\xdd\x65\x31\x9e\x9f\x0f\x15\x93\xe7\xad\x17\xf3\xde\x59\x78\xa5" "\xef\xec\x3b\xb3\x7b\x24\x92\xcf\xff\xf1\x77\xdf\xb9\xd3\x5e\xb8\x3b\x7e" "\x7b\xe9\xc2\xe1\x19\xd2\x10\xc6\xfb\xde\xa0\x6d\x8d\xc4\x74\x5f\x24\x5e" "\x1e\x34\x12\x77\x8e\x6a\x24\xfa\x4d\x95\x91\x58\xbf\x44\x72\x23\xdf\xc8" "\xb7\x73\x21\xe7\xf2\x56\x16\x33\x9f\xef\x65\x36\xcb\x99\xcb\xb9\x7c\x3d" "\xb3\x39\x96\xd9\xea\x7c\x2e\xe6\x93\xbb\x47\xea\xfa\xa6\xb5\xb7\xf6\xea" "\x49\xb3\x3c\x2e\x8d\xea\x53\x74\xf0\x3e\x2d\x67\x36\xaf\x96\x75\x4f\x64" "\x3e\xdf\xca\xbb\xb9\x95\xb9\x5c\x2b\xff\x5d\xc9\xe5\xbc\x9e\xab\xb9\x9a" "\x99\xbe\x23\x7c\x7a\x80\xab\xbe\xbe\xe7\x55\x5f\xef\x5f\x39\xff\x85\xbe" "\x97\xc9\xbf\x48\xd2\xda\x6b\xb8\x07\xa6\xe8\xd8\xc9\xf5\xbb\x53\xff\x59" "\x3f\x55\x5e\x07\x27\x37\x6d\xd9\x88\xd2\x8b\xcf\xfe\x7e\x34\xf6\xd9\x2a" "\x51\xec\xe3\x27\x5b\x63\x38\x52\x5b\x23\x71\xb9\x2f\x12\x2f\xed\x1e\x89" "\xdf\x94\x1f\x2b\x4b\xed\x85\xbb\x8b\x77\x66\xdf\x1b\x70\x7f\xaf\x55\xcb" "\xe2\x3a\xfa\xd9\xa1\xba\x4b\x14\xe7\xcb\x8b\xc5\xc1\x2a\xd7\x36\x9f\x1d" "\x45\xde\x4b\x5b\xf3\x26\xba\xf1\x6a\x56\xbf\xb8\x74\xf3\xea\x9b\x62\x59" "\xe4\x9d\x5e\xcf\xdb\xeb\x4a\x6d\x56\xdf\xe1\xb6\xb7\x74\xa5\xcc\x7b\x79" "\xc7\xbc\xe9\x32\xef\x6c\x5f\xde\xa6\xef\x5b\xd7\xbb\xdf\xb7\x00\x38\xf4" "\x8e\x7f\xf1\x78\xb3\xf5\xf7\xd6\x5f\x5a\x1f\xb6\x7e\xda\xba\xd3\x7a\x73" "\xe2\x6b\xe3\x5f\x1e\x7f\xa5\x99\xc6\x9f\x1b\x5f\x19\x9b\x3a\xf6\x5a\xfd" "\x95\xda\x1f\xf2\x61\x7e\xb0\xf1\xfc\x0f\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\xdf\xd2" "\xfd\x07\x77\x67\xdb\xed\xb9\xc5\x2d\x89\x4e\xa7\xf3\xc3\x27\x64\x3d\xc7" "\x44\x2b\x49\x6f\x4b\xb2\x57\xad\x46\xf6\x2e\xf3\x7c\x12\xcd\x24\x65\x62" "\xac\x97\x18\xae\x9d\xf1\x81\x0a\x37\x37\x8e\xce\x1b\xbf\xdf\x5f\x57\x1b" "\xdd\x40\x0d\xdb\xc3\xe4\xe9\x03\xb5\xb6\x71\x92\xdd\x7f\x70\xf7\x9f\x9d" "\x4e\xe7\xc0\x0f\xd3\x0e\x89\xc6\x2e\xe7\xfc\x46\xa2\x53\xd9\x96\xd5\x19" "\xa8\xfa\xc8\x12\xff\xea\x3c\xbb\x06\x47\xf9\xa9\x04\x1c\x84\x4b\xcb\xf7" "\xde\xbb\xb4\x74\xff\xc1\x97\xe6\xef\xcd\xbe\x33\xf7\xce\xdc\xc2\xcc\xd5" "\xab\x33\x53\x33\x57\xaf\xfd\xed\xd2\xed\xf9\xf6\xdc\x54\x77\x3e\xea\x5e" "\x02\xcf\xc3\xc6\x4d\x7f\xd4\x3d\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x06\x75\x10\xff\x2d\xe1\x09\xbb\xfe\xcf\x01\x0f\x15\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\xa2" "\x6e\x5c\x18\xaf\x52\x17\xa7\x8a\xf9\xda\xea\x74\xbb\x98\x7a\xe9\xf5\x82" "\x65\xb1\x7a\x92\xda\xf7\x93\xda\x47\xc9\xf5\x74\xa7\x4c\xf6\x35\x57\x7b" "\xd2\x7e\x3e\x98\x9f\x79\xfb\xe3\x4f\xd7\x3e\xe9\xae\x8d\x55\x53\x59\xbe" "\xbe\xa9\x5e\x63\x3f\xa3\x78\x58\x4d\x39\x97\xe4\x58\xb5\xec\x37\xf1\x14" "\xed\xdd\xac\x96\xfb\xea\x59\xa9\xb6\x3e\xc2\x22\x60\xe7\x7b\x81\x83\x51" "\xfb\x6f\x00\x00\x00\xff\xff\x36\x86\x10\x50", 1685); syz_mount_image( /*fs=*/0x200000000100, /*dir=*/0x200000000000, /*flags=MS_LAZYTIME|MS_NODEV|MS_NOATIME|MS_MANDLOCK*/ 0x2000444, /*opts=*/0x200000000140, /*chdir=*/1, /*size=*/0x695, /*img=*/0x2000000026c0); // creat arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 00} (length 0xfb) // } // mode: open_mode = 0x0 (8 bytes) // ] // returns fd memcpy((void*)0x200000000300, "./" "file0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000", 251); syscall(__NR_creat, /*file=*/0x200000000300ul, /*mode=*/0ul); // unlink arguments: [ // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 00} (length 0xfb) // } // ] memcpy((void*)0x200000000000, "./" "file0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000", 251); syscall(__NR_unlink, /*path=*/0x200000000000ul); } 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; loop(); return 0; }