// https://syzkaller.appspot.com/bug?id=765dcdaddb229eb55bde4d7fb85b812e5e5b776b // 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"); } 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)) { } memcpy((void*)0x2000000002c0, "udf\000", 4); memcpy((void*)0x200000000080, "./file0\000", 8); memcpy( (void*)0x200000001500, "\x78\x9c\xec\xdd\x5f\x6c\x1d\x57\x5a\x00\xf0\xef\x8c\xed\xd8\x49\xd1\xee" "\xa5\xdb\xa4\xdd\xa5\x5a\xdd\x16\xa9\x1b\xb2\x6c\xb0\x9d\x6d\xd3\xca\x2b" "\xd1\x50\x63\xb1\x6c\xb6\x35\x75\xbc\x0b\x94\x87\xde\xc4\x4e\xb8\xc4\xb9" "\xbe\xb2\x9d\x6e\x5a\xc1\x6e\x78\xea\x03\x48\x98\x45\xe2\x85\x45\x42\x42" "\x8b\x2a\x1e\x56\x46\x68\x1f\xe0\x69\x91\x90\x78\xb5\xd0\xbe\x21\xa4\xb0" "\x2c\xa5\x08\x21\xdd\x87\xad\xfa\x82\x6a\x34\x73\xcf\x8d\xaf\x1d\xa7\x09" "\x75\x1c\xe7\xcf\xef\x27\x25\xdf\xdc\x99\xef\xcc\x9c\x39\x67\x32\x33\x77" "\xce\x1d\x25\x00\x00\x00\x00\x00\x00\x00\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\x88" "\x5f\xfa\xe5\x53\xa3\x63\x69\xbf\x6b\x01\x00\xdc\x4d\x2f\xcf\xbc\x3a\x3a" "\xee\xfa\x0f\x00\x0f\x95\x33\xbe\xff\x03\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xc0\xbd\x2e\x45\x11\xef\x45\x8a\x6f\x3c\xd9\x49\xaf\x57\x9f\xbb" "\x46\x4e\x37\x5b\x97\xaf\xcc\x4e\x4e\xed\x5c\xec\x60\xaa\x4a\x0e\x54\xf9" "\xe5\x9f\x91\xb1\xf1\x13\x5f\x7c\xf6\xb9\x93\xcf\xf7\xe2\x47\x97\xbf\xd3" "\x3e\x1d\xaf\xcc\x9c\x39\x55\x7f\x69\xf1\x52\x7b\x69\x7e\x79\x79\x7e\xae" "\x3e\xdb\x6a\x9e\x5b\x9c\x9b\xbf\xed\x35\xec\xb6\xfc\x76\xc7\xaa\x06\xa8" "\x5f\xba\x78\x79\xee\xfc\xf9\xe5\xfa\xf8\xf1\x13\x5b\x16\x5f\xa9\xbd\x3b" "\xfc\xc8\x91\xda\xc4\xc9\xb1\xd7\x0e\xf7\x72\x67\x27\xa7\xa6\x66\xfa\x72" "\x06\x87\x3e\xf6\xd6\x6f\x70\xb3\x37\x3c\x0e\x44\x11\xe7\x23\xc5\xc5\x77" "\xde\x4b\x8d\x88\x28\x62\xf7\x6d\x71\x8b\x63\x67\xaf\x1d\xac\x76\xe2\x58" "\xb5\x13\xb3\x93\x53\xd5\x8e\x2c\x34\x1b\xad\x95\x72\xe1\x74\xaf\x21\x8a" "\x88\x5a\x5f\xa1\x17\x7b\x6d\x74\x17\xfa\x62\x57\xea\x11\x57\xcb\xea\x97" "\x15\x3e\x56\xee\xde\x4c\xbb\xb1\xd4\x38\xbb\x30\x5f\x9f\x6e\x2c\xad\x34" "\x57\x9a\x8b\xad\xe9\xd4\xad\x6d\xaa\xd2\x8b\x78\x3e\x45\xb4\x23\xa2\x33" "\x7c\xe3\xea\x86\xa2\x88\x6f\x46\x8a\xb7\xbf\xd3\x49\x67\x23\x62\xa0\xd7" "\x0e\x9f\xaf\x5e\x0c\xbe\x75\x7d\x8a\x3d\xd8\xc7\xdb\x30\x18\x11\xb5\xa1" "\x88\xf5\xe2\x3e\xe8\xb3\x7b\xd8\x70\x14\xf1\xbd\x48\xf1\xed\x6f\x8d\xc6" "\xb9\xdc\xae\x55\xb3\x3d\x13\xf1\xd5\x32\x1e\x89\xb8\x5c\xc6\x6b\x11\xab" "\x65\xfc\x6c\x44\x2a\x0f\x90\xc7\x22\xde\xdf\xe1\x78\xe2\xfe\x32\x18\x45" "\xfc\x41\xa4\xf8\xc9\x44\x27\xcd\xf5\xfa\xbe\x3a\xaf\x9c\xfe\x5a\xfd\xcb" "\xad\xf3\x8b\x7d\xb9\xbd\xf3\xca\x7d\x7f\x7d\xb8\x9b\xee\xf1\x73\xd3\x48" "\x14\xd1\xa8\xce\xf8\x9d\xf4\xf1\x6f\x76\x00\x00\x00\x00\x00\xb8\xf7\x14" "\xf1\xc7\x91\xe2\xa9\x1f\x1e\x4d\xed\xe8\x1f\x53\x6c\xb6\x2e\xd4\xcf\x34" "\xce\x2e\x74\x9f\x0a\xf7\x9e\xfd\xd7\x73\xa9\x8d\x8d\x8d\x8d\x5a\xea\xc6" "\xd1\x1c\xa7\x73\x6c\xe7\xb8\x9a\xe3\x5a\x8e\xeb\x65\x8c\xcd\x15\xd4\x8a" "\x5c\x3e\xc7\xe9\x1c\xdb\x39\xae\xe6\xb8\x96\xe3\x7a\x8e\x9d\x1c\x6b\x03" "\xb9\x7c\x8e\xd3\x39\xb6\x73\x5c\xcd\x71\x2d\xc7\xf5\x1c\x3b\x39\xd6\x06" "\x73\xf9\x1c\xa7\x07\xab\x9a\x5d\x6d\xe7\xcf\xab\x39\xae\xe5\xb8\x9e\x63" "\x67\x70\x3f\xfa\x09\x00\x00\x00\x00\x00\x00\x00\x6e\xee\x60\x14\xf1\xf5" "\x48\xf1\xcc\x2f\xbc\x51\xbd\x57\x1c\xd5\x7b\xe9\x9f\x9c\x38\xf9\xea\xf1" "\x5f\xed\x7f\x67\xfc\x89\x5b\xac\xa7\xcc\x3d\x1e\x11\x6b\xc5\xed\xbd\x93" "\x7b\x20\xbf\x3a\x3c\x9d\xa6\x53\xda\xa7\x77\x88\xe9\xbe\xff\xf7\x7b\xf9" "\xfd\xbf\xdf\xdf\xef\xca\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfb\xaa\x88" "\x22\x9e\x8e\x14\x6f\x7c\xbf\x93\x22\x45\x44\x3d\xe2\xf5\xe8\xc6\x6b\xc3" "\xfb\x5d\x3b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\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\x4e\x18\x49" "\x45\xbc\x1f\x29\xfe\xf4\x2b\x23\xd5\xe7\xf5\x22\xe2\x37\x23\xe2\xc3\x8d" "\x0f\x37\x22\xe2\xda\x87\x1b\x77\xda\x7e\xef\x31\x00\x00\x00\x00\x00\x00" "\x00\x3c\x80\x52\x11\x6f\x46\x8a\xa7\x5f\xed\xa4\x5a\x44\x5c\xa9\xbd\x3b" "\xfc\xc8\x91\xda\xc4\xc9\xb1\xd7\x0e\x0f\xc4\x40\xa4\x32\xa5\x3f\xff\x95" "\x99\x33\xa7\xea\x2f\x2d\x5e\x6a\x2f\xcd\x2f\x2f\xcf\xcf\xd5\x67\x5b\xcd" "\x73\x8b\x73\xf3\xb7\xbb\xb9\x91\xd3\xcd\xd6\xe5\x2b\xb3\x93\x53\x7b\xb2" "\x33\xb7\x74\x70\x8f\xeb\x7f\x70\xe4\xa5\xc5\xf6\x9b\x4b\xcd\x0b\xbf\xbd" "\xb2\xe3\xf2\x43\x23\xa7\xce\x2e\xaf\x2c\x35\xce\xed\xbc\x38\x0e\x46\x11" "\x51\xef\x9f\x73\xac\xaa\xf0\xec\xe4\x54\x55\xe9\x85\x66\xa3\x55\x15\x9d" "\x4e\xb7\x5b\x63\x00\x00\x00\x00\x00\x00\x00\x1e\x06\x43\xa9\x88\x0f\x23" "\xc5\xdb\x7f\xf5\xce\xf5\x71\xe7\xc1\xee\x98\xff\xe0\xf6\xdc\xef\x7e\x29" "\xa2\xc8\xd3\x93\x79\xfc\xf9\xfa\x30\x74\xf5\xbb\x81\x4f\x54\xbf\x1b\xe8" "\x4e\x7f\x72\xe2\xe4\xaf\x8d\x7f\xa6\x7f\x7a\xc7\x21\xeb\x63\xd5\x80\x7a" "\x7d\x76\x72\x6a\x6a\xa6\x6f\xf6\xe0\xd0\x8d\xa9\x23\x79\xbb\xa3\xbb\xdb" "\x65\xfa\x94\xfd\xbf\x12\x29\xfe\xf0\xcf\xeb\xe9\xa9\x3c\x6f\x6b\xff\x0f" "\x5c\xcf\xfd\xee\xef\x6e\xf6\xf7\xd5\xed\x2b\xba\x49\x9f\xff\x3f\xfa\x7f" "\x4b\x8f\xf7\xfa\xff\xa7\xfb\xe6\x95\xdb\x4c\xa9\x88\xbf\x89\x14\x3f\xf3" "\xeb\x4f\xc4\x53\x55\x3d\x0f\xc5\x0d\xbf\x99\xc8\x79\x5f\x89\x14\xbf\xb1" "\xf6\x64\xce\x8b\x03\x65\xde\xd3\x79\xf9\xa3\xd5\xdf\x23\xe7\x9b\x0b\xf3" "\xa3\x65\xee\x95\x48\xf1\x0f\x97\xb7\xe6\x3e\x93\x73\x3f\xb5\x99\x3b\x76" "\xbb\xed\x7a\xbf\x28\xfb\xff\xe9\x48\xf1\xdf\xbf\xb5\x76\xbd\x6d\x72\xff" "\xe7\x1e\xd8\xec\xb5\xfe\xfe\xff\xcc\xf6\xa3\x63\xf7\xfd\xbf\xe3\xbf\xff" "\x47\xfb\xe6\xd5\xf2\x76\x7f\xf6\xce\xec\x3a\x11\xb1\xfc\xe6\x5b\x17\x1b" "\x0b\x0b\xf3\x4b\x0f\xe3\xc4\xc0\xbd\x51\x0d\x13\x26\x76\x9e\x88\xab\xfb" "\xb7\xf5\xfd\x3e\x33\x71\x37\x94\xd7\xff\xaf\x47\x8a\xbf\xff\x93\x7f\xb9" "\x7e\xbf\x93\xaf\xff\x3f\x15\xd5\x6d\xd5\xe6\xfd\xdf\x07\xdf\xdc\xbc\xfe" "\x4f\x6c\x5f\xd1\x1e\x5d\xff\x3f\xd5\x37\x6f\x22\xdf\x8d\x0c\x0d\x46\x8c" "\xac\x5c\x6a\x0f\x3d\x1e\x31\xb2\xfc\xe6\x5b\x5f\x68\x5e\x6a\x5c\x98\xbf" "\x30\xdf\x3a\x71\xf2\x85\xe7\xc6\x47\x5f\x18\x1b\x3d\x31\x74\xa0\x77\x73" "\xb7\x39\xb5\x7d\xcb\x37\x7c\xbf\x79\x18\x95\xfd\xff\x3b\x91\xe2\x7b\x3f" "\xfa\xeb\xf8\x5c\x9e\xb7\xf5\xfe\x6f\xe7\xfb\xff\x43\xdb\x57\xb4\x47\xfd" "\xff\x58\xdf\xbc\x43\x5b\xee\x57\x76\xbd\xeb\xe4\xfe\xff\xdf\x48\xf1\x4f" "\x93\x3f\x88\xa3\x79\xde\x47\xdd\xff\xf7\xbe\xff\x1f\xcd\x37\xe1\xd7\xef" "\xcf\xf7\xa8\xff\x0f\xf7\xcd\xab\xbe\xe3\x7d\x22\xe2\xe7\xfa\xe6\x1d\x3d" "\x1c\xf1\xc0\x7d\x29\x03\x00\x00\x80\x3b\x2c\xa5\x22\x7e\x90\xc7\x53\x47" "\x6f\x31\x9e\xfa\x8f\x91\xe2\xad\xff\xfa\xf9\x9c\x97\x8e\x94\x79\x2f\xe6" "\xe5\xb5\xea\xef\x91\x97\x17\x5b\x5f\x38\xb5\xb0\xb0\x78\xae\xb1\xd2\x38" "\xbb\x30\x5f\x9f\x69\x37\xce\xcd\x97\x65\x7f\x1c\x29\x3a\x7f\xf9\x64\x2e" "\x5b\x54\xe3\xab\xbd\xf1\xe6\xee\x18\xef\xe6\x58\xec\x3f\x47\x8a\x17\x7e" "\xa5\x97\xdb\x1d\x8b\xed\x3d\x9b\x7a\x6c\x33\x77\xac\xcc\x3d\x1e\x29\xfe" "\xe8\xe5\xad\xb9\xbd\xe7\x18\x87\x37\x73\xc7\xcb\xdc\x7f\x8d\x14\x63\xaf" "\xed\x9c\x7b\x64\x33\xf7\x44\x99\xfb\x9f\x91\xe2\x83\x3f\xab\xf7\x72\x0f" "\x95\xb9\x5f\xca\xb9\x8f\x6f\xe6\x1e\x3f\xb7\xb8\x30\xb7\x07\xdd\x02\x00" "\x00\x00\x00\x00\xbb\x32\x94\x8a\x78\x2e\x52\xfc\xdd\x89\xc1\xd4\x7b\xbe" "\x7d\x3b\xbf\xff\xbc\xe1\xa1\xf7\x1e\xfd\xfe\xef\xf1\xbe\x79\x73\x77\xe9" "\x7d\x95\x5d\x37\x2a\x00\xdc\xe3\xca\xeb\xff\xd1\xf2\xaa\xfe\x8b\x7f\x71" "\x7d\x2c\x7f\xeb\xf5\x7f\xf3\x3d\x99\xfe\xeb\xff\x76\xfd\xff\x6f\xc0\xcd" "\xa6\x3f\xce\xf5\xbf\x76\x67\x76\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\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\xa1\x93\xa2\x88\xc5\x48\xf1\x8d" "\x27\x3b\xe9\xda\x70\xf9\xb9\x6b\xe4\x74\xb3\x75\xf9\xca\xec\xe4\xd4\xce" "\xc5\x0e\xa6\xaa\xe4\x40\x95\x5f\xfe\x19\x19\x1b\x3f\xf1\xc5\x67\x9f\x3b" "\xf9\x7c\x2f\x7e\x74\xf9\x3b\xed\xd3\xf1\xca\xcc\x99\x53\xf5\x97\x16\x2f" "\xb5\x97\xe6\x97\x97\xe7\xe7\xea\xb3\xad\xe6\xb9\xc5\xb9\xf9\xdb\x5e\xc3" "\x6e\xcb\x6f\x77\xac\x6a\x80\xfa\xa5\x8b\x97\xe7\xce\x9f\x8f\x18\x3f\x7e" "\x62\xcb\xe2\x2b\xb5\x77\x87\x1f\x39\x52\x9b\x38\x39\xf6\xda\xe1\x5e\xee" "\xec\xe4\xd4\xd4\x4c\x5f\xce\xe0\xd0\xc7\xde\xfa\x0d\x7a\xfd\x5a\x6c\x9b" "\x7f\x20\x8a\xf8\x9f\x48\x71\xf1\x9d\xf7\xd2\xbf\x0d\xe7\xe5\xbb\x6c\x8b" "\x5b\x1c\x3b\x7b\xed\x60\x14\xf1\xb7\x11\x51\xee\xc4\xec\xe4\x54\xb5\x23" "\x0b\xcd\x46\x6b\xa5\x5c\x38\xdd\xd7\x10\xb5\xbe\x42\x2f\xf6\xda\xe8\x2e" "\xf4\xc5\xae\xd4\x23\xae\x96\xd5\x2f\x2b\x7c\xac\xdc\xbd\x99\x76\x63\xa9" "\x71\x76\x61\xbe\x3e\xdd\x58\x5a\x69\xae\x34\x17\x5b\xd3\xa9\x5b\xdb\x54" "\xa5\x17\xf1\x7c\x8a\x68\x47\x44\x67\xf8\xc6\xd5\x0d\x45\x11\x43\x91\xe2" "\xed\xef\x74\xd2\x8f\x86\x23\x06\x7a\xed\xf0\xf9\x97\x67\x5e\x1d\x1d\xbf" "\x49\x25\x46\x36\x27\xb7\x1f\x50\x77\xc9\x60\x44\xd4\x86\x22\xd6\x8b\xfb" "\xa0\xcf\xee\x61\xc3\x51\xc4\xb3\x91\xe2\xdb\xdf\x1a\x8d\x7f\x1f\xee\xb6" "\x6b\xd5\x6c\xcf\x44\x7c\xb5\x8c\x47\x22\x2e\x97\xf1\x5a\xc4\x6a\x19\x3f" "\x1b\x91\xca\x03\xe4\xb1\x88\xf7\x77\x38\x9e\xb8\xbf\x0c\x46\x11\x8f\x46" "\x8a\x9f\x4c\x74\xd2\x8f\x87\x73\xdf\x57\xe7\x95\xd3\x5f\xab\x7f\xb9\x75" "\x7e\xb1\x2f\xb7\x77\x5e\xb9\xef\xaf\x0f\x77\xd3\x3d\x7e\x6e\x1a\x89\x22" "\xde\xab\xce\xf8\x9d\xf4\x1f\xfe\x3d\x03\x00\x00\x00\x00\x3c\x40\x8a\x78" "\x22\x52\x3c\xf5\xc3\xa3\xa9\x1a\x1f\xbc\x3e\xa6\xd8\x6c\x5d\xa8\x9f\x69" "\x9c\x5d\xe8\x3e\xd6\xef\x3d\xfb\xaf\xe7\x52\x1b\x1b\x1b\x1b\xb5\xd4\x8d" "\xa3\x39\x4e\xe7\xd8\xce\x71\x35\xc7\xb5\x1c\xd7\x73\xec\xe4\x58\x2b\x72" "\xf9\x1c\xa7\x73\x6c\xe7\xb8\x9a\xe3\x5a\x8e\xeb\x39\x76\x72\xac\x0d\xe4" "\xf2\x39\x4e\xe7\xd8\xce\x71\x35\xc7\xb5\x1c\xd7\x73\xec\xe4\x58\x1b\xcc" "\xe5\x73\x9c\xce\xb1\x9d\xe3\x6a\x8e\x6b\x39\xae\xe7\xd8\x19\xdc\xcf\xfe" "\x02\x00\x00\x00\x00\x00\x00\xd8\x59\x11\x45\x7c\x2e\x52\xbc\xf1\xfd\x4e" "\xda\x18\xee\x0e\xf0\xbe\x1e\xdd\x78\xcd\xfb\x40\x0f\xbc\xff\x0b\x00\x00" "\xff\xff\x6f\xf6\x51\x77", 3084); syz_mount_image(/*fs=*/0x2000000002c0, /*dir=*/0x200000000080, /*flags=MS_REC|MS_NOSUID|MS_NODEV*/ 0x4006, /*opts=*/0x200000002440, /*chdir=*/-1, /*size=*/0xc0c, /*img=*/0x200000001500); memcpy((void*)0x200000000140, "./bus\000", 6); syscall(__NR_open, /*file=*/0x200000000140ul, /*flags=O_SYNC|O_NOCTTY|O_NOATIME|O_CREAT|FASYNC|0x2*/ 0x143142ul, /*mode=*/0ul); memcpy((void*)0x200000000380, "/dev/loop", 9); *(uint8_t*)0x200000000389 = 0x30; *(uint8_t*)0x20000000038a = 0; memcpy((void*)0x200000000080, "./bus\000", 6); syscall(__NR_mount, /*src=*/0x200000000380ul, /*dst=*/0x200000000080ul, /*type=*/0ul, /*flags=MS_BIND*/ 0x1000ul, /*data=*/0ul); memcpy((void*)0x200000000000, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x200000000000ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[0] = res; *(uint64_t*)0x200000000240 = 0; *(uint64_t*)0x200000000248 = 0; *(uint64_t*)0x200000000250 = 0; *(uint64_t*)0x200000000258 = 0x7fffffffffffffff; *(uint64_t*)0x200000000260 = 0; *(uint32_t*)0x200000000268 = 0; *(uint32_t*)0x20000000026c = 0; *(uint32_t*)0x200000000270 = 0; *(uint32_t*)0x200000000274 = 0; memcpy((void*)0x200000000278, "\xef\x35\x9f\x41\x3b\xb9\x01\x52\xf7\xd6\xd1\xce\x5d\x29\xc3\xee\x5e" "\x5c\xa9\x00\x0f\x7c\x41\x49\x9d\xc2\xaa\xc6\x3a\x01\x00\x00\x00\x00" "\x00\x00\x00\x4f\xaa\x2a\xd9\xc0\x84\xa0\x03\xea\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 64); memcpy((void*)0x2000000002b8, "\x03\x6c\x47\xc6\x78\x08\x20\x04\x00\x00\x00\x00\x00\x00\x00\x33\x52" "\x63\xbd\xbc\xef\x54\x9b\xa1\x97\xfc\xe4\x7d\xdf\xdd\x75\x3a\xbd\x95" "\x01\x00\x00\x2a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00" "\xe8\xf2\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", 64); memcpy((void*)0x2000000002f8, "\xb9\x00\x00\xcd\x1a\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00" "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 32); *(uint64_t*)0x200000000318 = 0; *(uint64_t*)0x200000000320 = 0; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x4c04, /*arg=*/0x200000000240ul); } 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; }