// https://syzkaller.appspot.com/bug?id=5809732d522a5c85c7eae3c46508983371c5d5ad // 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; } } } void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x20000180, "udf\000", 4); memcpy((void*)0x200000c0, "./file1\000", 8); memcpy((void*)0x20001040, "uid=", 4); sprintf((char*)0x20001044, "%020llu", (long long)0); memcpy( (void*)0x20001058, "\x2c\x75\x6e\x64\x65\x6c\x65\x74\x65\x2c\x6e\x6f\x76\x72\x73\x2c\x61\x64" "\x69\x6e\x69\x63\x62\x2c\x76\x6f\x6c\x75\x6d\x65\x3d\x30\x30\x30\x30\x30" "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x32\x2c\x75\x69" "\x64\x3d\x66\x6f\x72\x67\x65\x74\x2c\x67\x69\x64\x3d\x66\x6f\x72\x67\x65" "\x74\x2c\x6e\x6f\x73\x74\x72\x69\x63\x74\x2c\x6e\x6f\x76\x72\x73\x2c\x00" "\x85\xf9\x57\x33\x01\x9d\x78\x4c\xa3\x86\xda\x1f\xd4\x1f\xfa\xbd\x4b\x47" "\xac\xca\x2b\x8d\x48\x8b\xe7\x02\x15\x7d\xd8\x71\x1c\x31\x73\x2d", 124); memcpy( (void*)0x20001100, "\x78\x9c\xec\xdd\x4f\x6c\x1c\xd7\x7d\x07\xf0\xdf\x1b\x2e\xc5\xa5\xdc\x56" "\x4c\xec\x28\x4e\x1a\x17\x9b\xb6\x48\x65\xc5\x72\xf5\x2f\xa6\x62\x15\xee" "\xaa\xa6\xd9\x06\x90\x65\x21\x14\x73\x0b\xc0\x95\x48\xa9\x0b\x53\x24\x41" "\x52\x8d\x6c\xa4\x05\xd3\x4b\x0f\x3d\x04\x28\x8a\x1e\x72\x22\xd0\x1a\x05" "\x52\x34\x30\x9a\x22\xe8\x91\x69\x5d\x20\xb9\xf8\x50\xe4\xd4\x13\xd1\xc2" "\x46\x50\xf4\xc0\x16\x01\x72\x0a\x18\xcc\xec\x5b\x71\x45\x91\x36\x2d\x92" "\x12\x65\x7d\x3e\x36\xf5\xdd\x9d\x7d\x6f\xe6\xbd\x79\xeb\x19\x59\xd0\x9b" "\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\xc4\x1f\xbc" "\x72\xe1\xe4\xa9\xf4\xb0\x5b\x01\x00\x3c\x48\x97\xc6\xbe\x7a\xf2\xb4\xfb" "\x3f\x00\x3c\x56\xae\xf8\xff\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x38\xe8\x52\x14\xf1\x64\xa4\x98\xbb\xb4\x96\x26\xaa\xf7\x1d\xf5\x8b" "\xed\xfe\x5b\xb7\xc7\x47\x46\xb7\xae\x36\x98\xaa\x9a\x7d\x55\xf9\xf2\xa7" "\x7e\xea\xf4\x99\xb3\x5f\x7a\x61\xb8\x7c\x5d\xe6\xb9\x8b\xed\x99\x0f\xa8" "\xbf\xd7\x3e\x1b\xaf\x8d\x5d\xb9\xd0\x78\x79\xf6\xe6\xdc\xfc\xd4\xc2\xc2" "\xd4\x64\x63\x7c\xa6\x7d\x6d\x76\x72\x6a\xc7\x7b\xd8\x6d\xfd\xcd\x8e\x57" "\x27\xa0\x71\xf3\xf5\x5b\x93\xd7\xaf\x2f\x34\x4e\x3f\x7f\xe6\xae\x8f\x6f" "\x0f\xbd\x3f\xf0\xc4\xd1\xa1\xf3\xc3\xcf\x9e\x78\xa6\x5b\x76\x7c\x64\x74" "\x74\x6c\xa3\x48\xbd\xb7\x7c\xed\xbe\x1b\xd2\xb1\xdd\x0c\x8f\x43\x51\xc4" "\x89\x48\xf1\xdc\xf7\x7e\x9a\x5a\x11\x51\xc4\xee\xcf\x45\xfd\xc1\x8e\xfd" "\x66\x83\x55\x27\x8e\x57\x9d\x18\x1f\x19\xad\x3a\x32\xdd\x6e\xcd\x2c\x96" "\x1f\x5e\xee\x9e\x88\x22\xa2\xd1\x53\xa9\xd9\x3d\x47\x5b\x8f\x45\xd4\xfa" "\x1f\x68\x1f\xb6\xd7\x8c\x58\x2a\x9b\x5f\x36\xf8\x78\xd9\xbd\xb1\xb9\xd6" "\x7c\xeb\xea\xf4\x54\xe3\x72\x6b\x7e\xb1\xbd\xd8\x9e\x9d\xb9\x9c\x3a\xad" "\x2d\xfb\xd3\x88\x22\xce\xa5\x88\xe5\x88\x58\x1d\xb8\x77\x77\xfd\x51\x44" "\x2d\x52\x7c\xe7\xc8\x5a\xba\x1a\x11\x7d\xdd\xf3\xf0\xc5\x6a\x62\xf0\xf6" "\xed\x28\xf6\xb1\x8f\x3b\x50\xb6\xb3\xd1\x1f\xb1\x5c\x3c\x02\x63\x76\x80" "\x0d\x44\x11\xaf\x46\x8a\x9f\xbd\x73\x2c\xae\xe5\xeb\x4c\x75\xad\xf9\x42" "\xc4\xab\x65\xfe\x20\xe2\xad\x32\x5f\x8a\x48\xd5\xc5\x3d\xe2\xbd\x2d\xbe" "\x47\x3c\x9a\x6a\x51\xc4\x5f\x96\xe3\x7f\x7e\x2d\x4d\x56\xd7\x83\xee\x75" "\xe5\xe2\xd7\x1a\x5f\x99\xb9\x3e\xdb\x53\xb6\x7b\x5d\xf9\x88\xf7\x87\x7b" "\xae\x14\x0f\xe9\xfe\x30\xb8\x29\x1f\x8c\x03\x7e\x6d\xaa\x47\x11\xad\xea" "\x8a\xbf\x96\xee\xff\x37\x3b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xec\xb5\xc1\x28\xe2\x33\x91\xe2\x95\xff\xf8\x93\x6a\x5e\x71\x54" "\xf3\xd2\x8f\x9c\x1f\xfe\xc3\xa1\x5f\xed\x9d\x33\xfe\xf4\x87\xec\xa7\x2c" "\xfb\x7c\x44\x2c\x15\x3b\x9b\x93\x7b\x28\x4f\x0c\xbc\x9c\x2e\xa7\xf4\x90" "\xe7\x12\x3f\xce\xea\x51\xc4\x9f\xe6\xf9\x7f\xdf\x7a\xd8\x8d\x01\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\xac\x15\xf1\x93\x48" "\xf1\xe2\xbb\xc7\xd2\x72\xf4\xae\x29\xde\x9e\xb9\xd1\xb8\xd2\xba\x3a\xdd" "\x59\x15\xb6\xbb\xf6\x6f\x77\xcd\xf4\xf5\xf5\xf5\xf5\x46\xea\x64\x33\xe7" "\x44\xce\xa5\x9c\xcb\x39\x57\x72\xae\xe6\x8c\x22\xd7\xcf\xd9\xcc\x39\x91" "\x73\x29\xe7\x72\xce\x95\x9c\xab\x39\xa3\x2f\xd7\xcf\xd9\xcc\x39\x91\x73" "\x29\xe7\x72\xce\x95\x9c\xab\x39\xa3\x96\xeb\xe7\x6c\xe6\x9c\xc8\xb9\x94" "\x73\x39\xe7\x4a\xce\xd5\x9c\x71\x40\xd6\xee\x05\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\xf8\x38\x29\xa2\x88\x5f\x44\x8a\x6f\x7f\x63\x2d\x45\x8a" "\x88\x66\xc4\x44\x74\x72\x65\xe0\x61\xb7\x0e\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x0d\xa4\x22\xbe\x1f" "\x29\x1a\x7f\xd4\xbc\xb3\xad\x16\x11\xa9\xfa\xb7\xe3\x58\xf9\xcb\xd9\x68" "\x1e\x2a\xf3\x93\xd1\x1c\x2e\xf3\xa5\x68\x5e\xc8\xd9\xaa\xb2\xd6\xfc\xd6" "\x43\x68\x3f\xbb\xd3\x9f\x8a\xf8\x71\xa4\x18\xa8\xbf\x7d\x67\xc0\xf3\xf8" "\xf7\x77\xde\xdd\xf9\x1a\xc4\x5b\xdf\xdc\x78\xf7\xd9\x5a\x27\xfb\xba\x1f" "\x0e\xbd\x3f\xf0\xc4\xd1\x23\xe7\x87\x47\x7f\xe3\xe9\xed\x5e\xa7\xad\x1a" "\x70\xfc\x62\x7b\xe6\xd6\xed\xc6\xf8\xc8\xe8\xe8\x58\xcf\xe6\x5a\x3e\xfa" "\x27\x7b\xb6\x0d\xe5\xe3\x16\x7b\xd3\x75\x22\x62\xe1\x8d\x37\x5f\x6f\x4d" "\x4f\x4f\xcd\xdf\xff\x8b\xf2\x2b\xb0\x8b\xea\x8f\xd0\x8b\x54\xdb\xd3\x9e" "\xf6\x3d\xa0\xc6\xd7\xf6\x62\x94\x1f\xcb\x17\x51\x3b\x10\xcd\x78\x38\x7d" "\xe7\x31\x50\xde\xff\xdf\x8b\x14\xbf\xfb\xee\x7f\x76\x6f\xf8\x9d\xfb\x7f" "\x3d\x7e\xa5\xf3\xee\xce\x1d\x3e\x7e\xfe\x67\x1b\xf7\xff\x17\x37\xef\x68" "\x87\xf7\xff\xda\xe6\x7a\xf9\xfe\x5f\xde\xd3\xb7\xba\xff\x3f\xd9\xb3\xed" "\xc5\xfc\xbb\x91\xfe\x5a\x44\x7d\xf1\xe6\x5c\xff\xd1\x88\xfa\xc2\x1b\x6f" "\x9e\x68\xdf\x6c\xdd\x98\xba\x31\x35\x73\xf6\xe4\xc9\x2f\x0f\x0f\x7f\xf9" "\xcc\xc9\xfe\x43\x11\xf5\xeb\xed\xe9\xa9\x9e\x57\x7b\x72\xba\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x9c\x54\xc4\xef\x47\x8a\xd6" "\x8f\xd7\x52\x23\x22\x6e\x57\xf3\xb5\x86\xce\x0f\x3f\x7b\xe2\x99\xbe\xe8" "\xab\xe6\x5b\xdd\x35\x6f\xfb\xb5\xb1\x2b\x17\x1a\x2f\xcf\xde\x9c\x9b\x9f" "\x5a\x58\x98\x9a\x6c\x8c\xcf\xb4\xaf\xcd\x4e\x4e\xed\xf4\x70\xf5\x6a\xba" "\xd7\xf8\xc8\xe8\xbe\x74\xe6\x43\x0d\xee\x73\xfb\x07\xeb\x2f\xcf\xce\xbd" "\x31\xdf\xbe\xf1\xc7\x8b\x5b\x7e\x7e\xb8\x7e\xe1\xea\xc2\xe2\x7c\xeb\xda" "\xd6\x1f\xc7\x60\x14\x11\xcd\xde\x2d\xc7\xab\x06\x8f\x8f\x8c\x56\x8d\x9e" "\x6e\xb7\x66\xaa\xaa\x97\xb7\x9c\x4c\xff\xd1\xf5\xa7\x22\xfe\x2b\x52\x5c" "\x3b\xdb\x48\x9f\xcf\xdb\xf2\xfc\xff\xcd\x33\xfc\xef\x9a\xff\xbf\xb4\x79" "\x47\xfb\x34\xff\xff\x13\x3d\xdb\xca\x63\xa6\x54\xc4\xcf\x23\xc5\xef\xfc" "\xd5\xd3\xf1\xf9\xaa\x9d\x87\xe3\x9e\x73\x96\xcb\xfd\x5d\xa4\x38\x7e\xee" "\x73\xb9\x5c\x1c\x2a\xcb\x75\xdb\xd0\x79\xae\x40\x67\x66\x60\x59\xf6\xff" "\x22\xc5\x3f\xfd\xe2\xee\xb2\xdd\xf9\x90\x4f\x6e\x94\x3d\xb5\xe3\x13\xfb" "\x88\x28\xc7\xff\x48\xa4\xf8\xfe\x5f\x7c\x37\x7e\x33\x6f\xbb\xfb\xf9\x0f" "\x5b\x8f\xff\xe1\xcd\x3b\xda\xa7\xf1\x7f\xaa\x67\xdb\xe1\xbb\x9e\x57\xb0" "\xeb\xae\x93\xc7\xff\x44\xa4\x78\xe9\xc9\xb7\xe3\xb7\xf2\xb6\x0f\x7a\xfe" "\x47\xf7\xd9\x1b\xc7\x72\xe1\x3b\xcf\xe7\xd8\xa7\xf1\xff\x54\xcf\xb6\xa1" "\x7c\xdc\xdf\xde\x9b\xae\x03\x00\x00\x00\x00\x00\x00\x00\x00\x3c\xd2\xfa" "\x53\x11\x7f\x1f\x29\x7e\x38\x5a\x4b\x2f\xe4\x6d\x3b\xf9\xfb\x7f\x93\x9b" "\x77\xb4\x4f\x7f\xff\xeb\xd3\x3d\xdb\x26\xf7\x66\xbd\xa2\x0f\x7d\xb1\xeb" "\x93\x0a\x00\x00\x00\x00\x07\x44\x7f\x2a\xe2\x27\x91\xe2\xc6\xe2\xdb\x77" "\xe6\x50\xdf\x3d\xff\xbb\x67\xfe\xe7\xef\x6d\xcc\xff\x1c\x49\x9b\x3e\xad" "\xfe\x9c\xef\xd7\xaa\xe7\x06\xec\xe5\x9f\xff\xf5\x1a\xca\xc7\x9d\xd8\x7d" "\xb7\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x40" "\x49\xa9\x88\x17\xf2\x7a\xea\x13\xd5\x7c\xfe\xc9\x6d\xd7\x53\x5f\x89\x14" "\xaf\xfc\xcf\x73\xb9\x5c\x3a\x5a\x96\xeb\xae\x03\x3f\x54\xfd\x5a\xbf\x34" "\x3b\x73\xe2\xc2\xf4\xf4\xec\xb5\xd6\x62\xeb\xea\xf4\x54\x63\x6c\xae\x75" "\x6d\xaa\xac\xfb\x54\xa4\x58\xfb\xdb\xcf\xe5\xba\x45\xb5\xbe\x7a\x77\xbd" "\xf9\xce\x1a\xef\x1b\x6b\xb1\xcf\x47\x8a\xd1\x7f\xe8\x96\xed\xac\xc5\xde" "\x5d\x9b\xfc\xa9\x8d\xb2\xa7\xca\xb2\x9f\x88\x14\xff\xfd\x8f\x77\x97\xed" "\xae\x63\xfd\xa9\x8d\xb2\xa7\xcb\xb2\x7f\x13\x29\xbe\xfe\x2f\x5b\x97\x3d" "\xba\x51\xf6\x4c\x59\xf6\xbb\x91\xe2\x47\x5f\x6f\x74\xcb\x1e\x2e\xcb\x76" "\x9f\x8f\xfa\xe9\x8d\xb2\xcf\x5f\x9b\x2d\xf6\x61\x54\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\xdc\xf4\xa7\x22\xfe\x3c\x52" "\xfc\xef\xcd\xe5\x3b\x73\xf9\xf3\xfa\xff\xfd\x3d\x6f\x2b\x6f\x7d\xb3\x67" "\xbd\xff\x4d\x6e\x57\xeb\xfc\x0f\x55\xeb\xff\x6f\xf7\xfa\x7e\xd6\xff\xaf" "\x9e\x2b\xb0\xb4\xdd\x51\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\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\xe3\x29\x45\x11\x6f\x46\x8a\xb9\x4b\x6b\x69\x65" "\xa0\x7c\xdf\x51\xbf\xd8\x9e\xb9\x75\x7b\x7c\x64\x74\xeb\x6a\x83\xa9\xaa" "\xd9\x57\x95\x2f\x7f\xea\xa7\x4e\x9f\x39\xfb\xa5\x17\x86\xcf\x75\xf3\x83" "\xeb\xef\xb5\xcf\xc4\x6b\x63\x57\x2e\x34\x5e\x9e\xbd\x39\x37\x3f\xb5\xb0" "\x30\x35\xd9\x18\x9f\x69\x5f\x9b\x9d\x9c\xda\xf1\x1e\x76\x5b\x7f\xb3\xe3" "\xd5\x09\x68\xdc\x7c\xfd\xd6\xe4\xf5\xeb\x0b\x8d\xd3\xcf\x9f\xb9\xeb\xe3" "\xdb\x43\xef\x0f\x3c\x71\x74\xe8\xfc\xf0\xb3\x27\x9e\xe9\x96\x1d\x1f\x19" "\x1d\x1d\xeb\x29\x53\xeb\xbf\xef\xa3\xdf\x23\x6d\xb3\xfd\x50\x14\xf1\xd7" "\x91\xe2\xb9\xef\xfd\x34\xfd\x70\x20\xa2\x88\xdd\x9f\x8b\x0f\xf9\xee\xec" "\xb7\xc1\xaa\x13\xc7\xab\x4e\x8c\x8f\x8c\x56\x1d\x99\x6e\xb7\x66\x16\xcb" "\x0f\x2f\x77\x4f\x44\x11\xd1\xe8\xa9\xd4\xec\x9e\xa3\x07\x30\x16\xbb\xd2" "\x8c\x58\x2a\x9b\x5f\x36\xf8\x78\xd9\xbd\xb1\xb9\xd6\x7c\xeb\xea\xf4\x54" "\xe3\x72\x6b\x7e\xb1\xbd\xd8\x9e\x9d\xb9\x9c\x3a\xad\x2d\xfb\xd3\x88\x22" "\xce\xa5\x88\xe5\x88\x58\x1d\xb8\x77\x77\xfd\x51\xc4\xeb\x91\xe2\x3b\x47" "\xd6\xd2\xbf\x0e\x44\xf4\x75\xcf\xc3\x17\x2f\x8d\x7d\xf5\xe4\xe9\xed\xdb" "\x51\xec\x63\x1f\x77\xa0\x6c\x67\xa3\x3f\x62\xb9\x78\x04\xc6\xec\x00\x1b" "\x88\x22\xfe\x39\x52\xfc\xec\x9d\x63\xf1\x6f\x03\x11\xb5\xe8\xfc\xc4\x17" "\x22\x5e\x2d\xf3\x07\x11\x6f\x45\x67\xbc\x53\xf9\xc5\x38\x1b\xf1\xde\x16" "\xdf\x23\x1e\x4d\xb5\x28\xe2\xff\xcb\xf1\x3f\xbf\x96\xde\x19\x28\xaf\x07" "\xdd\xeb\xca\xc5\xaf\x35\xbe\x32\x73\x7d\xb6\xa7\x6c\xf7\xba\xf2\x88\xdd" "\x1f\x36\xdf\xfa\x06\x1f\xcc\x61\xb3\x03\x7e\x6d\xaa\x47\x11\x3f\xaa\x4e" "\xd1\x5a\xfa\x77\xff\x5d\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x1c\x20\x45\xfc\x7a\xa4\x78\xf1\xdd\x63\xa9\x9a\x1f\x7c\x67\x4e\x71" "\x7b\xe6\x46\xe3\x4a\xeb\xea\x74\x67\x5a\x5f\x77\xee\x5f\x77\xce\xf4\xfa" "\xfa\xfa\x7a\x23\x75\xb2\x99\x73\x22\xe7\x52\xce\xe5\x9c\x2b\x39\x57\x73" "\x46\x91\xeb\xe7\x6c\x96\x59\x5f\x5f\x9f\xc8\xef\x97\x72\x2e\xe7\x5c\xc9" "\xb9\x9a\x33\xfa\x72\xfd\x9c\xcd\x9c\x13\x39\x97\x72\x2e\xe7\x5c\xc9\xb9" "\x9a\x33\x6a\xb9\x7e\xce\x66\xce\x89\x9c\x4b\x39\x97\x73\xae\xe4\x5c\xcd" "\x19\x07\x64\xee\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\xf0\xf1\x52\x54\xff\xa4\xf8\xf6\x37\xd6\xd2\xfa\x40\x67\x7d\xe9\x89" "\xe8\xe4\x8a\xf5\x40\x3f\xf6\x7e\x19\x00\x00\xff\xff\x5b\xc5\xf6\x95", 3131); syz_mount_image(/*fs=*/0x20000180, /*dir=*/0x200000c0, /*flags=MS_POSIXACL|MS_RELATIME|MS_NOEXEC*/ 0x210008, /*opts=*/0x20001040, /*chdir=*/-1, /*size=*/0xc3b, /*img=*/0x20001100); memcpy((void*)0x20000440, "./control\000", 10); syscall(__NR_mkdir, /*path=*/0x20000440ul, /*mode=*/0ul); memcpy((void*)0x200002c0, "./control/file0\000", 16); syscall(__NR_open, /*file=*/0x200002c0ul, /*flags=O_CREAT|O_CLOEXEC*/ 0x80040ul, /*mode=*/0ul); memcpy((void*)0x200001c0, "./control/file0\000", 16); syscall(__NR_unlink, /*path=*/0x200001c0ul); memcpy((void*)0x20000040, "./control\000", 10); syscall(__NR_rmdir, /*path=*/0x20000040ul); memcpy((void*)0x20000100, "./control\000", 10); syscall(__NR_rmdir, /*path=*/0x20000100ul); } 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); const char* reason; (void)reason; loop(); return 0; }