// https://syzkaller.appspot.com/bug?id=ebcf47bed053716d7e7c15b19fea609509394dd5 // 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; } static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2) { if (a0 == 0xc || a0 == 0xb) { char buf[128]; sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2); return open(buf, O_RDWR, 0); } else { char buf[1024]; char* hash; strncpy(buf, (char*)a0, sizeof(buf) - 1); buf[sizeof(buf) - 1] = 0; while ((hash = strchr(buf, '#'))) { *hash = '0' + (char)(a1 % 10); a1 /= 10; } return open(buf, a2, 0); } } //% 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x200000000940, "iso9660\000", 8); memcpy((void*)0x200000000980, "./file0\000", 8); memcpy((void*)0x200000000240, "norock", 6); *(uint8_t*)0x200000000246 = 0x2c; memcpy((void*)0x200000000247, "hide", 4); *(uint8_t*)0x20000000024b = 0x2c; memcpy((void*)0x20000000024c, "uid", 3); *(uint8_t*)0x20000000024f = 0x3d; sprintf((char*)0x200000000250, "0x%016llx", (long long)0); *(uint8_t*)0x200000000262 = 0x2c; memcpy((void*)0x200000000263, "cruft", 5); *(uint8_t*)0x200000000268 = 0x2c; memcpy((void*)0x200000000269, "mode", 4); *(uint8_t*)0x20000000026d = 0x3d; sprintf((char*)0x20000000026e, "0x%016llx", (long long)1); *(uint8_t*)0x200000000280 = 0x2c; memcpy((void*)0x200000000281, "overriderockperm", 16); *(uint8_t*)0x200000000291 = 0x2c; memcpy((void*)0x200000000292, "utf8", 4); *(uint8_t*)0x200000000296 = 0x2c; memcpy((void*)0x200000000297, "check=relaxed", 13); *(uint8_t*)0x2000000002a4 = 0x2c; *(uint8_t*)0x2000000002a5 = 0; memcpy( (void*)0x200000000a00, "\x78\x9c\xec\xdd\xcf\x6f\x1c\xf5\xdd\x07\xf0\xf7\x38\xf6\x83\x9f\x05\x41" "\x80\x3c\x3c\x51\x04\x64\x13\x1a\x30\xe0\x3a\x6b\xa7\x84\x5a\x5c\xea\x78" "\xd7\xce\x52\xdb\x5b\xd9\x8e\x44\xd4\x43\x43\x49\xa8\xa2\x58\xa5\x82\x56" "\x02\xd4\x43\x2a\x55\x3d\x15\xb5\x87\xaa\x87\xf6\xc6\xb1\x27\x24\x2e\x70" "\xa9\xf2\x57\xf4\xd0\x0b\xff\x02\xea\x29\x37\x57\x33\x6b\x27\x0e\x78\xbd" "\xc6\x75\xbc\xc1\x7d\xbd\xac\xf1\xfc\xfa\xcc\xf7\xfb\x99\x9d\xd9\xf9\x6a" "\x7f\xcd\x37\x7c\x9b\xad\xaf\xaf\x57\xc3\x1e\xe7\x2f\xfd\xed\x20\x93\xe5" "\xc1\x73\xa1\xf9\xc5\xc7\x9f\x7c\x54\x0e\xbf\xb9\x99\xff\xc9\x91\xbc\x52" "\x7c\x96\x8c\x26\xa9\x27\xc3\x49\x8e\x27\x23\xb3\xcd\xe5\xce\x62\x9f\x82" "\x6e\x24\x57\x92\xdc\x4a\x8a\x24\x0f\xa5\x3b\xde\x95\x2b\x29\xfe\x90\x47" "\xee\xce\xdf\x4a\xf1\xd7\xb2\x5e\xee\xbf\x75\xfe\xab\x0d\xfa\xfc\x03\x00" "\x00\x00\x00\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\x07\x51\x31\xdb\x6c\x34\x26\x8b" "\x2c\xb4\x97\x2e\xbd\x51\xef\xad\xea\x02\x7c\x87\xf5\x9b\xe5\x7d\x5e\xf5" "\xfa\x5d\x7c\xde\xb7\xde\xa4\x28\x87\x8c\x8e\x6e\x76\xf5\x7d\xfc\xd8\xdd" "\xd5\x4f\x95\xff\x4e\xe7\xe9\xee\xdc\xd3\x55\x87\xe4\x19\xcd\x87\x0f\x3f" "\x75\xf4\xb5\x27\x87\x87\x36\xb7\xdf\x21\xa1\x03\xf1\xde\x07\x1f\xde\x78" "\x73\x6d\xed\xda\xbb\x83\x4e\x64\x40\xe6\x5b\x4b\xed\x95\x4e\x7b\x71\x66" "\xbe\x55\x6f\xaf\x74\xea\xd3\xe7\xcf\x37\xce\x5e\x9c\x5b\xa9\xcf\xb5\x17" "\x5a\x2b\x97\x57\x56\x5b\x8b\xf5\xd9\xe5\xd6\xcc\x6a\x67\xb9\x3e\x36\xfb" "\x62\x7d\x72\x7a\xfa\x5c\xbd\x35\x71\xb9\x73\x69\x69\xbe\x39\xb3\xd0\xda" "\x5c\xf8\xea\x77\xa7\x1a\x8d\xf3\xf5\xd7\x27\x7e\xd4\x9a\x59\x5e\xe9\x2c" "\x9d\x7d\x7d\x62\x65\xf6\x62\x7b\x61\xa1\xbd\x34\x5f\xc5\x94\xab\xcb\x98" "\x57\xcb\x13\xf1\x87\xed\xd5\xfa\x6a\x6b\x66\xb1\x5e\x7f\xfb\xfa\xda\xb5" "\x73\xfd\x92\x2c\x83\x26\x77\x13\x34\xd5\x2f\x68\xaa\x31\x35\x35\x39\x39" "\x35\x35\x79\xfe\x95\xe9\x57\x5e\x6d\x34\x86\xbf\xb6\xa0\xf1\x15\xf9\x5a" "\xc4\xe0\x4f\x5a\x06\x6b\xdf\xaf\xe1\xb0\x57\x43\x1b\xed\x7f\x16\xd2\xce" "\x52\x2e\xe5\x8d\xd4\xb7\xfd\x9b\x4d\x33\xcb\xe9\x64\xb1\xc7\xfa\x0d\x9b" "\xed\xff\x99\xb3\xad\x1d\xeb\xdd\xda\xfe\x6f\xb6\xf2\xc7\xef\xae\x3e\x91" "\xaa\xfd\x7f\xb6\x3b\xf7\x6c\xaf\xf6\xbf\x47\x2e\x07\xf7\xf7\x5e\x3e\xc8" "\x87\xb9\x91\x37\xb3\x96\xb5\x5c\xcb\xbb\x03\xcf\xe8\x60\xff\xe6\xd3\xca" "\x52\xda\x59\x49\x27\xed\x2c\x66\xa6\x5a\x52\xdf\x58\x52\xcf\x74\xce\xe7" "\x7c\x1a\xf9\x49\x2e\x66\x2e\x2b\xa9\x67\x2e\xed\x2c\xa4\x95\x95\x5c\xce" "\x4a\x56\xd3\xaa\xce\xa8\xd9\x2c\xa7\x95\x99\xac\xa6\x93\xe5\xd4\x33\x96" "\xd9\xbc\x98\x7a\x26\x33\x9d\xe9\x9c\x4b\x3d\xad\x4c\xe4\x72\x3a\xb9\x94" "\xa5\xcc\xa7\x99\x99\xaa\x94\xb7\x73\xbd\x7a\xdc\xcf\xed\x90\xe3\x9d\xa0" "\xc9\xdd\x04\x4d\xed\x10\xa4\xfd\xe7\x3f\x77\x3f\x2e\xe3\xb0\x27\xeb\x9b" "\xed\x3f\x00\x00\x00\x70\x68\x15\xd5\xbb\xef\xe5\xeb\xff\x91\x3c\x53\x4d" "\xcd\xb5\x17\x5a\x8d\x41\xa7\x05\x00\x00\x00\xec\xa3\xea\x93\xff\xa7\xcb" "\xd1\x48\x39\xf5\x4c\x0a\xaf\xff\x01\x00\x00\xe0\xb0\x29\xaa\xdf\xd8\x15" "\x49\x6a\x39\xd9\x9d\xda\xfc\x25\x94\x37\x01\x00\x00\x00\xe0\x90\xa8\x3e" "\xff\x7f\xb6\x1c\xd5\xca\xa9\x93\x29\xbc\xfe\x07\x00\x00\x80\xc3\xa6\xff" "\x3d\xf6\xfb\x46\x14\xe3\x9b\xb7\xff\xad\x5f\xed\x8e\xaf\x6e\x44\x6c\xdc" "\xe7\xb7\x36\xd7\x5e\x68\x4d\xcc\x76\x16\x5e\x9b\xcc\xf3\xd5\x5d\x06\xaa" "\x5f\x1a\x6c\x5b\xda\x48\xf5\xf3\x83\x97\x72\xaa\x1b\x75\xaa\xd6\x1d\xd7" "\xee\x2d\x71\xb4\x8c\x9a\x9c\x78\x6d\x32\x2f\xe5\xf4\xc6\x8e\x8c\x3d\x57" "\x8e\x9e\x1b\xdb\x26\x72\xaa\x1b\xf9\x42\x37\xf2\x85\x1d\x22\xcf\x95\x91" "\x00\x70\xd8\x9d\xee\xd3\x1e\xef\xa6\xfd\x7f\x29\xe3\xdd\x88\xf1\x13\x65" "\x63\x9a\xe1\x13\xdb\xb4\xac\x0d\x2d\x2b\x00\x3c\x28\xfa\xf7\xb1\xd3\x37" "\xa2\xf8\x5e\x9f\xd7\xff\x4f\xdc\xf9\x4a\xc1\x44\xde\xca\x3b\x59\xcb\xd5" "\x8c\x57\xbf\x36\xa8\xbe\x71\xb0\x6d\xa9\xb5\x2d\x5f\x43\x18\xef\xf3\x6e" "\x40\x6d\x4b\x0f\x2f\xe3\x7d\xde\x0f\xa8\x6d\xe9\xe8\x65\xbc\xcf\x3b\x02" "\xb5\x2d\xdd\xcb\x00\xc0\x61\x72\xba\x4f\x3b\xbc\x9b\xf6\x7f\xbc\xcf\xeb" "\xff\x9a\xaf\x14\x02\xc0\x03\xe5\x4e\x0f\xf6\xf7\x71\x62\xd0\xfb\x08\x00" "\xdc\x4b\x2b\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\xfb\xef\x20\xee\xff\x6f\xc2\x84\x89\x6f\xdb" "\xc4\xa0\xaf\x4c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x1c\x84\x22\x39\xb2\xdd\xf2\xa1\xe4\xa1\x24" "\x8d\x24\x67\x0f\x3e\xab\xfb\xe7\xe6\xa0\x13\x18\xb0\xe2\x76\x6e\xe7\xfd" "\x3c\x3a\xe8\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x9b\x8d\xfb\xff\x0f\xa5\x3b\x7e" "\xb8\xbb\x28\xc3\x43\xc9\x99\x24\x57\x92\xfc\x78\xd0\x39\xee\xa7\xdb\x83" "\x4e\x60\xc0\xb6\xdc\xff\xbf\x3c\xe6\x59\x2f\x32\xdc\x3d\xec\x29\x46\x66" "\x9b\xcb\x9d\xc5\xf2\xf0\x57\x7d\x3f\x0c\x7d\xf1\xf1\x27\x1f\x95\xc3\x5e" "\xea\x29\x0b\x28\x6b\xb8\xa7\x73\x89\x8d\x1a\x7a\x6f\xf5\x78\xb5\x55\xad" "\x79\xed\xbd\x1b\xbf\x7c\xe7\x17\xf5\xe6\x85\x2a\xc9\x0b\xab\x73\x0b\xcd" "\xc5\xf9\xe5\x1f\xdc\x0d\x7c\xaa\xf8\x34\xa9\xa7\x3b\x6c\xda\xcc\xf7\xd7" "\x67\xfe\xfe\xc7\x6d\xf6\xfc\xd3\x72\x4f\x77\x57\xef\x5c\x55\x6f\xf3\xeb" "\xf5\xfe\xff\x76\x5b\xef\x5c\xef\x4e\xae\xaf\x5d\x9b\x2a\x6b\x5a\x6d\xbd" "\xb1\xfa\xab\x9f\x5f\x7f\x7f\xcb\xaa\x27\x72\x2a\x79\x6e\x2c\x19\xbb\xb7" "\xa6\x9f\x95\x43\x8f\x9a\x4e\x65\x64\xa7\xda\x8a\x2f\x8b\xdf\x15\x8f\xe6" "\xcf\xb9\x52\x1d\xff\xf2\xd1\x28\xd6\x8b\xf2\x10\x3d\x56\xed\xff\xff\xbe" "\x7d\x7d\xed\xda\xc4\x5b\xef\xac\x5d\xed\x91\xd3\xd1\x9c\x4c\x72\x35\x19" "\xdd\x7d\x4e\x27\xab\xeb\xc9\xb6\xaa\xb3\x6e\x68\xa4\xac\xb5\x51\x05\x95" "\xff\x8e\xf5\x29\x6f\x47\x5b\x4a\x9c\xec\xb1\x0f\x8f\x57\xa7\x4c\xed\x1b" "\xed\x43\xbd\xf7\x3e\x54\xfa\x3c\xee\x1b\x19\x9d\xeb\x91\xd1\x93\x79\xfe" "\x1b\x1f\xe9\xe7\xfb\xd4\xb8\xad\xe2\xcb\xe2\x9f\xc5\xc5\xfc\x23\xbf\xdd" "\xd2\xff\xc7\x50\x79\xfc\xcf\x64\x37\xcf\xce\x32\xa6\x8a\xdc\x72\xa6\xf4" "\x8c\x1c\xea\x46\x56\x7b\x3e\xb5\x63\x99\x3d\x9f\x95\xdc\x07\xbf\xcf\x4f" "\xf3\xfd\x3b\xc7\x7f\x68\xcb\xf5\x7f\xe3\x58\x1d\xcc\xf5\x68\x4b\x8d\x07" "\xf4\xbc\xa8\x5a\xa4\x63\x5f\x69\x91\x36\xae\x3e\xbd\xb6\xd9\xc8\xf3\x58" "\x37\xaa\x47\x9e\xff\x97\x97\x93\xe1\x13\xdf\xe8\x8a\xf2\x72\x9f\x2b\xca" "\xfd\x7a\xfe\xff\xa5\x18\xcb\xbf\x72\x53\xff\x3f\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xc0\x83\xaf\x48\x8e\x6c\xb7\x7c\x28\x39\x93\xe4\x68\x92\xc7\xca" "\xf9\x7a\xb2\xbe\x1f\xf5\x0d\xd5\x8a\xfd\x28\x66\xcf\x6e\x0e\xb4\xf6\xc1" "\x2b\x6e\xe7\x76\xde\xcf\xa3\x83\xce\x03\x00\x00\x00\x00\x00\x00\x80\xfd" "\x71\xa1\xf9\xc5\xc7\x9f\x7c\x54\x0e\xd5\xe7\xf1\x47\xf2\x9d\xe2\xb3\x64" "\xb4\xfb\x49\xff\x70\x92\xa3\xc5\x9f\x46\x66\x9b\xcb\x9d\xc5\x3e\x05\x8d" "\x24\x57\x92\xdc\xda\x43\x0e\xe5\x76\x79\xe4\xee\xfc\xad\x72\xee\xf8\x1e" "\x0a\x02\x00\x76\xe5\xdf\x01\x00\x00\xff\xff\xb4\x22\x66\xf3", 2337); syz_mount_image(/*fs=*/0x200000000940, /*dir=*/0x200000000980, /*flags=*/0, /*opts=*/0x200000000240, /*chdir=*/3, /*size=*/0x921, /*img=*/0x200000000a00); memcpy((void*)0x200000000640, "/dev/loop#\000", 11); res = -1; res = syz_open_dev(/*dev=*/0x200000000640, /*id=*/0, /*flags=O_NOFOLLOW|FASYNC|O_APPEND*/ 0x22400); if (res != -1) r[0] = res; *(uint32_t*)0x2000000000c0 = 0; *(uint16_t*)0x2000000000c8 = 0; *(uint64_t*)0x2000000000d0 = 0; *(uint16_t*)0x2000000000d8 = 0; *(uint32_t*)0x2000000000e0 = 3; *(uint32_t*)0x2000000000e4 = 0x12; *(uint32_t*)0x2000000000e8 = 0; *(uint32_t*)0x2000000000ec = 0x18; memcpy((void*)0x2000000000f0, "\x6a\x95\x9f\x16\xb6\x78\x7b\x08\xae\x26\xe6\x6c\x40\x56\xa5\x16\x95" "\x28\x48\x54\xc2\x82\xec\x6b\xcf\xee\xf4\xfb\x0e\xfc\xc1\xd1\xa6\x07" "\x8e\xd9\x8e\x03\x3f\xd5\xf0\x64\x39\x02\xdd\x8f\x6f\xac\x27\x4d\xe9" "\xd9\x40\xbb\xa5\xe5\x92\xbb\xd4\xce\x85\x45\x0d\x00", 64); memcpy((void*)0x200000000130, "\xf6\x25\x57\x53\x2b\xf8\xf6\x30\x01\xbe\x49\xa7\x39\xa8\x23\x1a\x90" "\x4d\xc8\xdf\x62\xa3\x88\x93\xec\x00\x34\x7f\x41\x44\x62\x08", 32); *(uint64_t*)0x200000000150 = 2; *(uint64_t*)0x200000000158 = 0xbd; *(uint32_t*)0x200000000160 = 0; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x4c02, /*arg=*/0x2000000000c0ul); memcpy((void*)0x2000000000c0, ".\000", 2); res = syscall(__NR_open, /*file=*/0x2000000000c0ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[1] = res; syscall(__NR_lseek, /*fd=*/r[1], /*offset=*/0x7fful, /*whence=*/0ul); syscall(__NR_getdents64, /*fd=*/r[1], /*ent=*/0ul, /*count=*/0ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-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=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; loop(); return 0; }