// https://syzkaller.appspot.com/bug?id=da0d8a51e89e8a43bbe9f97163f12296725c796c // 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_RDONLY); 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) { if (chdir(target) == -1) { err = errno; close(res); res = -1; } } 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_RDONLY); 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; } } } uint64_t r[1] = {0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$udf arguments: [ // fs: ptr[in, buffer] { // buffer: {75 64 66 00} (length 0x4) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: mount_flags = 0x0 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0xc58 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0xc58) // } // ] // returns fd_dir memcpy((void*)0x200000000f40, "udf\000", 4); memcpy((void*)0x200000000f80, "./file1\000", 8); memcpy( (void*)0x2000000000c0, "\x78\x9c\xec\xdd\x41\x6c\x1c\xd7\x7d\x07\xe0\xff\x1b\xed\x8a\x4b\x1b\xad" "\x98\x38\x51\x9d\x34\x2e\x36\x6d\x91\xca\x8a\xe5\xca\x92\x62\x2a\x56\xe1" "\xae\x6a\x9a\x6d\x00\x59\x16\x42\x31\xb7\x00\x5c\x89\x94\xba\x35\x45\x12" "\x24\xd5\xc8\x46\xda\x32\xbd\xf4\xd0\x43\x80\xa2\xe8\x21\x27\x02\xad\x51" "\x20\x45\x03\xa3\x09\x82\x1e\x99\xd6\x05\x92\x8b\x0f\x45\x80\x02\x3d\x11" "\x2d\x6c\x04\x45\x0f\x6c\x11\x20\xa7\x80\xc1\xcc\xbe\xa5\x96\x34\x69\xd3" "\xa2\x28\x51\xd2\xf7\xd9\xd4\x6f\x77\xf6\xbd\x99\xf7\xe6\xad\x67\x64\x41" "\x6f\x5e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\xbf" "\xf7\xf2\xf9\x93\xcf\xa5\xfb\xdd\x0a\x00\xe0\x5e\xba\x38\xf6\xe5\x93\xa7" "\xdc\xff\x01\xe0\x91\x72\xd9\xff\xff\x03\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xc0\x41\x97\xa2\x88\x27\x22\xc5\xdc\xc5\xb5\x34\x51\xbd\xef\x6a" "\x5c\xe8\xd4\x6f\xde\x1a\x1f\x19\xdd\xbe\xda\x60\xaa\x6a\x1e\xaa\xca\x97" "\x3f\x8d\xe7\x4e\x9d\x3e\xf3\x85\xe7\x87\xcf\xf6\xf2\x42\x67\xe6\x03\xea" "\xdf\x6d\x9f\x8e\x57\xc7\x2e\x9f\x6f\xbe\x34\x7b\x63\x6e\x7e\x6a\x61\x61" "\x6a\xb2\x39\x3e\xd3\xb9\x3a\x3b\x39\xb5\xeb\x3d\xec\xb5\xfe\x56\xc7\xab" "\x13\xd0\xbc\xf1\xda\xcd\xc9\x6b\xd7\x16\x9a\xa7\x9e\x3d\xbd\xe9\xe3\x5b" "\x43\xef\x0d\x3c\x7e\x74\xe8\xdc\xf0\xd3\x27\x9e\xea\x95\x1d\x1f\x19\x1d" "\x1d\xbb\x5d\xa4\xd1\x5f\xbe\x76\xc7\x0d\xe9\xda\x69\x86\xc7\xe1\x28\xe2" "\x44\xa4\x78\xe6\x3b\x3f\x49\xed\x88\x28\x62\xef\xe7\xa2\x71\x6f\xc7\x7e" "\xab\xc1\xaa\x13\xc7\xab\x4e\x8c\x8f\x8c\x56\x1d\x99\xee\xb4\x67\x16\xcb" "\x0f\x2f\xf5\x4e\x44\x11\xd1\xec\xab\xd4\xea\x9d\xa3\xed\xc7\x22\x6a\xf5" "\x7b\xda\x87\x9d\xb5\x22\x96\xca\xe6\x97\x0d\x3e\x5e\x76\x6f\x6c\xae\x3d" "\xdf\xbe\x32\x3d\xd5\xbc\xd4\x9e\x5f\xec\x2c\x76\x66\x67\x2e\xa5\x6e\x6b" "\xcb\xfe\x34\xa3\x88\xb3\x29\x62\x39\x22\x56\x07\xde\xbf\xbb\x7a\x14\x51" "\x8b\x14\xdf\x3a\xb2\x96\xae\x44\xc4\xa1\xde\x79\xf8\x7c\x35\x31\x78\xe7" "\x76\x14\xfb\xd8\xc7\x5d\x28\xdb\xd9\xac\x47\x2c\x17\x0f\xc0\x98\x1d\x60" "\x03\x51\xc4\x2b\x91\xe2\xa7\x6f\x1f\x8b\xab\xf9\x3a\x53\x5d\x6b\x3e\x17" "\xf1\x4a\x99\xdf\x8f\x78\xb3\xcc\x17\x23\x52\xf9\xc5\x38\x13\xf1\xee\x36" "\xdf\x23\x1e\x4c\xb5\x28\xe2\x2f\xcb\xf1\x3f\xb7\x96\x26\xab\xeb\x41\xef" "\xba\x72\xe1\x2b\xcd\x2f\xcd\x5c\x9b\xed\x2b\xdb\xbb\xae\x7c\xc4\xfb\xc3" "\xfb\xae\x14\xf7\xe9\xfe\x30\xb8\x25\xef\x8d\x03\x7e\x6d\x6a\x44\x11\xed" "\xea\x8a\xbf\x96\xee\xfc\x37\x3b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xdc\x6d\x83\x51\xc4\xa7\x22\xc5\xcb\xff\xfe\xc7\xd5\xbc\xe2" "\xa8\xe6\xa5\x1f\x39\x37\xfc\xfb\x43\xbf\xd4\x3f\x67\xfc\xc9\x0f\xd9\x4f" "\x59\xf6\xd9\x88\x58\x2a\x76\x37\x27\xf7\x70\x9e\x18\x78\x29\x5d\x4a\xe9" "\x3e\xcf\x25\x7e\x94\x35\xa2\x88\x3f\xc9\xf3\xff\xbe\x71\xbf\x1b\x03\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x48\x2b\xe2\xc7" "\x91\xe2\x85\x77\x8e\xa5\xe5\xe8\x5f\x53\xbc\x33\x73\xbd\x79\xb9\x7d\x65" "\xba\xbb\x2a\x6c\x6f\xed\xdf\xde\x9a\xe9\xeb\xeb\xeb\xeb\xcd\xd4\xcd\x56" "\xce\x89\x9c\x4b\x39\x97\x73\xae\xe4\x5c\xed\x66\x35\xef\xbf\xaa\x5f\xe4" "\xfa\x39\x27\x72\x2e\xe5\x5c\xce\xb9\x92\x73\x35\x67\x1c\xca\xf5\x73\xb6" "\x72\x4e\xe4\x5c\xca\xb9\x9c\x73\x25\xe7\x6a\xce\xa8\xe5\xfa\x39\x5b\x39" "\x27\x72\x2e\xe5\x5c\xce\xb9\x92\x73\x35\x67\x1c\x90\xb5\x7b\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x26\x45\x14\xf1\xf3\x48\xf1\xcd\xaf" "\xad\xa5\x48\x11\xd1\x8a\x98\x88\x6e\xae\x0c\xdc\xef\xd6\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa5\x81" "\x54\xc4\x77\x23\x45\xf3\x0f\x5a\x1b\xdb\x6a\x11\x91\xaa\x7f\xbb\x8e\x95" "\xbf\x9c\x89\xd6\xe1\x32\x3f\x1e\xad\xe1\x32\x5f\x8c\xd6\xf9\x9c\xed\x2a" "\x6b\xad\x6f\xdc\x87\xf6\xb3\x37\xf5\x54\xc4\x8f\x22\xc5\x40\xe3\xad\x8d" "\x01\xcf\xe3\x5f\xef\xbe\xdb\xf8\x1a\xc4\x9b\x5f\xbf\xfd\xee\xd3\xb5\x6e" "\x1e\xea\x7d\x38\xf4\xde\xc0\xe3\x47\x8f\x9c\x1b\x1e\xfd\xb5\x27\x77\x7a" "\x9d\xb6\x6b\xc0\xf1\x0b\x9d\x99\x9b\xb7\x9a\xe3\x23\xa3\xa3\x63\x7d\x9b" "\x6b\xf9\xe8\x1f\xef\xdb\x36\x94\x8f\x5b\xdc\x9d\xae\x13\x11\x0b\xaf\xbf" "\xf1\x5a\x7b\x7a\x7a\x6a\xfe\xce\x5f\x94\x5f\x81\x1d\x3e\x5a\x5f\x5f\xff" "\xb3\xf2\x28\x7b\x3d\xc4\x01\x79\x91\x6a\x3b\xf6\xf4\x91\x7c\x51\x0e\xed" "\x01\x68\xc6\x3e\x76\xb0\xb6\xab\xc2\xf5\x03\xd0\xd4\x7d\x19\x5c\x1e\x76" "\xe5\xfd\xff\xdd\x48\xf1\xdb\xef\xfc\x67\xef\x86\x5f\xdd\xff\x6b\x1b\x25" "\x36\xee\xf0\xf1\xb3\x3f\xbd\x7d\xff\x7f\x61\xeb\x8e\x76\x79\xff\xaf\x6d" "\xad\x97\xef\xff\xe5\x3d\x7d\xbb\xfb\xff\x13\x7d\xdb\x5e\xc8\xbf\x1b\xa9" "\xd7\x22\x1a\x8b\x37\xe6\xea\x47\x23\x1a\x0b\xaf\xbf\x71\xa2\x73\xa3\x7d" "\x7d\xea\xfa\xd4\xcc\x99\x93\x27\xbf\x38\x3c\xfc\xc5\xd3\x27\xeb\x87\x23" "\x1a\xd7\x3a\xd3\x53\x7d\xaf\xf6\x7e\xae\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\xee\xa9\x54\xc4\xef\x46\x8a\xf6\x8f\xd6\x52\x33\x22" "\x6e\x55\xf3\xb5\x86\xce\x0d\x3f\x7d\xe2\xa9\x43\x71\xa8\x9a\x6f\xb5\x69" "\xde\xf6\xab\x63\x97\xcf\x37\x5f\x9a\xbd\x31\x37\x3f\xb5\xb0\x30\x35\xd9" "\x1c\x9f\xe9\x5c\x9d\x9d\x9c\xda\xed\xe1\x1a\xd5\x74\xaf\xf1\x91\xd1\x7d" "\xe9\xcc\x87\x1a\xdc\xe7\xf6\x0f\x36\x5e\x9a\x9d\x7b\x7d\xbe\x73\xfd\x0f" "\x17\xb7\xfd\xfc\xb1\xc6\xf9\x2b\x0b\x8b\xf3\xed\xab\xdb\x7f\x1c\x83\x51" "\x44\xb4\xfa\xb7\x1c\xaf\x1a\x3c\x3e\x32\x5a\x35\x7a\xba\xd3\x9e\xa9\xaa" "\x5e\xda\x76\x32\xfd\x47\x57\x4f\x45\xfc\x57\xa4\xb8\x7a\xa6\x99\x3e\x9b" "\xb7\xe5\xf9\xff\x5b\x67\xf8\x6f\x9a\xff\xbf\xb4\x75\x47\xfb\x34\xff\xff" "\x63\x7d\xdb\xca\x63\xa6\x54\xc4\xcf\x22\xc5\x6f\xfd\xd5\x93\xf1\xd9\xaa" "\x9d\x8f\xc5\xfb\xce\x59\x2e\xf7\x77\x91\xe2\xf8\xd9\xcf\xe4\x72\x71\xb8" "\x2c\xd7\x6b\x43\xf7\xb9\x02\xdd\x99\x81\x65\xd9\xff\x8b\x14\xff\xf4\xf3" "\xcd\x65\x7b\xf3\x21\x9f\xb8\x5d\xf6\xb9\x5d\x9f\xd8\x07\x44\x39\xfe\x47" "\x22\xc5\x77\xff\xe2\xdb\xf1\xeb\x79\xdb\xe6\xe7\x3f\x6c\x3f\xfe\x8f\x6d" "\xdd\xd1\x3e\x8d\xff\x27\xfa\xb6\x3d\xb6\xe9\x79\x05\x7b\xee\x3a\x79\xfc" "\x4f\x44\x8a\x17\x9f\x78\x2b\x7e\x23\x6f\xfb\xa0\xe7\x7f\xf4\x9e\xbd\x71" "\x2c\x17\xde\x78\x3e\xc7\x3e\x8d\xff\x27\xfb\xb6\x0d\xe5\xe3\xfe\xe6\xdd" "\xe9\x3a\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x03\xad\x9e\x8a\xf8\xfb\x48" "\xf1\x83\xd1\x5a\x7a\x3e\x6f\xdb\xcd\xdf\xff\x9b\xdc\xba\xa3\x7d\xfa\xfb" "\x5f\xbf\xd2\xb7\x6d\xf2\xee\xac\x57\xf4\xa1\x2f\xf6\x7c\x52\x01\x00\x00" "\x00\xe0\x80\xa8\xa7\x22\x7e\x1c\x29\xae\x2f\xbe\xb5\x31\x87\x7a\xf3\xfc" "\xef\xbe\xf9\x9f\xbf\x73\x7b\xfe\xe7\x48\xda\xf2\x69\xf5\xe7\x7c\xbf\x5c" "\x3d\x37\xe0\x6e\xfe\xf9\x5f\xbf\xa1\x7c\xdc\x89\xbd\x77\x1b\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x94\x94\x8a\x78\x3e" "\xaf\xa7\x3e\x51\xcd\xe7\x9f\xdc\x71\x3d\xf5\x95\x48\xf1\xf2\xff\x3c\x93" "\xcb\xa5\xa3\x65\xb9\xde\x3a\xf0\x43\xd5\xaf\x8d\x8b\xb3\x33\x27\xce\x4f" "\x4f\xcf\x5e\x6d\x2f\xb6\xaf\x4c\x4f\x35\xc7\xe6\xda\x57\xa7\xca\xba\x9f" "\x88\x14\x6b\x7f\xfb\x99\x5c\xb7\xa8\xd6\x57\xef\xad\x37\xdf\x5d\xe3\xbd" "\x51\x8b\x88\x6a\x2d\xf6\xf9\x48\x31\xfa\x0f\xbd\xb2\xdd\xb5\xd8\x7b\x6b" "\x93\x77\xd7\x03\xef\xae\xc5\x5e\x96\xfd\x58\xa4\xf8\xef\x7f\xdc\x5c\xb6" "\xb7\x8e\xf5\x27\x6f\x97\x3d\x55\x96\xfd\x9b\x48\xf1\xd5\x7f\xde\xbe\xec" "\xd1\xdb\x65\x4f\x97\x65\xbf\x1d\x29\x7e\xf8\xd5\x66\xaf\xec\x63\x65\xd9" "\xde\xf3\x51\xbb\xcf\x24\x6d\xfc\x51\x44\x3c\x7b\x75\xb6\xd8\x87\x51\x01" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x51\x53\x4f" "\x45\xfc\x79\xa4\xf8\xdf\x1b\xcb\x1b\x73\xf9\xf3\xfa\xff\xf5\xbe\xb7\x95" "\x37\xbf\xde\xb7\xde\xff\x16\xb7\xaa\x75\xfe\x87\xaa\xf5\xff\x77\x7a\x7d" "\x27\xeb\xff\x57\xcf\x15\x58\xda\xe9\xa8\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x70\x4a\x51\xc4\x1b\x91\x62\xee" "\xe2\x5a\x5a\x19\x28\xdf\x77\x35\x2e\x74\x66\x6e\xde\x1a\x1f\x19\xdd\xbe" "\xda\x60\xaa\x6a\x1e\xaa\xca\x97\x3f\x8d\xe7\x4e\x9d\x3e\xf3\x85\xe7\x87" "\xcf\xf6\xf2\x83\xeb\xdf\x6d\x9f\x8a\x57\xc7\x2e\x9f\x6f\xbe\x34\x7b\x63" "\x6e\x7e\x6a\x61\x61\x6a\xb2\x39\x3e\xd3\xb9\x3a\x3b\x39\xb5\xeb\x3d\xec" "\x5c\xbf\x71\x47\x2d\x3a\x5e\x9d\x80\xe6\x8d\xd7\x6e\x4e\x5e\xbb\xb6\xd0" "\x3c\xf5\xec\xe9\x4d\x1f\xdf\x1a\x7a\x6f\xe0\xf1\xa3\x43\xe7\x86\x9f\x3e" "\xf1\x54\xaf\xec\xf8\xc8\xe8\xe8\x58\x5f\x99\x5a\xfd\x8e\x8e\xbc\xad\xb4" "\xc3\xf6\xc3\x51\xc4\x5f\x47\x8a\x67\xbe\xf3\x93\xf4\x83\x81\x88\x22\x3e" "\xf0\x5c\xec\xca\x87\x7c\x77\xf6\xdb\x60\xd5\x89\xe3\x55\x27\xc6\x47\x46" "\xab\x8e\x4c\x77\xda\x33\x8b\xe5\x87\x97\x7a\x27\xa2\x88\x68\xf6\x55\x6a" "\xf5\xce\xd1\x3d\x18\x8b\x3d\x69\x45\x2c\x95\xcd\x2f\x1b\x7c\xbc\xec\xde" "\xd8\x5c\x7b\xbe\x7d\x65\x7a\xaa\x79\xa9\x3d\xbf\xd8\x59\xec\xcc\xce\x5c" "\x4a\xdd\xd6\x96\xfd\x69\x46\x11\x67\x53\xc4\x72\x44\xac\x0e\xbc\x7f\x77" "\xf5\x28\xe2\xb5\x48\xf1\xad\x23\x6b\xe9\x5f\x06\x22\x0e\xf5\xce\xc3\xe7" "\x2f\x8e\x7d\xf9\xe4\xa9\x9d\xdb\x51\xec\x63\x1f\x77\xa1\x6c\x67\xb3\x1e" "\xb1\x5c\x3c\x00\x63\x76\x80\x0d\x44\x11\xdf\x8b\x14\x3f\x7d\xfb\x58\xfc" "\xeb\x40\x44\x2d\xba\x3f\xf1\xb9\x88\x57\xca\xfc\x7e\xc4\x9b\xd1\x1d\xef" "\x54\x7e\x31\xce\x44\xbc\xbb\xcd\xf7\x88\x07\x53\x2d\x8a\xf8\xff\x72\xfc" "\xcf\xad\xa5\xb7\x07\xca\xeb\x41\xef\xba\x72\xe1\x2b\xcd\x2f\xcd\x5c\x9b" "\xed\x2b\xdb\xbb\xae\x1c\xa8\xfb\xc3\xf7\xfe\xe3\xa3\xd6\x18\xbc\x1b\x87" "\xdd\xb5\x03\x7e\x6d\x6a\x44\x11\x3f\xac\xae\xf8\x6b\xe9\xdf\xfc\x77\x0d" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x80\x14\xf1\xab\x91" "\xe2\x85\x77\x8e\xa5\x6a\x7e\xf0\xc6\x9c\xe2\xce\xcc\xf5\xe6\xe5\xf6\x95" "\xe9\xee\xb4\xbe\xde\xdc\xbf\xde\x9c\xe9\xf5\xf5\xf5\xf5\x66\xea\x66\x2b" "\xe7\x44\xce\xa5\x9c\xcb\x39\x57\x72\xae\xe6\x8c\x22\xd7\xcf\xd9\x2a\xb3" "\xb1\xbe\x3e\x91\xdf\x2f\xe5\x5c\xce\xb9\x92\x73\x35\x67\x1c\xca\xf5\x73" "\xb6\x72\x4e\xe4\x5c\xca\xb9\x9c\x73\x25\xe7\x6a\xce\xa8\xe5\xfa\x39\x5b" "\x39\x27\x72\x2e\xe5\x5c\xce\xb9\x92\x73\x35\x67\x1c\x90\xb9\x7b\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xc3\xa5\xa8\xfe\x49" "\xf1\xcd\xaf\xad\xa5\xf5\x81\xee\xfa\xd2\x13\xd1\xcd\x15\xeb\x81\x3e\xf4" "\x7e\x11\x00\x00\xff\xff\x72\x3b\xf4\x3e", 3160); syz_mount_image(/*fs=*/0x200000000f40, /*dir=*/0x200000000f80, /*flags=*/0, /*opts=*/0x200000002480, /*chdir=*/1, /*size=*/0xc58, /*img=*/0x2000000000c0); // mmap arguments: [ // addr: VMA[0xc00000] // len: len = 0xc00000 (4 bytes) // prot: mmap_prot = 0x0 (8 bytes) // flags: mmap_flags = 0x3032 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall(__NR_mmap, /*addr=*/0x200000001000ul, /*len=*/0xc00000, /*prot=*/0ul, /*flags=MAP_LOCKED|MAP_FIXED|MAP_EXECUTABLE|0x22*/ 0x3032ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {6d 65 6d 6f 72 79 2e 63 75 72 72 65 6e 74 00} (length 0xf) // } // flags: const = 0x275a (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x200000000080, "memory.current\000", 15); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000080ul, /*flags=*/0x275a, /*mode=*/0); if (res != -1) r[0] = res; // write$binfmt_script arguments: [ // fd: fd_binfmt (resource) // data: ptr[in, binfmt_script] { // binfmt_script { // hdr: buffer: {23 21 20} (length 0x3) // bin: buffer: {} (length 0x0) // args: array[binfmt_script_arg] { // } // nl: const = 0xa (1 bytes) // data: buffer: {} (length 0x0) // } // } // len: bytesize = 0x208e24b (8 bytes) // ] memcpy((void*)0x2000000004c0, "#! ", 3); *(uint8_t*)0x2000000004c3 = 0xa; syscall(__NR_write, /*fd=*/r[0], /*data=*/0x2000000004c0ul, /*len=*/0x208e24bul); // ftruncate arguments: [ // fd: fd (resource) // len: intptr = 0xc00 (8 bytes) // ] syscall(__NR_ftruncate, /*fd=*/r[0], /*len=*/0xc00ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*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=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; loop(); return 0; }