// https://syzkaller.appspot.com/bug?id=47fa0c6211916f91a75d56a8298470f14c7fe032 // 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 void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } 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, 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 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, loopfd = -1, 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) { memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; 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) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } errno = err; return res; } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; retry: while (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) { } dp = opendir(dir); if (dp == NULL) { if (errno == EMFILE) { exit(1); } exit(1); } struct dirent* ep = 0; while ((ep = readdir(dp))) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; char filename[FILENAME_MAX]; snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); while (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) { } struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } int i; for (i = 0;; i++) { if (unlink(filename) == 0) break; if (errno == EPERM) { int fd = open(filename, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno != EBUSY || i > 100) exit(1); if (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW)) exit(1); } } closedir(dp); for (int i = 0;; i++) { if (rmdir(dir) == 0) break; if (i < 100) { if (errno == EPERM) { int fd = open(dir, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno == EBUSY) { if (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW)) exit(1); continue; } if (errno == ENOTEMPTY) { if (iter < 100) { iter++; goto retry; } } } exit(1); } } 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"); if (symlink("/dev/binderfs", "./binderfs")) { } } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); 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; } remove_dir(cwdbuf); } } void execute_one(void) { memcpy((void*)0x20000440, "ext4\000", 5); memcpy((void*)0x20000000, "./file1\000", 8); memcpy((void*)0x20000a80, "inode_readahead_blks=0x0000000000000000,nogrpid,debug_want_extra_" "isize=0x0000000000000066,dioread_nolock,max_batch_time=" "0x0000000000000008,resgid=", 146); sprintf((char*)0x20000b12, "0x%016llx", (long long)0); memcpy( (void*)0x20000b24, "\x2c\x00\x4b\x17\x59\x5e\x1b\x08\x9b\x19\xd0\x64\x60\xfc\x5e\x16\x71\xec" "\x2a\xb1\x28\x16\xcd\x15\xfb\x9a\x2f\x24\x75\xad\x82\x91\x12\xc3\xd8\x39" "\x99\xcf\xa7\xda\xfd\x6e\x9f\x99\x4b\xce\x8c\x62\x9a\x6e\xa5\xc2\x8a\xd3" "\x7f\xff\xff\xff\xff\xff\xff\xff\x5d\x2b\x57\xbd\x24\xe0\xd2\xc3\x79\xfc" "\x2d\x09\xa9\x08\xea\xe0\x00\xd9\x3a\xe0\x00\x00\x00\x00\x00\x00\x4e\xf4" "\xc9\xa3\xc2\x50\xc7\xc8\xb0\x86\x7d\xc6\xed\xdd\x41\x05\x60\x7a\x13\x04" "\x00\x17\xa7\x2e\x99\xf7\xc5\x60\xff\x8d\x16\x67\x14\x0b\x15\xc5\x93\x8f" "\x54\xbd\x13\xd3\xd9\x24\x98\x85\x5c\xed\x1e\x4f\x21\x64\x55\x97\x5f\x22" "\x93\x35\x94\x10\x6f\xab\xc6\x4f\x97\x28\x2f\xda\xb6\x38\xd6\xe2\xc7\xaf" "\x0d\x0a\x7b\x0a\x41\x0e\x31\x2d\x3d\xc1\xeb\xb9\x3b\x13\x20\x00\x75\xe0" "\xb5\x1b\xba\x6d\x0c\x2a\x2f\x8c\x5f\x54\x57\x4d\xf1\x36\x9b\x10\xd5\x6a" "\xbe\xda\x6e\x9d\xdc\xcc\xaa\x86\x30\x8f\x13\xaa\x8c\x69\x5e\xef\x32\x08" "\x56\x42\xc0\xfc\x56\xcf\x2b\xb8\x3f\xc8\x8e\x87\x02\xdd\xec\xc1\xeb\x2d" "\x44\xdc\xa0\xe3\xa1\x40\xdd\xff\x99\xd6\xbf\x00\x6c\xa4\x4f\x76\x12\x00" "\x93\x13\x03\xcc\xfc\x21\x91\x3f\x23\x6c\xfe\xe5\x4d\x6f\xe1\x9e\x5c\x1a" "\x19\x93\x38\xd4\x77\xd2\x23\x7c\x48\xa3\x97\xa8\x45\x9e\x06\x46\xea\x70" "\x88\x76\xd1\xbc\xc2\xff\xca\xae\x6a\x67\x9f\xd9\x1c\x16\x43\xed\xdb\xfe" "\xeb\x01\x11\x61\x93\x83\x5e\x3f\x7d\xcd\xdf\x1b\x06\x04\xc8", 321); memcpy( (void*)0x20000dc0, "\x78\x9c\xec\xdc\xcb\x6f\x1b\xc5\x1f\x00\xf0\xef\xae\xe3\xf4\xf7\xeb\x83" "\x84\x52\x1e\x2d\x05\x0c\x05\x11\xf1\x48\x9a\xb4\x40\x0f\x5c\x40\x20\x40" "\x02\x09\x09\x0e\xe5\x18\x92\xb4\x2a\x75\x1b\xd4\x04\x89\x56\x05\x0a\x42" "\xe5\x88\x2a\x71\x47\x88\x13\x12\x7f\x01\x27\xb8\x20\xe0\x84\xd4\x2b\xdc" "\x51\xa5\x0a\xf5\xd2\xc2\xc9\x68\xed\xdd\xc6\x8d\xe3\x36\x76\x1e\x4e\xe3" "\xcf\x47\xda\x76\x66\x77\xec\x99\xaf\x67\xc7\x99\xdd\xb1\x1d\x40\xdf\xaa" "\x64\xff\x24\x11\xdb\x23\xe2\x8f\x88\x18\x6a\x64\x6f\x2c\x50\x69\xfc\x77" "\xed\xca\xd9\xa9\x7f\xae\x9c\x9d\x4a\xa2\x56\x7b\xeb\xef\xa4\x5e\xee\xea" "\x95\xb3\x53\x45\xd1\xe2\x71\xdb\xf2\xcc\x48\x1a\x91\x7e\x9e\x2c\x7a\xc2" "\x86\xb9\xd3\x67\x8e\x4f\x56\xab\x33\xa7\xf2\xfc\xd8\xfc\x89\xf7\xc7\xe6" "\x4e\x9f\x79\xfa\xd8\x89\xc9\xa3\x33\x47\x67\x4e\x4e\x1c\x3a\x74\xf0\xc0" "\xf8\x73\xcf\x4e\x3c\xb3\x2a\x71\x66\x71\x5d\xdd\xf3\xf1\xec\xde\xdd\xaf" "\xbe\x73\xe1\x8d\xa9\xc3\x17\xde\xfd\xf5\xfb\xac\x59\xdb\xf3\xe3\xcd\x71" "\x2c\xe1\xdb\x57\xba\xa8\xb3\x12\x95\xa5\x42\xaf\x7b\xac\x8b\xe7\xdb\xc8" "\x76\x34\xa5\x93\x81\x1e\x36\x84\x8e\x94\x22\x22\xeb\xae\x72\x7d\xfc\x0f" "\x45\x29\x16\x3a\x6f\x28\x5e\xfe\xac\xa7\x8d\x03\xd6\x54\xad\x56\xab\x6d" "\x69\x7f\xf8\x5c\x0d\xd8\xc4\x92\xe8\x75\x0b\x80\xde\x28\xfe\xd0\x67\xd7" "\xbf\xc5\xb6\x4e\x53\x8f\x0d\xe1\xf2\x0b\x8d\x0b\xa0\x2c\xee\x6b\xf9\xd6" "\x38\x32\x10\x69\x5e\xa6\xbc\xe8\xfa\x76\x35\x55\x22\xe2\xf0\xb9\x7f\xbf" "\xce\xb6\xb8\xf5\x7d\x08\x00\x80\x15\xfb\x31\x9b\xff\x3c\x55\x9f\x77\xbc" "\x36\x18\xd1\x34\xff\x4b\xe3\x9e\xa6\x72\x77\xe4\x6b\x28\xc3\x11\x71\x67" "\x44\xec\x8c\x88\xbb\x22\x62\x57\x44\xdc\x1d\x51\x2f\x7b\x6f\x44\xdc\xd7" "\x61\xfd\x95\x45\xf9\xd6\xf9\x4f\x7a\xa9\xab\xc0\x96\x29\x9b\xff\x3d\x9f" "\xaf\x6d\xdd\x38\xff\x2b\x66\x7f\x31\x5c\xca\x73\x3b\xea\xf1\x97\x93\x23" "\xc7\xaa\x33\xfb\xf3\xd7\x64\x24\xca\x5b\xb2\xfc\x78\x51\xfa\x62\x6b\x1d" "\x3f\xbd\x74\xf1\xcb\x76\xf5\x37\xcf\xff\xb2\x2d\xab\xbf\x98\x0b\xe6\xed" "\xb8\x34\xb0\xe8\x06\xdd\xf4\xe4\xfc\xe4\x4a\xe3\x2e\x5c\xfe\x34\x62\xcf" "\x40\x73\xfc\xb5\x7c\xc9\x2a\xb9\xbe\x12\x90\xed\xd8\x1d\x11\x7b\xba\xac" "\xe3\xd8\x13\xdf\xed\x6d\x77\xec\xd6\xf1\xdf\xc4\x2a\xac\x33\xd5\xbe\x89" "\x78\xbc\xd1\xff\xe7\xe2\x86\xfe\x5f\x58\xb9\x4b\x6e\xbe\x3e\x39\xf6\xbf" "\xa8\xce\xec\x1f\x2b\xce\x8a\x56\xbf\xfd\x7e\xfe\xcd\x76\xf5\xaf\x28\xfe" "\x55\x90\xf5\xff\xd6\x25\xcf\xff\xeb\xf1\x0f\x27\xcd\xeb\xb5\x73\x9d\xd7" "\x71\xfe\xcf\x2f\xda\x5e\xd3\x74\x7b\xfe\x0f\x26\x6f\xd7\xd3\x83\xf9\xbe" "\x0f\x27\xe7\xe7\x4f\x8d\x47\x0c\x26\xaf\xb7\xee\x9f\x58\x78\x6c\x91\x2f" "\xca\x67\xf1\x8f\xec\x5b\x7a\xfc\xef\x8c\x85\x57\xe2\xfe\x88\xc8\x4e\xe2" "\x07\x22\xe2\xc1\x88\x78\x28\x6f\xfb\xc3\x11\xf1\x48\x44\xec\xbb\x49\xfc" "\xbf\xbc\xf8\xe8\x7b\xdd\xc7\xbf\xb6\xb2\xf8\xa7\x3b\xea\xff\xce\x13\xa5" "\xe3\x3f\xff\xd0\xae\xfe\xd6\xf8\x3f\x8a\xd6\xfe\x3f\x58\x4f\x8d\xe4\x7b" "\x96\xf3\xfe\xb7\xdc\x06\xae\xe4\xb5\x03\x00\x00\x80\xdb\x45\x5a\xff\x0c" "\x7c\x92\x8e\x5e\x4f\xa7\xe9\xe8\x68\xe3\x33\xfc\xbb\x62\x6b\x5a\x9d\x9d" "\x9b\x7f\xf2\xc8\xec\x07\x27\xa7\x1b\x9f\x95\x1f\x8e\x72\x5a\xdc\xe9\x1a" "\x6a\xba\x1f\x3a\x9e\xdf\x1b\x2e\xf2\x13\x8b\xf2\x07\xf2\xfb\xc6\x5f\x95" "\xfe\x5f\xcf\x8f\x4e\xcd\x56\xa7\x7b\x1d\x3c\xf4\xb9\x6d\x6d\xc6\x7f\xe6" "\xaf\x52\xaf\x5b\x07\xac\x39\xdf\xd7\x82\xfe\x65\xfc\x43\xff\x32\xfe\xa1" "\x7f\x19\xff\xd0\xbf\x8c\x7f\xe8\x5f\x4b\x8d\xff\x4f\x7a\xd0\x0e\x60\xfd" "\x35\xc6\x7f\xbb\x9f\xaa\x03\x36\x33\xf3\x7f\xe8\x5f\xc6\x3f\xf4\xaf\xce" "\xc7\xbf\x77\x0c\xd8\x04\x56\xf2\xbd\xfe\xdb\x2f\x91\x2e\xfb\x77\x01\x3a" "\x4d\x94\x37\x46\x80\xeb\x98\x88\x74\x43\x34\x43\x62\x8d\x12\xbd\x7e\x67" "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x58\x1d\xff\x05\x00\x00" "\xff\xff\x7f\xaa\xe4\x4a", 1104); syz_mount_image(/*fs=*/0x20000440, /*dir=*/0x20000000, /*flags=*/0x10000, /*opts=*/0x20000a80, /*chdir=*/-1, /*size=*/0x450, /*img=*/0x20000dc0); memcpy((void*)0x20000100, "./file1\000", 8); memcpy((void*)0x20000140, "user.incfs.metadata\000", 20); memcpy( (void*)0x20000480, "\x3b\xca\x3e\x8e\xec\x60\xdb\x6d\xa7\x28\xee\x8e\x29\xfa\x02\xfa\x21\x03" "\x9b\x37\x80\xdd\x17\x54\x0b\xcd\xff\x62\xd7\x13\x4b\xa5\x3e\x25\xf5\x9a" "\xf9\x2d\xd4\x65\xa8\x39\x65\x8e\xad\x1f\x48\xc4\x42\xf9\x96\x01\x68\x49" "\x56\xb1\x12\x67\xdb\x59\xfd\x65\x72\x81\xe9\x0a\x34\xe6\x3a\x4a\x3f\xeb" "\x92\xde\x49\xe5\x7c\xea\x7f\xec\x40\xeb\x97\x08\xd5\xc4\x39\x65\xc6\xae" "\x13\x8b\x7e\x6a\xe8\x40\x58\x14\x26\x34\xbf\xb2\x2b\xe1\xc2\x62\xe7\x5b" "\x98\x69\x2e\xbb\xd5\x02\x76\x6a\xf2\x62\xe3\x85\x70\x31\xe2\x8c\x9e\x0e" "\xa0\xac\xd5\xd9\x95\x31\xbf\x21\xf4\x9f\xa0\xf3\xb9\x58\xe9\xcd\x78\x66" "\x74\x0e\xb7\xfe\x03\x6c\x44\x52\x06\x6c\x54\xd0\x84\x5e\xdd\x55\xb9\x3b" "\x80\x5c\xdc\xbe\x28\x16\x63\xc9\x3f\x8c\x01\x08\x77\x20\xa1\x8e\x3f\x1d" "\x82\xb1\x9a\xad\x5b\xe2\x1d\xe0\x78\x07\x76\x63\xca\xbf\x60\x7f\x2f\xf2" "\x84\x6e\x36\xec\xd7\xb7\xa6\x62\x73\x1a\x5f\x5a\x67\xaa\xaa\x6e\x78\x5e" "\xc8\x93\xd6\x0c\x85\x1d\xb1\x5c\x0e\x9c\x0a\x87\x52\xbc\xa0\x84\x48\x8a" "\xed\xb9\x45\x40\x4c\xe9\x90\x74\x1b\x52\x2e\x99\x15\x4e\x36\x25\xfe\x9d" "\x3f\x9c\xe4\xb7\x6b\xb2\x1b\x5c\x92\x69\xb3\xf1\xf8\x87\x99\x67\xc6\xf3" "\x69\x92\x95\x05\xaf\xa0\x86\xb8\x97\xc6\x95\xab\xa3\xc9\xaa\xce\x09\x08" "\x52\x8c\xa6\xf4\xa5\x2b\xe8\x3b\x2d\xfd\x4d\x2c\xb4\x9a\xde\x14\x12\x34" "\xc7\x9a\xc1\x77\x38\x04\x8c\x2e\xae\x33\x56\x3a\x29\x53\x1c\x5b\xe9\xa6" "\x12\x03\xe1\x14\x60\xef\xce\x6d\xdc\xa4\x36\xb9\x36\x93\x07\x6b\x8a\x26" "\x77\x33\x83\x0c\x98\x14\x22\x9b\x5d\x0d\xd4\xc3\x8f\x6f\x1e\x15\xa0\x21" "\x11\x45\x30\x16\xdc\x88\x95\x4c\x1b\x53\x37\x03\x31\xf7\x44\xea\xd6\x58" "\x9b\xd2\x50\x8b\x45\x95\x26\x71\x28\xdf\x30\xcb\xeb\x47\x57\x83\x7b\xcc" "\xfb\x15\xa9\xa4\x52\x7d\xcc\xd3\xf4\x18\xc6\xbd\xb0\x4a\xcb\x3d\xb3\x01" "\xb4\x6d\x59\x5a\xc1\x87\xae\x1b\x7c\x0e\x22\x9f\xe6\x19\x49\x53\x7b\xee" "\xe1\x70\x28\x0b\x22\x83\xcd\xe3\x3a\x2a\xd0\x25\x91\x76\x66\xcd\x39\xd9" "\x2d\xab\xfd\x4f\x79\x5a\x03\x91\x7a\x9c\x78\x58\x2e\x6c\x01\xa0\xa3\xfa" "\xb4\x1c\xc8\x78\x4d\x38\xda\xfb\xaa\x00\xad\x88\x3e\x45\x8f\x85\x77\xc8" "\xd5\x77\x1d\xbe\xa6\x81\x50\x2e\x1a\x59\x36\x42\x82\x2c\x16\xed\xac\x3d" "\xeb\x54\x2a\x08\xff\x9b\x2e\x19\x15\xb3\x88\xfa\x58\x1c\x40\x19\x97\xa2" "\xa4\x60\x2d\xfd\x46\x13\xca\x70\xba\x37\xec\xb8\x3e\x4e\x80\x6d\xf4\xac" "\xe9\xd2\x74\xd0\x9f\x50\x70\x4b\x90\x58\x5f\x76\xe4\x92\x62\x80\xcd\x30" "\x07\xa8\x42\x71\xc1\x5b\x1b\xbe\x1d\x26\x3b\x2c\x3a\xf5\x35\x08\xb5\x6d" "\xa6\x10\x1d\xa2\x69\x1f\x57\x9f\xc0\xff\x29\x55\xcc\x51\xfa\xf8\xfe\x70" "\x9d\xce\x54\xfa\x06\xb2\x92\x64\x62\x27\xa2\x61\xf0\xb8\xd0\x5f\x55\xf2" "\xbc\xf5\x01\xd1\x96\x57\xea\x01\xe5\xda\xac\xfb\x27\x3d\x1c\x9c\x58\x2f" "\xd8\x5f\xc7\xf0\xfc\x2c\xf5\x2d\xdf\x45\x93\xee\xef\xd4\x3a\x8b\x40\x49" "\x28\x32\x18\x8d\x42\x01\x00\xff\xff\x22\xdd\x80\xc8\x74\xf1\xdb\xc7\x3f" "\xa2\xf2\x84\x62\xf3\x21\xee\x23\xd7\x9a\x61\x1a\xd5\x1f\x2e\x91\xce\xba" "\xb7\x8e\xf4\xf3\x22\xcd\xd1\xa8\x23\xff\x9f\x98\xbd\x62\x1e\x94\x27\x4e" "\x5d\x2f\x07\x8c\x8d\x07\xef\x43\x3f\x94\xa0\xca\xa8\x0a\xb8\x4f\xc7\x17" "\xce\x9e\x27\x87\x26\x72\x5d\x79\xb0\x9d\x94\x9b\x09\xce\x84\x6b\x29\x7c" "\xa3\x59\x8c\xfa\x94\xec\xd0\xbf\x9b\xbd\xb2\x1c\x2e\x32\x06\xf9\x12\x31" "\x27\x51\x51\xed\x5f\x2b\x23\x94\x42\x94\x5a\x12\x0c\xd1\x78\xcf\x5f\x6f" "\xb9\x25\xab\x8c\xab\x89\xe2\x8b\xe3\x1d\xa5\xfc\x7b\x9b\xfc\x3a\x8b\xae" "\x77\x35\xf4\x6a\x98\x8f\xe0\x2c\x38\xe7\xf3\xcc\x4a\xaa\x8e\xdb\x4c\x9c" "\xc7\x4d\x25\x16\x19\x4a\x98\xb6\x56\xf6\xd0\xbe\x6b\x49\x51\xa4\xc3\x24" "\x03\x00\x00\x00\x10\x05\xd8\x58\xac\xc1\xda\x0d\xcc\xb8\x94\xb4\x00\x00" "\x00\x00\x00\x00\xd0\x91\x84\xae\x94\x45\x11\x8e\x33\x02\x54\x22\x35\xe6" "\x6e\xf6\xc8\x52\xff\xf7\x3f\xc7\xd5\xd9\xd8\xa2\xab\xac\xa9\xa3\x5b", 881); syscall(__NR_setxattr, /*path=*/0x20000100ul, /*name=*/0x20000140ul, /*val=*/0x20000480ul, /*size=*/0x371ul, /*flags=*/0ul); memcpy((void*)0x20000400, "./file1\000", 8); syscall(__NR_creat, /*file=*/0x20000400ul, /*mode=*/8ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); use_temporary_dir(); loop(); return 0; }