// https://syzkaller.appspot.com/bug?id=7701979fc07bb4200b7ec2e372596225858e46bf // 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 (;;) { 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; } } } void execute_one(void) { memcpy((void*)0x20000000, "hfsplus\000", 8); memcpy((void*)0x20000080, "./file0\000", 8); memcpy((void*)0x20000180, "force", 5); *(uint8_t*)0x20000185 = 0x2c; memcpy((void*)0x20000186, "nls", 3); *(uint8_t*)0x20000189 = 0x3d; memcpy((void*)0x2000018a, "cp932", 5); *(uint8_t*)0x2000018f = 0x2c; memcpy((void*)0x20000190, "barrier", 7); *(uint8_t*)0x20000197 = 0x2c; memcpy((void*)0x20000198, "type", 4); *(uint8_t*)0x2000019c = 0x3d; memcpy((void*)0x2000019d, "\xa0\x3b\x7f\x38", 4); *(uint8_t*)0x200001a1 = 0x2c; memcpy((void*)0x200001a2, "umask", 5); *(uint8_t*)0x200001a7 = 0x3d; sprintf((char*)0x200001a8, "%023llo", (long long)0xd200); *(uint8_t*)0x200001bf = 0x2c; memcpy((void*)0x200001c0, "umask", 5); *(uint8_t*)0x200001c5 = 0x3d; sprintf((char*)0x200001c6, "%023llo", (long long)0x49); *(uint8_t*)0x200001dd = 0x2c; memcpy((void*)0x200001de, "uid", 3); *(uint8_t*)0x200001e1 = 0x3d; sprintf((char*)0x200001e2, "0x%016llx", (long long)0); *(uint8_t*)0x200001f4 = 0x2c; memcpy((void*)0x200001f5, "nobarrier", 9); *(uint8_t*)0x200001fe = 0x2c; memcpy((void*)0x200001ff, "gid", 3); *(uint8_t*)0x20000202 = 0x3d; sprintf((char*)0x20000203, "0x%016llx", (long long)0); *(uint8_t*)0x20000215 = 0x2c; *(uint8_t*)0x20000216 = 0; memcpy( (void*)0x20000c80, "\x78\x9c\xec\xdd\x4b\x68\x1c\xe7\x1d\x00\xf0\xff\xac\x56\xab\x5d\x15\x1c" "\x39\xf1\x23\x2d\x81\x2c\x31\xa4\xa5\xa2\xb6\x64\xa1\xb4\xea\xa5\x6e\x29" "\x45\x87\x50\x42\x7a\xe8\x79\xb1\xe5\x58\x78\x2d\x07\x49\x29\xb2\x29\x8d" "\xd2\xc7\xbd\x87\x9c\x7a\x4a\x0f\xba\x85\x1e\x4a\x7a\x37\xb4\xe7\x86\x40" "\xc9\x55\xc7\x40\x21\x97\x9c\x74\x53\x99\xd9\x99\xd5\x4a\xfb\x94\xac\xc7" "\x26\xfd\xfd\xc4\xcc\x7c\x33\xdf\x73\xfe\xb3\x33\xb3\x0f\xc4\x04\xf0\x7f" "\x6b\x79\x36\xca\xcf\x22\x89\xe5\xd9\x37\xb7\xd2\xf5\xdd\x9d\x85\xe6\xc4" "\xce\xc2\x54\x9e\xdd\x8c\x88\x4a\x44\x94\x22\xca\xad\x45\x24\x6b\x91\xe5" "\xde\xc9\xa7\xf8\x76\xba\x31\x2f\x9f\xf4\xeb\xe7\xc3\xd5\xa5\xb7\x3f\xff" "\x6a\xf7\x8b\xd6\x5a\x39\x9f\xb2\xf2\xa5\x41\xf5\x7a\xa8\x74\x6f\xda\xce" "\xa7\xa8\x47\xc4\x44\xbe\xec\x36\xd9\xa7\xc5\x4f\x8e\x76\x7f\xa8\xbd\xbb" "\x7d\xdb\x1b\x55\xd2\xde\xc3\x34\x60\x37\x8a\xc0\xc5\x5f\x9e\xab\x55\x78" "\x6e\xfb\x5d\xb6\xdb\x79\x1f\xff\x27\x9b\x0f\xaa\x7e\x9c\xf3\x16\x18\x53" "\x49\xeb\xbe\xd9\x65\x26\x62\x3a\x22\xaa\x11\xad\xbb\x7e\x7e\x75\x28\x9d" "\xef\xe8\x4e\xdf\xf6\x45\x0f\x00\x00\x00\x00\x8e\xab\x76\xfc\x2a\x2f\xec" "\xc5\x5e\x6c\xc5\xa5\xb3\x18\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\x7c" "\x53\xe5\xcf\xff\x4f\xf2\xa9\x54\xa4\xeb\x91\x14\xcf\xff\xaf\xe4\xdb\x22" "\x4f\x8f\xa1\xe1\x0f\x42\xfc\x6c\xaa\xb5\x7c\x76\xf6\x83\x01\x00\x00\x00" "\x00\x00\x00\x80\x33\xf7\xea\x5e\xec\xc5\x56\x5c\x2a\xd6\xf7\x93\xec\x37" "\xff\xd7\x3a\x7e\xe3\xff\x56\xbc\x17\x1b\xb1\x12\xeb\x71\x33\xb6\xa2\x11" "\x9b\xb1\x19\xeb\x31\x1f\x11\x33\x1d\x0d\x55\xb6\x1a\x9b\x9b\xeb\xf3\x59" "\xcd\x88\x2b\x03\x6a\xde\x8e\x4f\x7b\xd4\xbc\xdd\x7f\x8c\x77\x4e\x79\x9f" "\x01\x00\x00\x00\x00\x00\x00\x60\xcc\x55\x87\xe4\x3f\x9c\xec\xde\xf6\xfb" "\x58\x3e\xf8\xfd\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x41" "\x12\x31\xd1\x5a\x64\xd3\x95\x22\x3d\x13\xa5\x72\x44\x54\x23\xa2\x92\x96" "\xdb\x8e\xf8\xb4\x48\x7f\x4d\x24\xbd\x36\x3e\x3b\xff\x71\x00\x00\x00\xc0" "\x73\xa9\x1e\x5e\x4d\xaa\x23\xd4\x79\xe1\xfd\xd8\x8b\xad\xb8\x54\xac\xef" "\x27\xd9\x67\xfe\x6b\xd9\xe7\xe5\x6a\xbc\x17\x6b\xb1\x19\xab\xb1\x19\xcd" "\x58\x89\x7b\xf9\x67\xe8\xf4\x53\x7f\x69\x77\x67\xa1\xb9\xbb\xb3\xf0\x28" "\x9d\xba\xdb\xfd\xe9\x97\xc7\x1a\x7a\xd6\x62\xb4\xbe\x7b\xe8\xdd\xf3\xcb" "\x59\x89\x5a\xdc\x8f\xd5\x6c\xcb\xcd\xb8\x1b\x49\xec\x67\x4a\x79\x2b\x2f" "\xef\xee\x2c\xa4\xcb\x47\xbd\xc7\xf5\x41\x3a\xa6\xe4\x27\xb9\x01\xa3\x99" "\xe8\x48\xdf\x4b\x67\xd7\x3f\xc9\xd2\x7f\x3e\xfc\x2d\x42\xf9\x58\xbb\x78" "\x42\xa5\xbe\x39\x33\x59\xee\x64\x3b\x22\x73\xf9\xd8\xd2\x1a\x97\x8b\x08" "\xf4\x8e\xc4\xd0\xa3\x53\x1e\xd8\xd3\x7c\x94\xda\xdf\xfc\x5c\x19\xdc\x53" "\xef\x98\x7f\x30\xb8\xf7\xe9\x23\xa5\x7a\x7e\x73\x73\x21\x8e\x46\xe2\x76" "\x94\xda\x47\xe8\xda\xe0\x48\x44\x7c\xf7\x1f\x1f\xff\xfa\x41\x73\xed\xe1" "\x83\xfb\x1b\xb3\xe3\xb3\x4b\x3d\xbd\x3f\xb4\xc4\xd1\x48\x2c\x74\x44\xe2" "\xfa\x37\x28\x12\xc3\xcd\x65\x91\xb8\xda\x5e\x5f\x8e\x5f\xc4\xaf\x62\x36" "\xbe\x9c\x7a\x2b\xd6\x63\x35\x7e\x13\x8d\xd8\x8c\x95\x7a\x91\xdf\xc8\x5f" "\xcf\xe9\x7c\x66\x70\xa4\x3e\x9b\xee\x5c\x7b\x6b\xd8\x48\xd2\x73\xb2\xde" "\xbe\x7e\xf5\x1a\x53\x3d\x0e\x8d\x29\xea\xf1\xf3\x2c\xd5\x88\xd7\xb2\x63" "\x7a\x29\x56\x23\x89\xc7\x11\xb1\x12\x6f\x64\x7f\xb7\x63\xbe\x7d\x35\x38" "\x38\xc2\x57\x47\x38\xeb\x4b\x23\x5c\x69\x3b\xdc\xf8\x5e\xb6\x68\x87\x29" "\x6a\xfd\xcb\xfe\x6d\xb4\x26\x4f\x4b\x1a\xd7\xcb\x1d\x71\xed\xbc\xe6\xce" "\x64\x79\x9d\x5b\x0e\xa2\xf4\x62\xcf\x28\x15\xf7\xba\xd1\xef\x47\x1d\xca" "\xdf\xc9\x13\x69\x0b\x7f\x18\x78\x7f\x38\x6f\x47\x23\x31\xdf\x11\x89\x97" "\xfa\xbd\x5e\x5a\x21\xfd\xeb\x7e\x3a\xdf\x68\xae\x3d\x5c\x7f\xd0\x78\x77" "\xc4\xfe\x5e\xcf\x97\xe9\x79\xf4\xa7\xb1\xba\x4b\xa4\x47\xf8\xc5\xa8\xe6" "\x3b\x77\x39\x9b\x27\xd9\x39\x35\x97\xe5\xbd\xd4\xbe\xc3\x1e\x8e\x57\x25" "\xff\xc5\xa5\xa5\xd4\x95\x77\xb5\x5d\xaf\x75\xa6\xfe\x32\x1e\xc7\xbd\x43" "\x67\xea\x0f\x63\x31\x16\x63\x29\x2b\x7d\x2d\x2b\x3d\xd9\x75\xc7\x4a\xf3" "\xae\xb7\x5b\x3a\x7c\x0d\x4f\xf3\xd2\x77\x5a\xe5\xf6\x0f\x3b\x9d\xef\xb7" "\x1e\x47\xb3\xf5\x7e\x08\x80\xf1\x36\xfd\xfd\xe9\x4a\xed\xbf\xb5\x7f\xd7" "\x3e\xaa\xfd\xb1\xf6\xa0\xf6\x66\xf5\x67\x53\x3f\x9a\x7a\xa5\x12\x93\xff" "\x9a\xfc\x71\x79\x6e\xe2\xf5\xd2\x2b\xc9\xdf\xe3\xa3\xf8\xdd\xc1\xe7\x7f" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\xe0\xe4\x36\x9e\x3c\x7d\xd8\x68\x36\x57\xd6\x7b\x27" "\x4a\xbd\xb3\x92\xc1\xb5\x1a\xcd\xfd\xe2\x41\x62\x03\xca\x1c\x4a\x24\xf9" "\xa3\x72\x46\x28\x9c\x6c\x3c\x79\xba\x3f\xb4\xc1\xc1\x89\xa9\x7c\x78\x27" "\xac\x7e\x9a\x89\xe2\x69\x8d\xc3\x0b\xd7\xcf\x70\x18\xc9\xf6\xd1\xe3\x55" "\x1d\x7e\x2c\x8a\xa7\x3c\x8d\xd0\x45\xd2\x15\xf0\xb4\xf2\x89\xc7\x5c\xf4" "\x7c\xb0\x65\x72\x0c\x0e\xe5\xd1\x44\xfd\xf4\x1a\x2c\x5e\xb0\x1d\x59\xc7" "\x7f\xf5\xd6\x7a\x1d\xaf\x89\x88\xe8\x55\x78\xc8\x85\x63\xe2\x34\xae\x3e" "\xc0\x45\xba\xb5\xf9\xe8\xdd\x5b\x1b\x4f\x9e\xfe\x60\xf5\x51\xe3\x9d\x95" "\x77\x56\xd6\x26\x17\x17\x97\xe6\x96\x16\xdf\x58\xb8\x75\x7f\xb5\xb9\x32" "\xd7\x9a\x77\x54\x38\x97\x87\xdf\x02\xe7\xa1\xf3\xed\x44\x5b\x25\x22\x5e" "\x1d\x5e\x77\xc0\x83\x5a\x01\x00\x00\x00\x00\x00\x00\x00\x00\x80\x33\x74" "\x1e\xff\x0b\x71\xd1\xfb\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\xbd\x2d\xcf\x46\xf9\x59\x24" "\x31\x3f\x77\x73\x2e\x5d\xdf\xdd\x59\x68\xa6\x53\x91\x3e\x28\x59\x8e\x88" "\x52\x44\x24\xbf\x8d\x48\xfe\x19\x71\x27\x5a\x53\xcc\x74\x34\x97\xf4\xeb" "\xe7\xc3\xd5\xa5\xb7\x3f\xff\x6a\xf7\x8b\x83\xb6\xca\x45\xf9\x52\xc4\x76" "\xdf\x7a\xa3\xd9\xce\xa7\xa8\x47\xc4\x44\xbe\x3c\xad\xf6\xee\x0e\x6f\xaf" "\x72\x90\x9c\xea\x91\x9d\xb4\x23\x93\x06\xec\x46\x11\x38\xb8\x68\xff\x0b" "\x00\x00\xff\xff\xb7\x28\xec\x95", 1754); syz_mount_image(/*fs=*/0x20000000, /*dir=*/0x20000080, /*flags=MS_I_VERSION|MS_NOEXEC|MS_NODEV*/ 0x80000c, /*opts=*/0x20000180, /*chdir=*/2, /*size=*/0x6da, /*img=*/0x20000c80); memcpy((void*)0x20000040, "./file0\000", 8); memcpy((void*)0x20000240, "osx.t", 5); syscall(__NR_setxattr, /*path=*/0x20000040ul, /*name=*/0x20000240ul, /*val=*/0ul, /*size=*/0ul, /*flags=*/0ul); memcpy((void*)0x200000c0, "./file0\000", 8); syscall(__NR_listxattr, /*path=*/0x200000c0ul, /*list=*/0ul, /*size=*/0ul); } 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); loop(); return 0; }