// 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 30 00} (length 0x8) // } // flags: mount_flags = 0xa00010 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {6e 6f 64 65 63 6f 6d 70 6f 73 65 2c 64 65 63 6f // 6d 70 6f 73 65 2c 6e 6f 62 61 72 72 69 65 72 2c 67 69 64 3d} // (length 0x24) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {2c 6e 6c 73 3d 69 73 6f 38 38 35 39 2d 31 00 00 // 00 00 72 72 69 65 72 2c 00 bc d0 f0 b5 c4 e2 95 79 74 ff 5d 7e a3 // c3 dc ee 08 7e 49 83 68 4e 8a 4c 4e 4e 87 b1 34 e3 0c e7 71 62 b1 // 28 85 b9 64 b3 50 6f f3 ea e0 f3 59 94 47 b1 78 61 d1 9b e7 80 79 // e5 dd 7b dc 7f 1e b3 6e 31 ac 14 de 48 34 97 67 16 4f 5f 64 31 bb // de ae f9 6a 4f 2b ce 64 b5 cf a7 6c e3 a2 c4 30 23 74 bc 55 35 d7 // e2 eb 8d fb 2e 5d 58 a3 7b 7e 37 83 65 97 c2 1f 51 bc df 6d f4 ca // d8 25 cf d9 ef 5e e9 e8 9e 04 b1 5c d3 ce a9 e1 52 d6 7b 9a 7e ed // c5 df e6 d8 5a 3c e7 c3 42 da 8c c9 69 b5 52 19 7c b8 bc c4 a1 00 // 9f 38 f4 a8 5b 7c 74 21 01 ba 5b c0 31 15 fe ca 2b 99 4c 69 98 12} // (length 0xd6) // } // } // } // chdir: int8 = 0x6 (1 bytes) // size: len = 0x63a (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x63a) // } // ] // returns fd_dir memcpy((void*)0x200000000000, "hfsplus\000", 8); memcpy((void*)0x200000000200, "./file0\000", 8); memcpy((void*)0x200000000840, "nodecompose,decompose,nobarrier,gid=", 36); sprintf((char*)0x200000000864, "0x%016llx", (long long)0xee01); memcpy( (void*)0x200000000876, "\x2c\x6e\x6c\x73\x3d\x69\x73\x6f\x38\x38\x35\x39\x2d\x31\x00\x00\x00\x00" "\x72\x72\x69\x65\x72\x2c\x00\xbc\xd0\xf0\xb5\xc4\xe2\x95\x79\x74\xff\x5d" "\x7e\xa3\xc3\xdc\xee\x08\x7e\x49\x83\x68\x4e\x8a\x4c\x4e\x4e\x87\xb1\x34" "\xe3\x0c\xe7\x71\x62\xb1\x28\x85\xb9\x64\xb3\x50\x6f\xf3\xea\xe0\xf3\x59" "\x94\x47\xb1\x78\x61\xd1\x9b\xe7\x80\x79\xe5\xdd\x7b\xdc\x7f\x1e\xb3\x6e" "\x31\xac\x14\xde\x48\x34\x97\x67\x16\x4f\x5f\x64\x31\xbb\xde\xae\xf9\x6a" "\x4f\x2b\xce\x64\xb5\xcf\xa7\x6c\xe3\xa2\xc4\x30\x23\x74\xbc\x55\x35\xd7" "\xe2\xeb\x8d\xfb\x2e\x5d\x58\xa3\x7b\x7e\x37\x83\x65\x97\xc2\x1f\x51\xbc" "\xdf\x6d\xf4\xca\xd8\x25\xcf\xd9\xef\x5e\xe9\xe8\x9e\x04\xb1\x5c\xd3\xce" "\xa9\xe1\x52\xd6\x7b\x9a\x7e\xed\xc5\xdf\xe6\xd8\x5a\x3c\xe7\xc3\x42\xda" "\x8c\xc9\x69\xb5\x52\x19\x7c\xb8\xbc\xc4\xa1\x00\x9f\x38\xf4\xa8\x5b\x7c" "\x74\x21\x01\xba\x5b\xc0\x31\x15\xfe\xca\x2b\x99\x4c\x69\x98\x12", 214); memcpy( (void*)0x2000000012c0, "\x78\x9c\xec\xdd\xcf\x6b\x1c\xe7\xfd\x07\xf0\xf7\xac\x56\x6b\xc9\x5f\x70" "\x94\xc4\x4e\xfc\x2d\x81\x8a\x18\xd2\x52\x51\x5b\x3f\x50\x5a\xf5\x12\xb7" "\x94\xa2\x43\x28\x21\x3d\xf4\x2c\x6c\x39\x16\x5e\x2b\x41\x52\x8a\x12\x4a" "\x51\x7f\x43\x4f\x3d\xe4\x0f\x48\x0f\xba\xf5\x54\xe8\xdd\x90\x9e\xdb\x5b" "\xae\x3a\x06\x0a\xbd\xf4\xa4\x9b\xca\xcc\xce\xae\xd6\xd6\x4a\xd1\xaf\x78" "\xa5\xf6\xf5\x32\xb3\xf3\x99\x79\x76\x9e\x79\x9e\xcf\x3e\x33\xbb\xb3\x6b" "\x31\x01\xfe\x67\x2d\x4e\xa5\xf9\x24\x45\x16\xa7\xde\xde\x2c\x97\x77\xb6" "\xe7\xda\x3b\xdb\x73\x57\xea\xe2\x76\x92\x32\x6e\x24\xcd\xce\x2c\xc5\x6a" "\x52\x7c\x96\xdc\x4d\x67\xca\xff\x97\x2b\x53\x6c\x1d\xb9\x9f\x4f\x56\x16" "\xde\xfd\xfc\xdf\x3b\x5f\x34\x7b\x6b\xaa\xa8\xe8\x56\x7a\xb6\x5e\x6c\xd5" "\x53\x26\x93\x8c\xd4\xf3\x67\xb4\xfe\x70\x92\xfa\x46\x3b\x41\x59\xcf\xbd" "\xc1\xf5\x9d\x40\xd1\xeb\x61\x99\xb0\x5b\xdd\xc4\xc1\xb0\xed\x1d\x70\xf4" "\x71\xfc\x8c\x33\x1e\xb7\xc0\x45\x50\x74\xde\x37\x0f\x98\x48\xae\x26\x19" "\xab\x3f\x07\xa4\x3e\x3b\x34\x9e\x6f\xeb\xce\xdf\x89\xce\x72\x00\x00\x00" "\x70\x49\xbd\xb0\x9b\xdd\x6c\xe6\xda\xb0\xdb\x01\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x97\x49\x7d\xff\xff\xa2\x9e\x1a\xdd\x78\x32\x45\xf7\xfe\xff" "\xad\x7a\x5d\xea\xf8\x52\x7b\x32\xec\x06\x00\x00\x00\x00\x00\x00\x00\xc0" "\x39\xf8\xfa\x6e\x76\xb3\x99\x6b\xdd\xe5\xbd\xa2\xfa\xcd\xff\xf5\x6a\xe1" "\x7a\xf5\xf8\x7f\xf9\x30\xeb\x59\xce\x5a\x6e\x67\x33\x4b\xd9\xc8\x46\xd6" "\x32\x93\x64\xa2\xaf\xa2\xd6\xe6\xd2\xc6\xc6\xda\xcc\x31\xb6\x9c\x1d\xb8" "\xe5\xec\xf3\xe9\x2f\x00\x00\x00\x00\x00\x00\x00\xfc\x97\xfa\x55\x16\xf7" "\x7f\xff\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\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\x61\x1a\xa9\xe7" "\x45\x27\x2c\xea\xe9\x7a\x37\x9e\x48\xa3\x99\x64\x2c\x49\xab\x7c\xde\x56" "\xf2\x8f\x6e\x7c\x49\x14\x83\x56\x3e\x79\xfe\xed\x00\x00\x00\x80\x33\x19" "\x3b\xc5\x36\x2f\xec\x66\x37\x9b\xb9\xd6\x5d\xde\x2b\xaa\x6b\xfe\x57\xaa" "\xeb\xe5\xb1\x7c\x98\xd5\x6c\x64\x25\x1b\x69\x67\x39\xf7\xeb\x6b\xe8\xf2" "\xaa\xbf\xb1\xb3\x3d\xd7\xde\xd9\x9e\x7b\x5c\x4e\x07\xeb\xfd\xfe\xbf\x4e" "\xd4\x8c\xaa\xc6\xde\xd7\x10\x83\xf6\x7c\xb3\x7a\xc6\x78\x1e\x64\xa5\x5a" "\x73\x3b\xf7\xaa\xc6\xdc\x4f\xa3\xda\xb2\x74\xb3\xdb\x9e\xc1\xed\xfa\x65" "\xd9\xa6\xe2\xad\xda\x31\x5b\x76\xbf\x9e\x97\x3b\xfb\xe3\x61\xdf\x22\x0c" "\xc5\x44\x95\x91\xd1\x5e\x46\xa6\xeb\xb6\x95\xd9\x78\xf1\xe8\x4c\x7c\xe9" "\xab\xd3\x3c\x72\x4f\x33\x69\xf4\xbe\xf9\xb9\xfe\x15\xe4\xfc\x6a\x3d\x2f" "\xfb\xf3\xbb\x8b\x99\xf3\x46\xaa\x4c\xcc\xf6\x8d\xbe\x57\x8e\xce\x44\xf2" "\x8d\xbf\xfe\xf9\xa7\x0f\xdb\xab\x8f\x1e\x3e\x58\x9f\xba\x38\x5d\x3a\xa5" "\xbe\x31\x31\xde\x5d\xd7\xcd\xc4\xab\x97\x3a\x13\x9d\xb1\x7f\xfc\x93\xe9" "\x74\xd5\xf3\x1b\xbd\xe5\xc5\xfc\x28\x3f\xc9\x54\x26\xf3\x4e\xd6\xb2\x92" "\x9f\x65\x29\x1b\x59\xce\x5e\x5d\xbe\x54\x8f\xe7\xf2\x71\xe2\xe8\x4c\xdd" "\x7d\x6a\xe9\x9d\x2f\x6b\x49\xab\x7e\x5d\x3a\x67\xd1\xe3\xb4\x69\x32\x3f" "\xac\xa2\xa5\xbc\x5e\x6d\x7b\x2d\x2b\x29\xf2\x7e\xee\x67\x39\x6f\x56\xff" "\x66\x33\x93\xef\x64\x3e\xf3\x59\xe8\x1b\xeb\x37\x0e\x6d\x77\xd5\xb7\xea" "\xa8\x6f\x9c\xec\xa8\xbf\xf5\xcd\x3a\x28\x87\xd3\xef\xeb\xf9\xb0\x75\x46" "\x41\x99\xd7\x17\xfb\xf2\xda\x7f\xce\x9d\xa8\xca\xfa\xd7\xec\x67\xe9\xa5" "\xf3\x3f\x37\x36\xbf\x56\x07\xe5\x3e\x7e\xdd\x77\xcc\x0d\xdf\xb3\x99\x98" "\xe9\xcb\xc4\xcb\x47\x67\xe2\x4f\xd5\xb1\xb1\xde\x5e\x7d\xb4\xf6\x70\xe9" "\x83\x43\xea\xdf\x7a\x66\xf9\x8d\x7a\x5e\x8e\xb8\xdf\x5e\xa8\x77\x89\x72" "\xbc\xbc\x94\xb1\xfa\x4c\xf2\xf4\xe8\x28\xcb\x5e\xee\x9d\x65\x9e\xce\x57" "\xab\xfe\xc5\xa5\x53\xd6\x38\x50\x76\xa3\x2a\x2b\x8a\xee\x91\xfa\xe3\x43" "\x8f\xd4\x56\xfd\x19\xee\x60\x4d\xb3\x55\xd9\xab\x03\xcb\xe6\xaa\xb2\x9b" "\x7d\x65\x4f\x7d\xde\xca\xfb\x69\xf5\x3e\x0f\x01\x70\x81\x5d\xfd\xd6\xd5" "\xd6\xf8\x3f\xc7\xff\x3e\xfe\xe9\xf8\x6f\xc6\x1f\x8e\xbf\x3d\xf6\x83\x2b" "\xdf\xbd\xf2\x5a\x2b\xa3\x7f\x1b\xfd\x5e\x73\x7a\xe4\x8d\xc6\x6b\xc5\x5f" "\xf2\x69\x7e\xb1\x7f\xfd\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\xde\xfa\x47\x1f\x3f" "\x5a\x6a\xb7\x97\xd7\x06\x07\x8d\xc3\x8b\xce\x37\x28\xea\x1b\xf9\x3c\x8f" "\x7d\x09\x86\x1d\x74\x6f\x22\x78\xe6\x0a\xef\x5e\x88\xee\x5c\xea\x60\x24" "\xc9\xa0\xa2\xfa\x25\x3a\xcd\xcd\x45\x81\x4b\xe1\xce\xc6\xe3\x0f\xee\xac" "\x7f\xf4\xf1\xb7\x57\x1e\x2f\xbd\xb7\xfc\xde\xf2\xea\xe8\xfc\xfc\xc2\xf4" "\xc2\xfc\x9b\x73\x77\x1e\xac\xb4\x97\xa7\x3b\x8f\xc3\x6e\x25\xf0\x55\xd8" "\x7f\xd3\x1f\x5c\x5e\x5c\xa8\x1b\x6c\x02\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x39\xde\xdf\xdb\xec\xd5\xff\xff\xef\xd4\x7f\x69\x30\xec\x3e\x02\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x97\xdb\xe2\x54\x9a\x4f\x52\x64\x66\xfa\xf6\x74\xb9\xbc\xb3\x3d" "\xd7\x2e\xa7\x6e\xbc\xff\xcc\x66\x92\x46\x23\x29\x7e\x9e\x14\x9f\x25\x77" "\xd3\x99\x32\xd1\x57\x5d\xf1\xd6\x21\xfb\xf9\x64\x65\xe1\xdd\xcf\xd3\xf8" "\x62\xbf\xae\x66\xf5\xfc\xb2\xd2\x7a\x7e\x06\x5b\xf5\x94\xc9\x24\x23\xf5" "\xfc\xbc\xea\xbb\x77\xe6\xfa\x8a\x5e\x0f\xcb\x84\xdd\xea\x26\x0e\x86\xed" "\x3f\x01\x00\x00\xff\xff\x8a\x25\xfe\x2a", 1594); syz_mount_image(/*fs=*/0x200000000000, /*dir=*/0x200000000200, /*flags=MS_I_VERSION|MS_SYNCHRONOUS|MS_RELATIME*/ 0xa00010, /*opts=*/0x200000000840, /*chdir=*/6, /*size=*/0x63a, /*img=*/0x2000000012c0); // open arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: open_flags = 0x80242 (8 bytes) // mode: open_mode = 0x1df2a23c5997fa5f (8 bytes) // ] // returns fd memcpy((void*)0x200000000580, "./file1\000", 8); syscall( __NR_open, /*file=*/0x200000000580ul, /*flags=O_TRUNC|O_CREAT|O_CLOEXEC|O_RDWR*/ 0x80242ul, /*mode=S_IXOTH|S_IWOTH|S_IROTH|S_IXGRP|S_IWGRP|S_IXUSR|0x1df2a23c5997fa00*/ 0x1df2a23c5997fa5ful); } 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; }