// https://syzkaller.appspot.com/bug?id=7f2b04224d8470e667907e7d11f918ad76c6d107 // 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_ioctl #define __NR_ioctl 29 #endif #ifndef __NR_memfd_create #define __NR_memfd_create 279 #endif #ifndef __NR_mmap #define __NR_mmap 222 #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 (;;) { 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[1] = {0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; memcpy((void*)0x20000200, "hfsplus\000", 8); memcpy((void*)0x20000080, "./file1\000", 8); memcpy((void*)0x20000000, "nobarrier", 9); *(uint8_t*)0x20000009 = 0x2c; memcpy((void*)0x2000000a, "barrier", 7); *(uint8_t*)0x20000011 = 0x2c; memcpy((void*)0x20000012, "nobarrier", 9); *(uint8_t*)0x2000001b = 0x2c; memcpy((void*)0x2000001c, "uid", 3); *(uint8_t*)0x2000001f = 0x3d; sprintf((char*)0x20000020, "0x%016llx", (long long)0); *(uint8_t*)0x20000032 = 0x2c; memcpy((void*)0x20000033, "nls", 3); *(uint8_t*)0x20000036 = 0x3d; memcpy((void*)0x20000037, "ascii", 5); *(uint8_t*)0x2000003c = 0x2c; *(uint8_t*)0x2000003d = 0; memcpy( (void*)0x200007c0, "\x78\x9c\xec\xdd\x4f\x6c\x1c\x67\xdd\x07\xf0\xef\x6c\xec\x4d\x36\xaf\xe4" "\x38\x6d\xd2\xe6\x45\x48\xb5\x1a\x29\x82\x46\x24\xb6\x97\x92\x20\x21\x11" "\x10\x02\x1f\x2a\x14\x89\x4b\xaf\x56\xe2\x34\x56\x36\x6e\x65\xbb\xc8\x89" "\x10\x31\x7f\x0a\x47\x38\xa1\x1e\x7a\x28\x42\xe1\xd0\x13\xe2\x80\x54\xc4" "\x01\x51\xce\x48\x48\xdc\x73\x8f\xc4\x3d\x17\x58\x34\xbb\xb3\xf6\xda\xeb" "\x2c\x76\x62\x67\x9d\xf0\xf9\x48\xb3\xf3\xcc\x3c\xf3\x3c\xcf\x6f\x7e\x9e" "\x79\x76\x77\xa2\x68\x03\xfc\xcf\x9a\x7b\x3b\xe3\xeb\x29\x32\x77\xfe\xad" "\xb5\x72\xfb\xc1\xfd\x66\xeb\xc1\xfd\xe6\xed\x5e\x39\xc9\xd1\x24\xb5\x64" "\xac\xbb\x4a\xb1\x94\x14\x9f\x25\x57\xd2\x5d\xf2\xff\xe5\xce\xaa\xbb\xe2" "\x71\xe3\xbc\xf9\xf0\xd3\x8f\xce\x7d\xf8\x49\xb3\xbb\x35\x56\x2d\x9d\xe3" "\x6b\xc3\xda\x0d\xd8\xf1\xc8\xf5\x6a\xc9\x54\x92\x23\xd5\xfa\x29\x6c\xe9" "\xef\xda\x0e\xfd\xdd\xdb\x53\x77\xc5\x46\xdc\x65\xc2\xce\xf6\x12\x07\xa3" "\xd6\x1e\xb0\xbe\x97\xe6\xbb\xbf\x6f\x81\x43\xeb\x5e\xf7\x7d\x73\xc0\x64" "\x72\x3c\xc9\xb1\xea\x73\x40\xaa\xd9\xa1\xf6\x6c\xa3\xdb\x7f\x7b\x9a\xe5" "\x00\x00\x00\xe0\x10\x68\x9f\x18\xd8\xb5\xe3\x77\xf9\x7e\x27\x1e\xe5\x51" "\xd6\x32\x71\x50\x31\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\xc0\x8b\xa8\xe8" "\xfe\x66\x60\x51\x2d\xb5\x5e\x79\x2a\x45\xef\xf7\xff\xeb\xd5\xbe\x54\xe5" "\xe7\xd8\x07\x37\x46\x1d\x01\x00\x00\x00\x00\x00\x00\x00\xec\x87\xd7\x1e" "\xe5\x51\xd6\x32\xd1\xdb\x6e\x17\x9d\x7f\xf3\x7f\xbd\xb3\x71\xaa\xf3\xfa" "\x7f\x79\x3f\x2b\x59\xc8\x72\x2e\x64\x2d\xf3\x59\xcd\x6a\x96\x33\x93\x8c" "\x4f\xf4\x75\x54\x5f\x9b\x5f\x5d\x5d\x9e\x19\x6c\xf9\xab\x94\x2d\xdb\xed" "\xf6\xbd\xaa\xe5\x6c\x92\xc9\x81\x96\xb3\xcf\xe6\x7c\x01\x00\x00\x00\x00" "\x00\x00\xe0\x05\xf5\xe3\xcc\x65\x62\xd4\x41\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\x22\x39\xd2\x5d\x75\x96\x53\xbd\xf2\x64\x6a\x63" "\x49\x8e\x25\xa9\x97\xc7\xad\x27\x7f\xea\x95\x9f\x67\x7f\x1e\x75\x00\x00" "\x00\x00\x70\xf0\x1a\xd5\x7a\xa2\xf8\x77\xb7\xd0\x2e\x3a\xdf\xf9\x5f\xe9" "\x7c\xef\x3f\x96\xf7\xb3\x94\xd5\x2c\x66\x35\xad\x2c\xe4\x7a\xe7\x59\x40" "\xf7\x5b\x7f\xed\xef\xeb\xcd\xd6\x83\xfb\xcd\xdb\xe5\x32\xd8\xf1\x37\xfe" "\xb9\xa7\x38\x3a\x3d\xa6\xfb\xec\x61\xe7\x91\xa7\x3b\x47\x9c\xde\x68\x31" "\x97\x6f\xe7\x7b\x39\x9f\xa9\x5c\xcd\x72\x16\xf3\xfd\xcc\x67\x35\x0b\x99" "\xca\xb7\xca\x93\xc8\x7c\x8a\x4c\x56\x4f\x2f\x26\x7b\x71\xee\x1c\xef\x95" "\x2d\x5b\x57\xb7\xc7\xf6\xda\xb6\xed\x33\x9d\x48\x1a\xb9\x91\xc5\x4e\x6c" "\x17\x72\xad\xde\x0b\xbd\x56\xc5\x7f\xa6\x6f\xb4\x3f\xd4\x93\x6d\x23\xfe" "\xa8\xcc\x4e\xf1\xf5\xca\x2e\x73\x74\xbd\x5a\x97\x67\xf4\xcb\x6a\x5d\x69" "\x9f\xd8\x65\x1f\x07\x63\xb2\x73\xe6\xe3\x1b\x19\x99\xae\x72\x5f\x66\xe3" "\xe4\xf0\xdc\xef\xf1\x3a\xd9\x3e\xd2\x4c\x6a\x1b\xcf\xa0\x4e\x6d\x8e\x52" "\x6e\x6e\x1f\xe9\x89\x72\x7e\xbc\x5a\x97\xb9\xfe\xd9\xd6\x9c\xef\xb7\x3d" "\x3e\x4a\xdb\x9e\x89\xd9\xd4\xaa\xab\x2f\x79\x65\x78\xce\x93\x2f\xfe\xe3" "\x2f\x57\x6f\xd6\x96\x6e\xdd\xbc\xb1\x72\xfe\x00\x4f\xe9\xd9\xd8\x9e\x89" "\x66\x5f\x26\x5e\xdd\x55\x26\x5a\x65\x26\xd6\x77\x9f\x89\xf1\xed\x3b\x8e" "\x3d\xed\x39\xec\x8f\x7a\x95\x8d\xee\x2c\xba\xdb\xd9\xb2\x2c\xcd\xe7\xf5" "\x4e\xdb\x89\x7f\xb5\xf3\xdd\xbc\x9b\xeb\x59\xc8\xa5\x4c\x67\x26\x97\x33" "\x9d\xaf\x66\x36\xcd\x2d\x57\xd8\xe9\xe1\x79\xed\xdc\x6b\xb5\xbd\xdd\x6b" "\x67\xbf\x50\x15\xca\xf7\xa4\x9f\xf7\xbd\x37\x8d\x5e\x99\xd7\x93\x7d\x79" "\xed\x9f\xe9\x26\x3b\x75\xd5\x9e\x2b\xbf\xc8\x74\x5f\x96\x5e\xda\x45\x96" "\xf6\x38\x23\x8d\x7d\xae\x2a\x94\x63\xfc\x64\xe3\x1d\xe7\x30\xd8\x92\x89" "\x6a\x6e\xee\x45\xf7\xf2\xf0\x4c\xfc\xba\x5d\xbe\xae\xb4\x96\x6e\x2d\xdf" "\x9c\x7f\x6f\x97\xe3\x9d\xab\xd6\xe5\x6d\xfb\xc1\xd6\xb9\xf9\x37\xfb\x71" "\x3e\x4f\xae\xbc\x5e\x5e\x2a\xff\x58\x9d\xad\x93\x5b\xae\x97\xb2\xee\xe5" "\x1d\xeb\x66\x3a\x75\xa7\x36\xea\x6a\x03\x75\xa7\x37\xea\x26\x33\x91\xc5" "\x21\x77\x6a\xbd\xfa\x0c\x37\xd8\x53\xb7\xee\xd5\x1d\xeb\x9a\x9d\xba\x33" "\x7d\x75\x5b\x3e\xe5\xe4\xdd\xb4\x36\x3e\x85\x00\x70\x88\x1d\x7f\xe3\x78" "\xbd\xf1\xb0\xf1\xb7\xc6\xc7\x8d\x9f\x36\x6e\x36\xde\x3a\xf6\xcd\xa3\x97" "\x8f\x7e\xbe\x9e\xf1\xbf\x8e\xfd\xf1\xc8\xef\x6a\xbf\xad\x7d\xad\x78\x23" "\x1f\xe7\x87\x99\x18\x75\xa4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x22\x58\xb9\x73\xf7" "\xd6\x7c\xab\xb5\xb0\xfc\x74\x85\xc6\x3e\xf5\xb3\xa5\x90\xda\xe6\x9e\xde" "\xcf\x24\xed\xf3\x10\x9b\x63\x15\x55\xa1\xbe\xdf\x3d\xbf\x60\x85\xef\x24" "\x79\xd2\xe6\xbf\x4f\x32\xe4\x98\xfa\x53\x47\x58\xec\xd7\xf5\xfc\xf8\x42" "\x79\x11\x1e\x96\xbf\xc5\xce\x85\xb1\x21\x49\x38\x9a\xa1\xcd\x1b\x7d\xf7" "\xd7\x68\xe7\x25\xe0\xe0\x5d\x5c\xbd\xfd\xde\xc5\x95\x3b\x77\xbf\xb4\x78" "\x7b\xfe\x9d\x85\x77\x16\x96\x66\x2f\x5f\xba\x7c\xa9\xf9\x95\x99\x2f\x5f" "\xbc\xb1\xd8\x5a\x98\xee\xbe\x8e\x3a\x4a\xe0\x20\xac\xdc\xb9\x7b\x64\xd4" "\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7b\x73\xe0\xff\x1b\xa1\xbe" "\xbc\x32\xea\x73\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\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\x6f\x73\x6f\x67\x7c\x3d\x45\x66\xa6" "\x2f\x4c\x97\xdb\x0f\xee\x37\x5b\xe5\xd2\x2b\x6f\x1e\x39\x96\xa4\x96\xa4" "\xf8\x41\x52\x7c\x96\x5c\x49\x77\xc9\x64\x5f\x77\xc5\xe3\xc6\x79\xf3\xe1" "\xa7\x1f\x9d\xfb\xf0\x93\xe6\x66\x5f\x63\xbd\xe3\x6b\xc3\xda\xed\xce\x7a" "\xb5\x64\x2a\xc9\x91\x6a\xfd\xdf\x1d\xdd\xa1\x9b\xc1\xfe\xae\xf5\xf5\xb7" "\xfe\x44\xe1\x15\x1b\x67\x58\x26\xec\x6c\x2f\x71\x30\x6a\xff\x09\x00\x00" "\xff\xff\x97\x67\x01\x73", 1680); syz_mount_image(/*fs=*/0x20000200, /*dir=*/0x20000080, /*flags=MS_LAZYTIME|MS_SYNCHRONOUS|MS_MANDLOCK*/ 0x2000050, /*opts=*/0x20000000, /*chdir=*/0, /*size=*/0x690, /*img=*/0x200007c0); memcpy((void*)0x20000000, "/dev/loop#\000", 11); res = -1; res = syz_open_dev(/*dev=*/0x20000000, /*id=*/4, /*flags=*/0); if (res != -1) r[0] = res; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x4c09, /*arg=*/0x1000ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*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=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); for (procid = 0; procid < 5; procid++) { if (fork() == 0) { loop(); } } sleep(1000000); return 0; }