// https://syzkaller.appspot.com/bug?id=b30ea69cb87bce1089eefd3969b308f63c4e218c // 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, 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 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, loopfd = -1, 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) { memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; 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"); } 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) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } 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 (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[4] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; memcpy((void*)0x20000740, "ext4\000", 5); memcpy((void*)0x20000040, "./bus\000", 6); memcpy((void*)0x20000440, "\x00\x89\xf2\x83\x27\x30\xbf\x99\x4f\x58\x98\x85\xcc\x76\x9f\xe9\xff" "\x0f\x61\xf4\x7a\xbe\xbb\xde\x12\xc3\x89\x3a\x1a\xc5\xd0\x14\x9b\xa2" "\x12\x07\x00\x00\x00\x00\x00\x00\x97\x98\x98\xc9\x4e\x05\x6c\x08\x50" "\x98\x0a\x00\x83\xcf\xe8\xb4\xef\xdc\x8e\xc3\x00\x00\x00\x00\xf2\x93" "\x5e\x17\x62\x97\xb1\x08\x4a\x51\xbd\x8f\x96\x8f\x05\xa5\xd6\x57\x83" "\x2f\xf1\x43\x1d\x56\x21\x36\xb4\xda\x36\xa1\x17\xf7\x75\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xbb\xa7\xdc\x7f\x1f\xe8\x94\xc6\xca\x54\x9f" "\x3b\x7a\x65\x8a\xbe\xa8\xd9\xa9\x77\x46\x73\xbe\xbd", 132); memcpy( (void*)0x200004c4, "\x2b\x9d\x87\x72\x67\x63\x39\x98\xe6\xf1\x53\x32\xe0\x19\x77\x1a\xdf\xd1" "\xeb\x9a\xd7\xcd\x34\x27\x09\x6d\x48\xec\x25\x12\x50\x01\x82\x76\x82\x09" "\xbe\x6f\x9b\xd3\x4b\x50\x98\x8c\x8d\xc0\x91\xa1\x9a\x48\xbc\xc6\x1b\x91" "\x57\x26\x8f\xd7\xc8\x5a\x4d\xa9\x80\xe6\x80\x86\xa8\xb5\x0b", 69); memcpy( (void*)0x20001640, "\x78\x9c\xec\xdc\xcf\x6b\x1c\x75\x1f\x07\xf0\xcf\x4c\xb3\xfd\x99\xe7\xd9" "\x3c\xf0\x1c\x9e\xc7\x83\x08\x2d\xb4\x50\x3a\x49\x9a\x4b\x7b\x32\x5e\xc4" "\x4b\xa1\x50\xf0\x5a\x43\x32\x09\x21\x93\x6c\xc9\x6e\x6a\x13\x0b\x6d\x3d" "\x0b\xb5\xb9\x28\x08\xa2\x77\x8f\x5e\x85\x52\xff\x00\x6f\x52\x50\xf0\x2e" "\x88\xd6\x78\x10\x2f\x91\xd9\x6c\xb6\x6d\xba\xbb\x6e\xdb\x24\x2b\xf1\xf5" "\x82\xe9\x7e\xbf\xf3\x63\xdf\xdf\xcf\x76\xf2\xcd\x0c\x64\x36\x80\x7f\xac" "\xd7\xca\x7f\x92\x88\xe1\x88\xb8\x1c\x11\xd5\xd6\xfa\x34\x22\x0e\x37\x5b" "\x47\x23\x6e\x6f\xed\xb7\xf1\xe8\xe6\x74\xb9\x24\xb1\xb9\x79\xe5\xe7\xa4" "\x3c\x2c\x36\x36\xab\xed\xf7\x4a\x5a\xaf\x27\xa2\x79\x48\xfc\x2f\x22\x1e" "\x54\x22\xce\xbe\xff\x6c\x6e\x7d\x75\x6d\x61\xaa\x28\xf2\xe5\x56\x7f\xb4" "\xb1\x78\x6d\xb4\xbe\xba\x76\x6e\x7e\x71\x6a\x2e\x9f\xcb\x97\xc6\x27\x2e" "\x8e\x5d\x98\x98\xb8\x30\x36\xb1\x6b\xb5\x9e\x7a\xfb\xe2\xb1\x7b\xdf\xbc" "\xb9\xbe\xfe\xed\x97\x8d\xbb\xaf\x0e\x9d\x4b\x62\xb2\x59\x77\xb4\x6a\xdb" "\xb5\xa0\x27\x6c\x7d\x26\x95\x98\xdc\xb1\x7e\x69\x2f\xc2\x06\x28\xe9\x63" "\x9f\xa1\x7d\x18\x07\x00\x00\xbd\x95\xd7\xf9\x87\x5a\xd7\x66\x95\xa8\xc6" "\x21\x57\x69\x00\x00\x00\x70\xe0\x6c\x1e\xd9\x04\x00\x00\x00\x0e\xbc\x24" "\x06\x3d\x02\x00\x00\x00\x60\x6f\x6d\xff\x1d\xc0\xf6\xb3\xbd\x7b\xf5\x1c" "\x6c\x37\x3f\xbd\x11\x11\x23\x9d\xf2\x87\x9a\xcf\x10\x47\x1c\x8d\x4a\x44" "\x1c\xdf\x48\x9e\x7a\x32\x21\xd9\x3a\x0c\x5e\xca\xed\x3b\x11\x71\x7f\xb2" "\xc3\xf9\x97\xb4\xce\xbf\x17\x37\xb6\xa3\xdf\xcf\x33\xd2\xec\xaf\xfb\xe5" "\xfc\x33\xd9\x69\xfe\x49\xdb\xf3\x4f\x74\x98\x7f\x86\xb6\xbf\x3b\xe1\x25" "\x75\x9f\xff\x1e\xe7\x1f\xea\x32\xff\x5d\xee\x33\xe3\xab\x4f\xff\x5f\xe9" "\x9a\x7f\x27\xe2\x95\xa1\x4e\xf9\x49\x3b\x3f\xe9\x92\xff\x4e\x9f\xf9\x77" "\xd7\x3f\xb8\xd7\x6d\xdb\xe6\xe7\x11\xa7\x3b\xfe\xfe\x49\x9e\xca\xea\xf1" "\xfd\x10\xa3\xb3\xf3\x45\xcf\x1f\xad\x07\x7f\x9c\x79\xd8\xab\xfe\xe3\xcf" "\xe4\x27\x49\x33\x35\xe9\x5d\xff\xb5\x3e\xeb\x7f\x6f\xe3\xd7\x85\x6e\x73" "\x49\x99\x7f\xe6\x64\xef\xff\xff\x4e\xf9\xe5\x39\xf1\x61\x6b\x1c\x69\x44" "\xdc\x6b\xbd\x96\xfd\xf5\x1d\x19\x27\x17\xbf\xfb\xfa\xd9\xe4\xe4\xf6\x76" "\xfe\x4c\x97\xcf\xbf\x73\xfe\x5b\xed\xfa\x3f\xeb\xb3\xfe\x1f\xbe\x38\x72" "\xa3\xcf\x5d\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\xa0\x29\x8d\x88\xe1\x48" "\xd2\xac\xdd\x4e\xd3\x2c\x8b\x38\x11\x11\xff\x8d\xe3\x69\x51\xab\x37\xce" "\xce\xd6\x56\x96\x66\xca\x6d\x11\x23\x51\x49\x67\xe7\x8b\x7c\x2c\x22\xaa" "\x5b\xfd\xa4\xec\x8f\x37\xdb\x8f\xfb\xe7\x77\xf4\x27\x22\xe2\x3f\xdf\x1f" "\xdb\x0a\x9d\x2f\xf2\x6c\xba\x56\xcc\x0c\xba\x78\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xda\x4e\x44\xc4\x70\x24\x69\x16\x11\x69\x44\xfc\x56\x4d\xd3" "\x2c\x1b\xf4\xa8\x00\x00\x00\x80\x5d\x37\x32\xe8\x01\x00\x00\x00\x00\x7b" "\xce\xfd\x3f\x00\x00\x00\x1c\x7c\x2f\x7a\xff\x9f\xec\xf2\x38\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\x03\xed\xf2\xa5\x4b\xe5\xb2\xb9\xf1\xe8\xe6\x74\xd9\x9f" "\xb9\xbe\xba\xb2\x50\xbb\x7e\x6e\x26\xaf\x2f\x64\x8b\x2b\xd3\xd9\x74\x6d" "\xf9\x5a\x36\x57\xab\xcd\x15\x79\x36\x5d\x5b\xfc\xab\xf7\x4b\x23\x62\xfc" "\x62\xac\xdc\x18\x6d\xe4\xf5\xc6\x68\x7d\x75\xed\xea\x62\x6d\x65\xa9\x71" "\x75\x7e\x71\x6a\x2e\xbf\x9a\x57\xf6\xa5\x2a\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x9e\xd7\x70\x73\x49\xd2\x2c\x22\xd2\x66\x3b\x4d\xb3\x2c\xe2\x5f" "\x11\x31\x12\x95\x64\x76\xbe\xc8\xc7\x22\xe2\xdf\x11\xf1\xb0\x5a\x39\x52" "\xf6\xc7\x07\x3d\x68\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x76\x5d\x7d\x75" "\x6d\x61\xaa\x28\xf2\x65\x0d\x0d\x8d\x7d\x6b\xdc\x8a\x88\xbf\xc1\x30\x7a" "\x34\x06\x3d\x33\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\x30\x08\xf5\xd5\xb5\x85" "\xa9\xa2\xc8\x97\xeb\x83\x1e\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x83" "\x95\xfe\x98\x44\x44\xb9\x9c\xae\x9e\x1a\xde\xb9\xf5\x70\xf2\x7b\xb5\xf9" "\x1a\x11\xef\x7e\x72\xe5\xa3\x1b\x53\x8d\xc6\xf2\x78\xb9\xfe\x97\xf6\xfa" "\xc6\xc7\xad\xf5\xe7\x9f\x38\xf0\xd6\x7e\xd6\x00\x00\x00\x00\x07\xde\xeb" "\xcf\xb3\xf3\xf6\x7d\xfa\xf6\x7d\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\xbf\xea\xab\x6b\x0b\x53\x45\x91\x2f\xef\x61\x23" "\xee\x0c\xba\x4a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xe0\x45\xfc\x19\x00\x00\xff\xff\x2d\x73\xc5" "\xe7", 1872); syz_mount_image(0x20000740, 0x20000040, 0x2200088, 0x20000440, 1, 0x750, 0x20001640); memcpy((void*)0x20000080, "./file0\000", 8); syscall(__NR_chdir, 0x20000080ul); memcpy((void*)0x20000000, "./bus\000", 6); res = syscall(__NR_openat, 0xffffff9c, 0x20000000ul, 0x40ul, 0ul); if (res != -1) r[0] = res; memcpy((void*)0x20004400, "./bus\000", 6); res = syscall(__NR_openat, 0xffffff9c, 0x20004400ul, 0x141002ul, 0ul); if (res != -1) r[1] = res; *(uint64_t*)0x200003c0 = 0x200001c0; memcpy((void*)0x200001c0, "\x3d\xf8\x7a\xdc\xd3\x23\xaa\xe8\x9c\xf0\x0a\xe1\xe9\x25\x77\x89\x55" "\x03\x18\x79\x23\xe4\x7c\xc0\x7d\xf6\xf0\xaa\x44\x82\x16\xf1\x51\x93" "\xf4\x5e\xf1\x89\xef\x6a\x4e\xf7\x3e\x0f\x02\xcd\x53\x57\x7e\xcd\x73" "\x88\xf7\x15\xe9\xe1\xe6\x60\x27\x20\x5a\xf7\x48\x81\xf1\xeb\x1b\xb9" "\xe5\xf8\x31\xf8\x6e\x52\x32\xfb\x5d\x16\x9c\x39\x1b\x7e\x47\x7a\xbf" "\x08\xe6\x27\x20\x10\x2f\x57\xf0\xf5\x92\xcd\x60\x38\xf8\x34\xea\x75" "\x00\xff\x77\x43\x7d\xf8\xda\x72\xb4\x4d\x41\xa1\x1e\x34\xf7\x96\xce" "\xe9\x34\xe4\x59\x3f\xc6\x25\xa8\x24\x58\x5d\xb4\xde\x53\x7b\x5e\xc1" "\x30\x9f\x80\xea\x26\x96\x96\x56\x9f\x55\xcf\xf5\xb9\x33\x20\xed\x27" "\x43\x53\x6e\xa2\xa9\xa4\x2e\xa5\xdf\x9f\xaf\x85\xc0\xaf\x95\xeb\xa4" "\xd8\x55\xde\x29\xb4\x07\x32\x52\x60\xfb", 180); *(uint64_t*)0x200003c8 = 0xb4; *(uint64_t*)0x200003d0 = 0x20000280; memcpy((void*)0x20000280, "\x15\xe1\x62\x13\xf8\x62\x07\x2c\xd6\xf2\x8b\x79\x05\x83\xf4\x7a\x9e" "\xee\xe3\x71\x75\xbf\x8b\xcf\x74\x13\xb9\x76\xcf\x48\x7e\x5d\xaa\x30" "\x01\x52\xe4\x43\x61\x33\xec\xd3\x50\x7b\xb4\x51\x53\x67\x50\x2a\x21" "\x90\xb9\x04\xbf\xf5\x05\xf3\x12\xf1\xe6\x63\x10\xbe\x22\x09\x1e\x30" "\x89\x7c\x5d\xef\x53\xe6\x57\x92\x92\xf9\xd6\x7d\x39\x1d\x44\xdb\x36" "\x2c\x9d\x3b\xc9\x76\x9a\xa5\xd1\xd6\x9d\xe1\xfd\x08\x9c\xeb\x3f\x04" "\xaa\x1a\x17\x39\x24\x50\x37\x76\xb2\xed\xfd\xe8\x7c\x6d\x38\x8a\x29" "\x32\x6f\x1d\x73\xa6\x99\x85\x10\x9d\xe9", 129); *(uint64_t*)0x200003d8 = 0x81; *(uint64_t*)0x200003e0 = 0; *(uint64_t*)0x200003e8 = 0; *(uint64_t*)0x200003f0 = 0; *(uint64_t*)0x200003f8 = 0; *(uint64_t*)0x20000400 = 0; *(uint64_t*)0x20000408 = 0; syscall(__NR_writev, r[1], 0x200003c0ul, 5ul); syscall(__NR_sendfile, r[1], r[0], 0ul, 0x1fffful); memcpy((void*)0x20000380, "/dev/loop", 9); *(uint8_t*)0x20000389 = 0x30; *(uint8_t*)0x2000038a = 0; memcpy((void*)0x20000180, "./bus\000", 6); syscall(__NR_mount, 0x20000380ul, 0x20000180ul, 0ul, 0x1000ul, 0ul); memcpy((void*)0x20000100, "./bus\000", 6); res = syscall(__NR_openat, 0xffffff9c, 0x20000100ul, 0ul, 0ul); if (res != -1) r[2] = res; memcpy((void*)0x20004400, "./bus\000", 6); res = syscall(__NR_openat, 0xffffff9c, 0x20004400ul, 0x141002ul, 0ul); if (res != -1) r[3] = res; memset((void*)0x20004200, 116, 1); syscall(__NR_write, r[3], 0x20004200ul, 1ul); syscall(__NR_sendfile, r[3], r[2], 0ul, 0x1fffful); } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); loop(); return 0; }