// https://syzkaller.appspot.com/bug?id=0a52da0bbfd5ff2cd097edb1607fd2bda63a1c4d // 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, 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; } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW; retry: while (umount2(dir, umount_flags) == 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, umount_flags) == 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, umount_flags)) 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, umount_flags)) 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 (;;) { 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; } remove_dir(cwdbuf); } } void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x200000000040, "ext4\000", 5); memcpy((void*)0x200000000a00, "./file0\000", 8); memcpy((void*)0x200000000080, "nouid32", 7); *(uint8_t*)0x200000000087 = 0x2c; memcpy((void*)0x200000000088, "bsdgroups", 9); *(uint8_t*)0x200000000091 = 0x2c; memcpy((void*)0x200000000092, "nogrpid", 7); *(uint8_t*)0x200000000099 = 0x2c; memcpy((void*)0x20000000009a, "noblock_validity", 16); *(uint8_t*)0x2000000000aa = 0x2c; *(uint8_t*)0x2000000000ab = 0; memcpy( (void*)0x2000000000c0, "\x78\x9c\xec\xdd\xcf\x6f\x23\x57\x1d\x00\xf0\xef\x38\x71\x76\xf3\x63\x9b" "\x14\x38\x40\x25\xda\x42\x5b\x65\x57\xb0\x76\xd2\xa8\x6d\xc4\xa1\xb4\x12" "\x82\x53\x25\xa0\xdc\x97\x90\x38\x51\x14\x27\x5e\xc5\x4e\xbb\x89\x2a\x9a" "\x85\x3f\x00\x09\x21\x40\xe2\x04\x17\x2e\x48\xfc\x01\x20\x54\x89\x0b\x47" "\x84\x54\x09\xce\x20\x40\x20\x04\x5b\x38\x80\x44\x77\xd0\xd8\xe3\xfc\xb4" "\x93\xd0\xf5\xda\xd9\xe4\xf3\x91\x66\xe7\xcd\x7b\x7e\xf3\x7d\xcf\xbb\x33" "\x9e\x37\x33\x3b\x13\xc0\xa5\xf5\x4a\x3e\xdd\x4f\xd3\xf4\x46\x44\x4c\xe6" "\xf9\x85\x7c\xfa\x64\xb6\xb0\x1b\xf1\x74\x44\xbc\x77\xef\xad\xc5\x6c\x4a" "\x22\x4d\x5f\xff\x7b\x12\x49\x9e\xd7\x5e\x57\xda\x74\x25\xc6\x5b\x55\x9a" "\x2b\xf8\xf2\x17\x22\xbe\x96\x1c\x8f\x5b\xdf\xde\x59\x5b\xa8\x56\x2b\x9b" "\xf9\x72\xb9\xb1\x7e\xbb\x5c\xdf\xde\xb9\xb9\xba\xbe\xb0\x52\x59\xa9\x6c" "\xcc\xcd\xcd\xbe\x38\xff\xd2\xfc\x0b\xf3\x33\x0f\xd2\xbd\xe5\xf1\x3c\x71" "\x2d\x22\x5e\xfe\xdc\x9f\xbf\xfb\xad\x1f\x7f\xfe\xe5\x5f\x7c\xfa\xcd\x3f" "\xdc\xfa\xeb\xf5\xaf\x27\xad\x36\xbf\x7d\xb4\x1f\xb9\x6f\x9c\x31\xc6\xd0" "\x49\x85\xad\xef\xb3\x18\x57\x0f\xe4\x65\xf1\x36\xff\x9f\x5e\x9c\x73\xc3" "\x07\x13\xa3\x67\xab\x73\x37\xff\x27\x02\x00\x40\x7f\x65\xc7\xa5\x1f\xca" "\x8f\xf3\x6f\xc4\x64\x0c\xed\x1f\xcd\x01\x00\x00\x00\x17\x44\xfa\xd9\x89" "\xf8\x6f\xd2\xbe\x76\x77\xcc\x48\x97\x7c\x00\x00\x00\xe0\x11\x52\x88\x88" "\x89\x48\x0a\xa5\xfc\x7e\xdf\x89\x28\x14\x4a\xa5\x68\xde\xc3\xfb\x91\x18" "\x2b\x54\x6b\xf5\xc6\xa7\x96\x6b\x5b\x1b\x4b\x59\x59\xc4\x54\x14\x0b\xcb" "\xab\xd5\xca\x4c\x7e\x6f\xeb\x54\x14\x93\x6c\x79\x36\x4b\xff\xfc\xfd\x34" "\xcd\x97\x9f\x6f\x96\xed\x97\xcf\x45\xc4\xe3\x11\xf1\x9d\xc9\xd1\xe6\x72" "\x69\xb1\x56\x5d\x1a\xf4\xc9\x0f\x00\x00\x00\xb8\x24\xc6\x8f\x8c\xff\xff" "\x35\xd9\x1a\xff\x03\x00\x00\x00\x17\xcc\x54\xe7\xec\x2b\xfd\x6e\x07\x00" "\x00\x00\xf0\xf0\x74\x19\xff\x03\x00\x00\x00\x17\x88\xf1\x3f\x00\x00\x00" "\x5c\x68\x5f\x7c\xed\xb5\x6c\x4a\xdb\xef\xbf\x5e\x7a\x63\x7b\x6b\xad\xf6" "\xc6\xcd\xa5\x4a\x7d\xad\xb4\xbe\xb5\x58\x5a\xac\x6d\xde\x2e\xad\xd4\x6a" "\x2b\xcd\x67\xf6\xad\x9f\xb8\xb2\xbd\x57\x07\x6e\x6c\xdd\x29\x37\x2a\xf5" "\x46\xb9\xbe\xbd\x73\x6b\xbd\xb6\xb5\xd1\xb8\xb5\x7a\xe8\x15\xd8\x00\x00" "\x00\x40\x1f\x3d\xfe\xd4\x3b\xbf\x4b\x22\x62\xf7\x33\xa3\xcd\x29\x33\x72" "\xa0\xfc\x3f\xf9\x7b\x02\x06\xd6\x40\xe0\xa1\xd9\x3b\x65\x17\x49\x3e\x1f" "\x39\xfe\xa1\xdf\x3f\xd6\x9a\xff\xa9\x4f\x8d\x02\xfa\x62\x68\xd0\x0d\x00" "\x06\x66\x78\xd0\x0d\x00\x06\xa6\x38\xe8\x06\x00\x03\x97\x9c\x52\xde\xf5" "\xe6\x9d\x5f\xe7\xf3\x4f\xf4\xb6\x3d\x00\x00\x40\xef\x4d\x7f\xac\xfb\xf5" "\xff\xc2\x89\x35\x77\x4f\x2e\x06\xce\x3d\x1b\x31\x5c\x5e\xae\xff\xc3\xe5" "\xd5\xbc\xfe\xdf\xe1\x96\xbf\x8e\x1c\x2c\xc0\x85\x52\x74\x04\x00\x97\xde" "\x03\x5f\xff\x3f\x95\xff\x43\x04\x00\x00\x83\x36\xd1\x9c\x92\x42\x29\x3f" "\xbd\x37\x11\x85\x42\xa9\x14\x71\xad\xf9\x5a\x80\x62\xb2\xbc\x5a\xad\xcc" "\x44\xc4\x63\x11\xf1\xdb\xc9\xe2\x95\x6c\x79\xb6\x59\x33\x39\x75\xcc\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\xb4\xa4\x69\x12\x29\x00\x00\x00\x70\xa1\x45\x14\xfe\x92\xfc\xb2\xf5" "\x2c\xff\xe9\xc9\x67\x27\x8e\x9e\x1f\x18\x49\xfe\x3d\x19\xf9\x2b\x42\xdf" "\xfc\xc1\xeb\xdf\xbb\xb3\xd0\x68\x6c\xce\x66\xf9\xff\xd8\xcb\x6f\x7c\x3f" "\xcf\x7f\x7e\x10\x67\x30\x00\x00\x00\x80\xa3\xda\xe3\xf4\xf6\x38\x1e\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x7a\xe9\xbd\x7b\x6f\x2d\xb6\xa7\x7e\xc6\xfd\xdb\xab\x11\x31\xd5\x29\xfe" "\x70\x5c\x6d\xce\xaf\x46\x31\x22\xc6\xfe\x99\xc4\xf0\x81\x7a\x49\x44\x0c" "\xf5\x20\xfe\xee\xdd\x88\xf8\x68\xa7\xf8\x49\xd6\xac\xbd\x90\x9d\xe2\x8f" "\x3e\xfc\xf8\x31\x95\x7f\x0b\x9d\xe2\x8f\xf7\x20\x3e\x5c\x66\xef\x64\xfb" "\x9f\x57\x3a\x6d\x7f\x85\x78\xba\x39\xcf\xb7\xbf\xc2\xe1\x7a\xc3\x11\x87" "\xb6\xc7\x0f\xaa\xfb\xfe\x2f\xf6\xf6\x7f\x43\x5d\xb6\xff\x6b\x67\x8c\xf1" "\xc4\xbb\x3f\x2d\x77\x8d\x7f\x37\xe2\x89\xe1\xce\xfb\x9f\x76\xfc\xa4\x4b" "\xfc\x67\xce\x18\xff\xab\x5f\xd9\xd9\xe9\x56\x96\xfe\x30\x62\xba\xe3\xef" "\x4f\x72\x28\x56\xb9\xb1\x7e\xbb\x5c\xdf\xde\xb9\xb9\xba\xbe\xb0\x52\x59" "\xa9\x6c\xcc\xcd\xcd\xbe\x38\xff\xd2\xfc\x0b\xf3\x33\xe5\xe5\xd5\xb1\x4a" "\xf6\x67\xb5\x32\xd3\x31\xc6\xb7\x3f\xfe\xb3\xfb\x27\xf5\x7f\xac\x4b\xfc" "\xa9\x53\xfa\xff\xec\x19\xfb\xff\xfe\xbb\x77\xee\x7d\xb8\x95\x2c\x76\x8a" "\x7f\xfd\x99\x0e\xf1\x7f\xf5\xa3\xfc\x13\xc7\xe3\x17\xf2\xdf\xbe\xe7\xf2" "\x74\x56\x3e\xdd\x4e\xef\xb6\xd2\x07\x3d\xf9\x93\xdf\x3c\x79\x52\xff\x97" "\xba\xf4\xff\xb4\xbf\xff\xeb\x67\xec\xff\x8d\x2f\x7d\xf3\x8f\x67\xfc\x28" "\x00\xd0\x07\xf5\xed\x9d\xb5\x85\x6a\xb5\xb2\x99\x27\x62\x37\xe2\x70\xce" "\xa3\x9e\xc8\x46\xe9\xe7\xa0\x19\xe7\x36\x31\x15\xe7\xa2\x19\x03\x49\xbc" "\x7d\xbc\xe8\xa9\xe8\x5a\x2b\x49\x4e\x5e\x61\x9a\xa6\x69\xb6\x4d\x3d\x40" "\xc3\x92\xee\xd1\xfb\x93\x48\xf6\x72\x06\xbd\x67\x02\x00\x00\x7a\x6d\xff" "\xe8\x7f\x3f\xef\xd5\xe7\x06\xd9\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xb8\x7c\xfa\xf1\x5c\xb1\xa3\x31\x77\xf7\x52\x49" "\x2f\x1e\xa1\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xd0\x13\xff\x0b\x00\x00\xff\xff\xbe\x84" "\xe9\x7a", 1334); syz_mount_image( /*fs=*/0x200000000040, /*dir=*/0x200000000a00, /*flags=MS_SYNCHRONOUS|MS_STRICTATIME|MS_SILENT|MS_RDONLY|0x402*/ 0x1008413, /*opts=*/0x200000000080, /*chdir=*/0, /*size=*/0x537, /*img=*/0x2000000000c0); memcpy((void*)0x200000000180, "ext4\000", 5); memcpy((void*)0x200000000000, "./bus\000", 6); memcpy((void*)0x200000000400, "max_dir_size_kb", 15); *(uint8_t*)0x20000000040f = 0x3d; sprintf((char*)0x200000000410, "0x%016llx", (long long)0x1000); *(uint8_t*)0x200000000422 = 0x2c; memcpy((void*)0x200000000423, "nodiscard", 9); *(uint8_t*)0x20000000042c = 0x2c; memcpy((void*)0x20000000042d, "quota", 5); *(uint8_t*)0x200000000432 = 0x2c; *(uint8_t*)0x200000000433 = 0; memcpy( (void*)0x200000000c00, "\x78\x9c\xec\xdd\xcf\x6f\x1c\x57\x1d\x00\xf0\xef\x8c\x7f\x36\x49\xeb\x04" "\x7a\x80\x0a\x48\x80\x42\x40\x51\x76\xe3\x4d\x1b\x55\xbd\xb4\x5c\x40\xa8" "\xaa\x84\xa8\x38\x20\x0e\xa9\xb1\x37\x96\xc9\x6e\x36\x64\xd7\xa5\x36\x91" "\x70\xff\x06\x90\x40\xe2\x04\x7f\x02\x07\x24\x0e\x48\x3d\x71\x80\x13\x47" "\x24\x0e\x80\x28\x07\xa4\x02\x11\x28\x46\xea\x61\xd0\xcc\x8e\xed\x8d\xbd" "\x26\x8b\xbd\xde\x25\xde\xcf\x47\x9a\xcc\x8f\x37\x33\xdf\xf7\x76\x33\xf3" "\xde\xbe\x5d\xcf\x0b\x60\x62\x5d\x8a\x88\xad\x88\x98\x8d\x88\x37\x23\x62" "\xa1\xdc\x9e\x94\x53\xbc\xda\x9d\xf2\xfd\x1e\x3e\xb8\xbf\xbc\xfd\xe0\xfe" "\x72\x12\x59\xf6\xc6\xdf\x93\x22\x3d\xdf\x16\x3d\xc7\xe4\xce\x96\xe7\x9c" "\x8f\x88\xaf\x7e\x29\xe2\x9b\xc9\xc1\xb8\xed\x8d\xcd\xdb\x4b\x8d\x46\xfd" "\x5e\xb9\x5e\xed\x34\xef\x56\xdb\x1b\x9b\x57\xd7\x9a\x4b\xab\xf5\xd5\xfa" "\x9d\x5a\xed\xc6\xe2\x8d\x6b\x2f\x5d\x7f\xb1\x36\xb4\xb2\x5e\x6c\xfe\xec" "\xfd\x2f\xae\xbd\xf6\xb5\x5f\xfe\xe2\xe3\xef\xfd\x76\xeb\xf3\xdf\xcd\xb3" "\x75\xae\x4c\xeb\x2d\xc7\x30\x75\x8b\x3e\xb3\x1b\x27\x37\x1d\x11\xaf\x9d" "\x44\xb0\x31\x98\x2a\xe7\xb3\x63\xce\x07\x47\x93\x46\xc4\x87\x22\xe2\x53" "\xc5\xf5\xbf\x10\x53\xc5\xff\x4e\x00\xe0\x34\xcb\xb2\x85\xc8\x16\x7a\xd7" "\x01\x80\xd3\x2e\x2d\xfa\xc0\x92\xb4\x12\x11\x69\x5a\x36\x02\x2a\xdd\x3e" "\xbc\x67\xe3\x4c\xda\x68\xb5\x3b\x57\x6e\xb5\xd6\xef\xac\x74\xfb\xca\xce" "\xc7\x4c\x7a\x6b\xad\x51\xbf\x76\x61\xee\xf7\xdf\x2e\x76\x9e\x49\xf2\xf5" "\xc5\x22\xad\x48\x2f\xd6\x6b\xfb\xd6\xaf\x47\xc4\x85\x88\xf8\xc1\xdc\x53" "\xc5\x7a\x65\xb9\xd5\x58\x19\x4f\x93\x07\x00\x26\xde\xd9\xde\xfa\x3f\x22" "\xfe\x35\x97\xa6\x95\xca\x40\x87\xf6\xf9\x56\x0f\x00\x78\x62\xcc\x8f\x3b" "\x03\x00\xc0\xc8\xa9\xff\x01\x60\xf2\xa8\xff\x01\x60\xf2\x0c\x50\xff\x97" "\x5f\xf6\x6f\x9d\x78\x5e\x00\x80\xd1\xf0\xf9\x1f\x00\x26\x8f\xfa\x1f\x00" "\x26\x8f\xfa\x1f\x00\x26\xca\x57\x5e\x7f\x3d\x9f\xb2\xed\xf2\xf9\xd7\x2b" "\x6f\x6d\xac\xdf\x6e\xbd\x75\x75\xa5\xde\xbe\x5d\x69\xae\x2f\x57\x96\x5b" "\xf7\xee\x56\x56\x5b\xad\xd5\xe2\x99\x3d\xcd\xc7\x9d\xaf\xd1\x6a\xdd\x5d" "\x7c\x21\xd6\xdf\xae\x76\xea\xed\x4e\xb5\xbd\xb1\x79\xb3\xd9\x5a\xbf\xd3" "\xb9\x59\x3c\xd7\xfb\x66\x7d\x66\x24\xa5\x02\x00\xfe\x9b\x0b\x17\xdf\xfd" "\x5d\x12\x11\x5b\x2f\x3f\x55\x4c\xd1\x33\x96\x83\xba\x1a\x4e\xb7\x74\x88" "\x7b\x01\x4f\x96\xa9\xe3\x1c\xac\x81\x00\x4f\x34\xa3\x7d\xc1\xe4\x1a\xa8" "\x0a\x2f\x1a\x09\xbf\x3e\xf1\xbc\x00\xe3\xd1\xf7\x61\xde\xf3\x7d\x17\x1f" "\xf5\xa3\xff\x21\x88\xdf\x19\xc1\xff\x95\xcb\x1f\x1d\xbc\xff\xdf\x18\xcf" "\x70\xba\xec\xeb\xd9\xff\x20\x1b\x57\x46\x80\x91\x3b\x5a\xff\xff\x2b\x43" "\xcf\x07\x30\x7a\x47\xee\xff\xff\xe3\x70\xf3\x01\x8c\x5e\x96\x25\xfb\xc7" "\xfc\x9f\xdd\x4d\x02\x00\x4e\xa5\x63\xfc\x84\x2f\xfb\xde\xb0\x1a\x21\xc0" "\x58\x3d\x6e\x30\xef\xa1\x7c\xff\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa7\xcc\xb9" "\x88\xf8\x56\x24\x69\xa5\x18\x0b\x3c\xcd\xff\x4d\x2b\x95\x88\xa7\x23\xe2" "\x7c\xcc\x24\xb7\xd6\x1a\xf5\x6b\x11\xf1\x4c\x5c\x8c\x88\x99\xb9\x7c\x7d" "\x71\xdc\x99\x06\x00\x8e\x29\xfd\x6b\x52\x8e\xff\x75\x79\xe1\xf9\x73\xfb" "\x53\x67\x93\x7f\xcf\x15\xf3\x88\xf8\xce\x8f\xdf\xf8\xe1\xdb\x4b\x9d\xce" "\xbd\xc5\x7c\xfb\x3f\x76\xb7\xcf\xed\x0c\x1f\x56\xdb\x3b\xee\x18\xe3\x0a" "\x02\x00\x83\xfb\xf3\x20\x3b\x15\xf5\x77\xad\x9c\xf7\x7c\x90\x7f\xf8\xe0" "\xfe\xf2\xce\x74\x82\x79\x3c\xe0\xfd\x2f\xec\x0e\x3e\xba\xbc\xfd\xe0\x7e" "\x31\x75\x53\xa6\x23\xcb\xb2\x2c\x62\xbe\x68\x4b\x9c\xf9\x67\x12\xd3\xe5" "\x31\xf3\x11\xf1\x5c\x44\x4c\x0d\x21\xfe\xd6\x3b\x11\xf1\x91\x7e\xe5\x4f" "\x8a\xbe\x91\xf3\xe5\xc8\xa7\xbd\xf1\xa3\x8c\xfd\xf4\x48\xe3\xa7\x8f\xc4" "\x4f\x8b\xb4\xee\x3c\x7f\xf9\x3e\x3c\x84\xbc\xc0\xa4\x79\x37\xbf\xff\xbc" "\xda\xef\xfa\x4b\xe3\x52\x31\xef\x7f\xfd\xcf\x17\x77\xa8\xe3\x2b\xee\x7f" "\xf3\x11\x3b\xf7\xbe\xed\x9e\xf8\xd3\x65\xa4\xa9\x3e\xf1\xf3\x6b\xfe\xd2" "\xa0\x31\x5e\xf8\xd5\x97\x0f\x6c\xcc\x16\xba\x69\xef\x44\x3c\x37\xdd\x2f" "\x7e\xb2\x1b\x3f\x39\x24\xfe\xf3\x03\xc6\xff\xc3\xc7\x3e\xf1\xfd\x57\x0e" "\x49\xcb\x7e\x12\x71\x39\xfa\xc7\xef\x8d\x55\xed\x34\xef\x56\xdb\x1b\x9b" "\x57\xd7\x9a\x4b\xab\xf5\xd5\xfa\x9d\x5a\xed\xc6\xe2\x8d\x6b\x2f\x5d\x7f" "\xb1\x56\x2d\xfa\xa8\xab\x3b\x3d\xd5\x07\xfd\xed\xe5\x2b\xcf\x1c\x96\xb7" "\xbc\xfc\x67\x0e\x89\xdf\x7d\xe7\xcf\xee\x2b\xff\xec\xee\xb1\x9f\x19\xb0" "\xfc\x3f\xfd\xe0\xcd\x6f\x7c\x72\x6f\x75\x6e\x7f\xfc\xcf\x7d\xba\xff\xfb" "\xff\x6c\x11\xb1\xff\xeb\x9f\xd7\x89\x9f\x1d\x30\xfe\xd2\x99\x9f\x1f\x3a" "\x7c\x77\x1e\x7f\xe5\x90\xf2\x3f\xee\xfd\xbf\x32\x60\xfc\xf7\xfe\xb2\xb9" "\x32\xe0\xae\x00\xc0\x08\xb4\x37\x36\x6f\x2f\x35\x1a\xf5\x7b\xc7\x5a\xc8" "\x3f\x85\x0e\xe3\x3c\x07\x16\xf2\x2c\x0e\xb6\xf3\x4e\x73\xf1\x78\x41\xff" "\x14\xc5\xc2\xde\xcb\x92\x44\x12\x47\x3e\xe1\x4c\xff\xa4\xbc\x31\x36\xd0" "\xe1\x27\xf5\xaa\x9e\xf8\xc2\xf4\x6e\x5b\x71\xb8\x67\xfe\x7a\x7e\xc6\x11" "\x17\x27\x1d\x7a\x29\x8e\xb2\x10\xe7\xcb\x85\x87\xa3\x0a\x3a\xbe\x7b\x12" "\x30\x1a\x7b\x17\x7d\x44\xfc\x66\xdc\xb9\x01\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\xfa\x19\xc5\xdf\x30\x8d\xbb\x8c\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x9c\x5e\xff\x09\x00\x00\xff\xff\xdb\x57\xc4\x6e", 1380); syz_mount_image(/*fs=*/0x200000000180, /*dir=*/0x200000000000, /*flags=MS_LAZYTIME|MS_SILENT|MS_NOSUID*/ 0x2008002, /*opts=*/0x200000000400, /*chdir=*/1, /*size=*/0x564, /*img=*/0x200000000c00); memcpy((void*)0x200000000440, "./file0\000", 8); syz_mount_image(/*fs=*/0, /*dir=*/0x200000000440, /*flags=MS_NODIRATIME*/ 0x800, /*opts=*/0, /*chdir=*/0, /*size=*/0, /*img=*/0x200000000000); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; use_temporary_dir(); loop(); return 0; }