// https://syzkaller.appspot.com/bug?id=29047010c8fc6106059964efd51ff4f88f3b46ba // 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; } } } 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 30 00} (length 0x8) // } // flags: mount_flags = 0x14440 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // chdir: int8 = 0x2 (1 bytes) // size: len = 0xc3f (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0xc3f) // } // ] // returns fd_dir memcpy((void*)0x200000000080, "udf\000", 4); memcpy((void*)0x200000000180, "./file0\000", 8); memcpy( (void*)0x200000001780, "\x78\x9c\xec\xdd\x4f\x6c\x1c\xd7\x7d\x07\xf0\xdf\x1b\x2d\xc5\xa5\xdc\x56" "\x4c\xec\x28\x4e\x1a\x17\x9b\xb6\x48\x65\xc5\x72\xf5\x2f\xa6\x62\x15\xee" "\xaa\xa6\xd9\x06\x90\x65\x21\x14\x73\x0b\xc0\x95\x48\xa9\x0b\x53\x24\x41" "\x52\x8d\x6c\xa4\x05\xd3\x4b\x0f\x3d\x04\x28\x8a\x1e\x72\x22\xd0\x1a\x05" "\x52\x34\x30\x9a\x22\xe8\x91\x69\x5d\x20\xb9\xf8\x50\xe4\xd4\x13\xd1\xc2" "\x46\x50\xf4\xc0\x16\x01\x72\x0a\x18\xcc\xec\x5b\x71\x45\x91\x36\x2d\xfe" "\x11\x65\x7d\x3e\xb6\xf8\xdd\x9d\x7d\x6f\xe6\xbd\x79\xeb\x19\x59\xd0\x9b" "\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\xc4\x1f\xbc" "\x72\xf1\xd4\xe9\xf4\xb0\x5b\x01\x00\xec\xa7\xcb\xa3\x5f\x3d\x75\xc6\xfd" "\x1f\x00\x1e\x2b\x57\xfd\xff\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x1c\x74\x29\x8a\x78\x32\x52\xcc\x5e\x5e\x4d\xe3\xd5\xfb\x8e\xfa\xa5" "\x76\xdf\xed\x3b\x63\xc3\x23\x9b\x57\x1b\x48\x55\xcd\x43\x55\xf9\xf2\x57" "\xfd\xf4\x99\xb3\xe7\xbe\xf4\xc2\xd0\xf9\x6e\x5e\x6a\x4f\x7f\x40\xfd\xdd" "\xf6\xd9\x78\x6d\xf4\xea\xc5\xc6\xcb\x33\xb7\x66\xe7\x26\xe7\xe7\x27\x27" "\x1a\x63\xd3\xed\xeb\x33\x13\x93\xdb\xde\xc3\x4e\xeb\x6f\x74\xa2\x3a\x01" "\x8d\x5b\xaf\xdf\x9e\xb8\x71\x63\xbe\x71\xe6\xf9\xb3\xf7\x7c\x7c\x67\xf0" "\xfd\xfe\x27\x8e\x0d\x5e\x18\x7a\xf6\xe4\x33\xdd\xb2\x63\xc3\x23\x23\xa3" "\xeb\x45\xea\xbd\xe5\x6b\x0f\xdc\x90\x8e\xad\x66\x78\x1c\x8e\x22\x4e\x46" "\x8a\xe7\xbe\xf7\xd3\xd4\x8a\x88\x22\x76\x7e\x2e\xea\xfb\x3b\xf6\x1b\x0d" "\x54\x9d\x38\x51\x75\x62\x6c\x78\xa4\xea\xc8\x54\xbb\x35\xbd\x50\x7e\x78" "\xa5\x7b\x22\x8a\x88\x46\x4f\xa5\x66\xf7\x1c\x6d\x3e\x16\x51\xeb\xdb\xd7" "\x3e\x6c\xad\x19\xb1\x58\x36\xbf\x6c\xf0\x89\xb2\x7b\xa3\xb3\xad\xb9\xd6" "\xb5\xa9\xc9\xc6\x95\xd6\xdc\x42\x7b\xa1\x3d\x33\x7d\x25\x75\x5a\x5b\xf6" "\xa7\x11\x45\x9c\x4f\x11\x4b\x11\xb1\xd2\x7f\xff\xee\xfa\xa2\x88\x5a\xa4" "\xf8\xce\xd1\xd5\x74\x2d\x22\x0e\x75\xcf\xc3\x17\xab\x89\xc1\x5b\xb7\xa3" "\xd8\xc3\x3e\x6e\x43\xd9\xce\x46\x5f\xc4\x52\xf1\x08\x8c\xd9\x01\xd6\x1f" "\x45\xbc\x1a\x29\x7e\xf6\xce\xf1\xb8\x9e\xaf\x33\xd5\xb5\xe6\x0b\x11\xaf" "\x96\xf9\x83\x88\xb7\xca\x7c\x29\x22\x95\x5f\x8c\x73\x11\xef\x6d\xf2\x3d" "\xe2\xd1\x54\x8b\x22\xfe\xb2\x1c\xff\x0b\xab\x69\xa2\xba\x1e\x74\xaf\x2b" "\x97\xbe\xd6\xf8\xca\xf4\x8d\x99\x9e\xb2\xdd\xeb\xca\x47\xbc\x3f\xdc\x77" "\xa5\x78\x48\xf7\x87\x81\x0d\xb9\x3f\xee\xbb\x36\x1d\xad\x7e\x1e\x94\x6b" "\x53\x3d\x8a\x68\x55\x57\xfc\xd5\xf4\xe0\xbf\xd9\x01\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x60\xb7\x0d\x44\x11\x9f\x89\x14\xaf\xfc\xc7" "\x9f\x54\xf3\x8a\xa3\x9a\x97\x7e\xf4\xc2\xd0\x1f\x0e\xfe\x6a\xef\x9c\xf1" "\xa7\x3f\x64\x3f\x65\xd9\xe7\x23\x62\xb1\xd8\xde\x9c\xdc\xc3\x79\x62\xe0" "\x95\x74\x25\xa5\x87\x3c\x97\xf8\x71\x56\x8f\x22\xfe\x34\xcf\xff\xfb\xd6" "\xc3\x6e\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0" "\x63\xad\x88\x9f\x44\x8a\x17\xdf\x3d\x9e\x96\xa2\x77\x4d\xf1\xf6\xf4\xcd" "\xc6\xd5\xd6\xb5\xa9\xce\xaa\xb0\xdd\xb5\x7f\xbb\x6b\xa6\xaf\xad\xad\xad" "\x35\x52\x27\x9b\x39\xc7\x73\x2e\xe6\x5c\xca\xb9\x9c\x73\x25\x67\x14\xb9" "\x7e\xce\x66\xce\xf1\x9c\x8b\x39\x97\x72\x2e\xe7\x5c\xc9\x19\x87\x72\xfd" "\x9c\xcd\x9c\xe3\x39\x17\x73\x2e\xe5\x5c\xce\xb9\x92\x33\x6a\xb9\x7e\xce" "\x66\xce\xf1\x9c\x8b\x39\x97\x72\x2e\xe7\x5c\xc9\x19\x07\x64\xed\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\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x8f\x93\x22\x8a\xf8\x45\xa4\xf8" "\xf6\x37\x56\x53\xa4\x88\x68\x46\x8c\x47\x27\x97\xfb\x1f\x76\xeb\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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" "\x52\x7f\x2a\xe2\xfb\x91\xa2\xf1\x47\xcd\xbb\xdb\x6a\x11\x91\xaa\x7f\x3b" "\x8e\x97\x3f\xce\x45\xf3\x70\x99\x9f\x8c\xe6\x50\x99\x2f\x45\xf3\x62\xce" "\x56\x95\xb5\xe6\xb7\x1e\x42\xfb\xd9\x99\xbe\x54\xc4\x8f\x23\x45\x7f\xfd" "\xed\xbb\x03\x9e\xc7\xbf\xaf\xf3\xee\xee\xd7\x20\xde\xfa\xe6\xfa\xbb\xcf" "\xd6\x3a\x79\xa8\xfb\xe1\xe0\xfb\xfd\x4f\x1c\x3b\x7a\x61\x68\xe4\x37\x9e" "\xde\xea\x75\xda\xac\x01\x27\x2e\xb5\xa7\x6f\xdf\x69\x8c\x0d\x8f\x8c\x8c" "\xf6\x6c\xae\xe5\xa3\x7f\xb2\x67\xdb\x60\x3e\x6e\xb1\x3b\x5d\x27\x22\xe6" "\xdf\x78\xf3\xf5\xd6\xd4\xd4\xe4\xdc\x83\xbf\x28\xbf\x02\x0f\x52\xbd\x1c" "\xe1\x9d\x1f\x7d\x3f\x5f\xa4\xda\x83\xf5\xd4\x8b\x47\xf4\x45\xd4\x0e\x44" "\x33\x1e\x4e\xdf\x79\x0c\x94\xf7\xff\xf7\x22\xc5\xef\xbe\xfb\x9f\xdd\x1b" "\x7e\xe7\xfe\x5f\x8f\x5f\xe9\xbc\xbb\x7b\x87\x8f\x9f\xff\xd9\xfa\xfd\xff" "\xc5\x8d\x3b\xda\xe6\xfd\xbf\xb6\xb1\x5e\xbe\xff\x97\xf7\xf4\xcd\xee\xff" "\x4f\xf6\x6c\x7b\x31\xff\x6e\xa4\xaf\x16\x51\x5f\xb8\x35\xdb\x77\x2c\xa2" "\x3e\xff\xc6\x9b\x27\xdb\xb7\x5a\x37\x27\x6f\x4e\x4e\x9f\x3b\x75\xea\xcb" "\x43\x43\x5f\x3e\x7b\xaa\xef\x70\x44\xfd\x46\x7b\x6a\xb2\xe7\xd5\xae\x9c" "\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xfd\x93\x8a\xf8" "\xfd\x48\xd1\xfa\xf1\x6a\x6a\x44\xc4\x9d\x6a\xbe\xd6\xe0\x85\xa1\x67\x4f" "\x3e\x73\x28\x0e\x55\xf3\xad\xee\x99\xb7\xfd\xda\xe8\xd5\x8b\x8d\x97\x67" "\x6e\xcd\xce\x4d\xce\xcf\x4f\x4e\x34\xc6\xa6\xdb\xd7\x67\x26\x26\xb7\x7b" "\xb8\x7a\x35\xdd\x6b\x6c\x78\x64\x4f\x3a\xf3\xa1\x06\xf6\xb8\xfd\x03\xf5" "\x97\x67\x66\xdf\x98\x6b\xdf\xfc\xe3\x85\x4d\x3f\x3f\x52\xbf\x78\x6d\x7e" "\x61\xae\x75\x7d\xf3\x8f\x63\x20\x8a\x88\x66\xef\x96\x13\x55\x83\xc7\x86" "\x47\xaa\x46\x4f\xb5\x5b\xd3\x55\xd5\x2b\x9b\x4e\xa6\xff\xe8\xfa\x52\x11" "\xff\x15\x29\xae\x9f\x6b\xa4\xcf\xe7\x6d\x79\xfe\xff\xc6\x19\xfe\xf7\xcc" "\xff\x5f\xdc\xb8\xa3\x3d\x9a\xff\xff\x89\x9e\x6d\xe5\x31\x53\x2a\xe2\xe7" "\x91\xe2\x77\xfe\xea\xe9\xf8\x7c\xd5\xce\x23\x71\xdf\x39\xcb\xe5\xfe\x2e" "\x52\x9c\x38\xff\xb9\x5c\x2e\x0e\x97\xe5\xba\x6d\xe8\x3c\x57\xa0\x33\x33" "\xb0\x2c\xfb\x7f\x91\xe2\x9f\x7e\x71\x6f\xd9\xee\x7c\xc8\x27\xd7\xcb\x9e" "\xde\xf6\x89\x7d\x44\x94\xe3\x7f\x34\x52\x7c\xff\x2f\xbe\x1b\xbf\x99\xb7" "\xdd\xfb\xfc\x87\xcd\xc7\xff\xc8\xc6\x1d\xed\xd1\xf8\x3f\xd5\xb3\xed\xc8" "\x3d\xcf\x2b\xd8\x71\xd7\xc9\xe3\x7f\x32\x52\xbc\xf4\xe4\xdb\xf1\x5b\x79" "\xdb\x07\x3d\xff\xa3\xfb\xec\x8d\xe3\xb9\xf0\xdd\xe7\x73\xec\xd1\xf8\x7f" "\xaa\x67\xdb\x60\x3e\xee\x6f\xef\x4e\xd7\x01\x00\x00\x00\x00\x00\x00\x00" "\x00\x1e\x69\x7d\xa9\x88\xbf\x8f\x14\x3f\x1c\xa9\xa5\x17\xf2\xb6\xed\xfc" "\xfd\xbf\x89\x8d\x3b\xda\xa3\xbf\xff\xf5\xe9\x9e\x6d\x13\xbb\xb3\x5e\xd1" "\x87\xbe\xd8\xf1\x49\x05\x00\x00\x00\x80\x03\xa2\x2f\x15\xf1\x93\x48\x71" "\x73\xe1\xed\xbb\x73\xa8\xef\x9d\xff\xdd\x33\xff\xf3\xf7\xd6\xe7\x7f\x0e" "\xa7\x0d\x9f\x56\x7f\xce\xf7\x6b\xd5\x73\x03\x76\xf3\xcf\xff\x7a\x0d\xe6" "\xe3\x8e\xef\xbc\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x70\xa0\xa4\x54\xc4\x0b\x79\x3d\xf5\xf1\x6a\x3e\xff\xc4\x96\xeb" "\xa9\x2f\x47\x8a\x57\xfe\xe7\xb9\x5c\x2e\x1d\x2b\xcb\x75\xd7\x81\x1f\xac" "\x7e\xd6\x2f\xcf\x4c\x9f\xbc\x38\x35\x35\x73\xbd\xb5\xd0\xba\x36\x35\xd9" "\x18\x9d\x6d\x5d\x9f\x2c\xeb\x3e\x15\x29\x56\xff\xf6\x73\xb9\x6e\x51\xad" "\xaf\xde\x5d\x6f\xbe\xb3\xc6\xfb\xfa\x5a\xec\x73\x91\x62\xe4\x1f\xba\x65" "\x3b\x6b\xb1\x77\xd7\x26\x7f\x6a\xbd\xec\xe9\xb2\xec\x27\x22\xc5\x7f\xff" "\xe3\xbd\x65\xbb\xeb\x58\x7f\x6a\xbd\xec\x99\xb2\xec\xdf\x44\x8a\xaf\xff" "\xcb\xe6\x65\x8f\xad\x97\x3d\x5b\x96\xfd\x6e\xa4\xf8\xd1\xd7\x1b\xdd\xb2" "\x47\xca\xb2\xdd\xe7\xa3\x7e\x7a\xbd\xec\xf3\xd7\x67\x8a\x3d\x18\x15\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x37\x7d\xa9" "\x88\x3f\x8f\x14\xff\x7b\x6b\xe9\xee\x5c\xfe\xbc\xfe\x7f\x5f\xcf\xdb\xca" "\x5b\xdf\xec\x59\xef\x7f\x83\x3b\xd5\x3a\xff\x83\xd5\xfa\xff\x5b\xbd\x7e" "\x90\xf5\xff\xab\xe7\x0a\x2c\x6e\x75\x54\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x78\x4a\x51\xc4\x9b\x91\x62\xf6" "\xf2\x6a\x5a\xee\x2f\xdf\x77\xd4\x2f\xb5\xa7\x6f\xdf\x19\x1b\x1e\xd9\xbc" "\xda\x40\xaa\x6a\x1e\xaa\xca\x97\xbf\xea\xa7\xcf\x9c\x3d\xf7\xa5\x17\x86" "\xce\x77\xf3\x83\xeb\xef\xb6\xcf\xc4\x6b\xa3\x57\x2f\x36\x5e\x9e\xb9\x35" "\x3b\x37\x39\x3f\x3f\x39\xd1\x18\x9b\x6e\x5f\x9f\x99\x98\xdc\xf6\x1e\x76" "\x5a\x7f\xa3\x13\xd5\x09\x68\xdc\x7a\xfd\xf6\xc4\x8d\x1b\xf3\x8d\x33\xcf" "\x9f\xbd\xe7\xe3\x3b\x83\xef\xf7\x3f\x71\x6c\xf0\xc2\xd0\xb3\x27\x9f\xe9" "\x96\x1d\x1b\x1e\x19\x19\xed\x29\x53\xeb\x7b\xe0\xa3\xdf\x27\x6d\xb1\xfd" "\x70\x14\xf1\xd7\x91\xe2\xb9\xef\xfd\x34\xfd\xb0\x3f\xa2\x88\x9d\x9f\x8b" "\xfb\xbe\x3b\xbb\xd8\x8f\x6d\x18\xa8\x3a\x71\xa2\xea\xc4\xd8\xf0\x48\xd5" "\x91\xa9\x76\x6b\x7a\xa1\xfc\xf0\x4a\xf7\x44\x14\x11\x8d\x9e\x4a\xcd\xee" "\x39\xda\x87\xb1\xd8\x91\x66\xc4\x62\xd9\xfc\xb2\xc1\x27\xca\xee\x8d\xce" "\xb6\xe6\x5a\xd7\xa6\x26\x1b\x57\x5a\x73\x0b\xed\x85\xf6\xcc\xf4\x95\xd4" "\x69\x6d\xd9\x9f\x46\x14\x71\x3e\x45\x2c\x45\xc4\x4a\xff\xfd\xbb\xeb\x8b" "\x22\x5e\x8f\x14\xdf\x39\xba\x9a\xfe\xb5\x3f\xe2\x50\xf7\x3c\x7c\xf1\xf2" "\xe8\x57\x4f\x9d\xd9\xba\x1d\xc5\x1e\xf6\x71\x1b\xca\x76\x36\xfa\x22\x96" "\x8a\x47\x60\xcc\x0e\xb0\xfe\x28\xe2\x9f\x23\xc5\xcf\xde\x39\x1e\xff\xd6" "\x1f\x51\x8b\xce\xaf\xf8\x42\xc4\xab\x65\xfe\x20\xe2\xad\xe8\x8c\x77\x2a" "\xbf\x18\xe7\x22\xde\xdb\xe4\x7b\xc4\xa3\xa9\x16\x45\xfc\x7f\x39\xfe\x17" "\x56\xd3\x3b\xfd\xf9\x52\x5d\x5d\x57\x2e\x7d\xad\xf1\x95\xe9\x1b\x33\x3d" "\x65\xbb\xd7\x95\x5d\xbf\x3f\xec\xaf\x81\x7d\x3d\xda\x01\xbf\x36\xd5\xa3" "\x88\x1f\x55\x57\xfc\xd5\xf4\xef\xfe\xbb\x06\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x38\x40\x8a\xf8\xf5\x48\xf1\xe2\xbb\xc7\x53\x35\x3f" "\xf8\xee\x9c\xe2\xf6\xf4\xcd\xc6\xd5\xd6\xb5\xa9\xce\xb4\xbe\xee\xdc\xbf" "\xee\x9c\xe9\xb5\xb5\xb5\xb5\x46\xea\x64\x33\xe7\x78\xce\xc5\x9c\x4b\x39" "\x97\x73\xae\xe4\x8c\x22\xd7\xcf\xd9\x2c\xb3\xbe\xb6\x36\x9e\xdf\x2f\xe6" "\x5c\xca\xb9\x9c\x73\x25\x67\x1c\xca\xf5\x73\x36\x73\x8e\xe7\x5c\xcc\xb9" "\x94\x73\x39\xe7\x4a\xce\xa8\xe5\xfa\x39\x9b\x39\xc7\x73\x2e\xe6\x5c\xca" "\xb9\x9c\x73\x25\xe7\x3e\xcf\x67\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x1e\x13\x45\xf5\x4f\x8a\x6f\x7f\x63\x35\xad\xf5\x77" "\xd6\x97\x1e\x8f\x4e\x2e\x5b\x0f\xf4\x63\xef\x97\x01\x00\x00\xff\xff\x1a" "\x71\xf7\x0e", 3135); syz_mount_image(/*fs=*/0x200000000080, /*dir=*/0x200000000180, /*flags=MS_POSIXACL|MS_REC|MS_NOATIME|MS_MANDLOCK*/ 0x14440, /*opts=*/0x200000003580, /*chdir=*/2, /*size=*/0xc3f, /*img=*/0x200000001780); // open arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // flags: open_flags = 0x62142 (8 bytes) // mode: open_mode = 0x0 (8 bytes) // ] // returns fd memcpy((void*)0x200000000080, "./bus\000", 6); res = syscall( __NR_open, /*file=*/0x200000000080ul, /*flags=O_NOFOLLOW|O_NOCTTY|O_NOATIME|O_CREAT|FASYNC|0x2*/ 0x62142ul, /*mode=*/0ul); if (res != -1) r[0] = res; // setrlimit arguments: [ // res: rlimit_type = 0x1 (8 bytes) // rlim: ptr[in, rlimit] { // rlimit { // soft: intptr = 0xffffffffffffffff (8 bytes) // hard: intptr = 0xffffffffffffffff (8 bytes) // } // } // ] *(uint64_t*)0x200000000100 = -1; *(uint64_t*)0x200000000108 = -1; syscall(__NR_setrlimit, /*res=RLIMIT_FSIZE*/ 1ul, /*rlim=*/0x200000000100ul); // pwrite64 arguments: [ // fd: fd (resource) // buf: ptr[in, buffer] { // buffer: {5f} (length 0x1) // } // count: len = 0x10000000 (8 bytes) // pos: intptr = 0x10000000005 (8 bytes) // ] memset((void*)0x200000000300, 95, 1); syscall(__NR_pwrite64, /*fd=*/r[0], /*buf=*/0x200000000300ul, /*count=*/0x10000000ul, /*pos=*/0x10000000005ul); } 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; }