// https://syzkaller.appspot.com/bug?id=f0d34594467ade2b45400cec1695433d001df373 // 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*)0x2000000000c0, "hfsplus\000", 8); memcpy((void*)0x200000000980, "./file1\000", 8); memcpy( (void*)0x2000000007c0, "\x6e\x6f\x62\x61\x72\x72\x69\x65\x72\x2c\x63\x72\x65\x61\x74\x6f\x72\x3d" "\x5c\x5d\x07\x84\x2c\x63\x72\x65\x61\x74\x6f\x72\x3d\xbd\x3c\xff\xf5\x2c" "\x6e\x6c\x73\x3d\x63\x70\x34\x33\x37\x2c\x75\x6d\x61\x73\x6b\x3d\x30\x30" "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30" "\x30\x33\x37\x2c\x6e\x6f\x64\x65\x63\x6f\x6d\x70\x6f\x73\x65\x2c\x00", 89); memcpy( (void*)0x200000000cc0, "\x78\x9c\xec\xdd\x4f\x6c\x1c\x57\x1d\x07\xf0\xef\x6c\x36\xeb\x6c\x90\x52" "\xf7\x5f\x1a\x10\x52\xad\x46\xaa\xa0\x11\x89\x9d\x55\x49\x90\x90\x1a\x10" "\x42\x39\x44\x28\x82\x4b\xaf\x56\xe2\x34\x56\x36\x69\xe5\xb8\x28\xad\x10" "\xd9\x00\x05\x89\x13\x27\xd4\x03\x87\x22\x14\x0e\x3d\x21\x84\x90\xca\x09" "\x51\xce\x48\x48\x5c\x38\xf9\x1e\x89\x1b\x87\x1c\x00\xa3\x99\x9d\x5d\xaf" "\xed\x8d\x63\x27\xb1\xd7\x6d\x3f\x1f\x69\x3c\xef\xed\x9b\xf7\xde\x6f\x7e" "\x9d\x3f\xbb\xb3\x8d\x36\xc0\x67\xd6\xf9\xd7\x73\xb0\x97\x22\xe7\x4f\x5c" "\xb8\x55\xd6\x57\xee\x76\xba\x2b\x77\x3b\xd7\x07\xe5\x24\x53\x49\x1a\x49" "\xb3\xbf\x4a\xd1\x4e\x8a\x8f\x93\x73\xe9\x2f\xf9\x7c\xf9\x62\x3d\x5c\xf1" "\xa0\x79\x5e\xbd\xf7\x51\xd1\x7c\xff\xc3\x4e\xbf\xd6\xac\x97\x6a\xfb\xc6" "\x56\xfd\x36\x19\xbb\x65\x2f\x39\x34\xac\x1c\x48\x32\xd3\x2f\xfe\x67\xdb" "\xc3\x6e\x1a\xaf\x5a\xaa\x71\x2e\xad\x8d\xf7\x88\x8a\x61\xdc\x65\xc2\x8e" "\x0f\x12\x07\x93\xb6\xba\x49\x6f\xad\xb1\xf1\xd0\xee\xdb\x3f\x6f\x81\x7d" "\xeb\x76\xff\xbe\xb9\xc9\x74\x72\x38\xfd\xbb\x6b\xf9\x3e\x20\xf5\xd5\xe1" "\xe1\x57\x86\xc9\xdb\xf2\xda\xd4\xdb\xbb\x38\x00\x00\x00\x60\xb7\x8c\xfd" "\x2c\x3f\xea\xa9\xfb\xb9\x9f\x5b\x39\xb2\x37\xe1\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xc0\xa7\x43\xd1\xff\xcd\xc0\xa2\x5e\x1a\x83\xf2\x4c\x8a\xc1" "\xef\xff\xb7\x46\x7e\x53\xbf\x35\xe1\x70\x1f\xd3\x7b\x57\xaa\xd5\x77\x9f" "\x9a\x74\x20\x00\x00\x00\x00\x00\x00\x00\xf0\x58\x5e\xbc\x9f\xfb\xb9\x95" "\x23\x83\xfa\x6a\x51\x7d\xe7\xff\x52\x55\x79\xae\xfa\xfb\xb9\xbc\x9d\x9b" "\x59\xc8\x52\x4e\xe6\x56\xe6\xb3\x9c\xe5\x2c\x65\x2e\xc9\xf4\xc8\x40\xad" "\x5b\xf3\xcb\xcb\x4b\x73\x9b\x7b\xfe\x32\x65\xcf\xd5\xd5\xd5\xdb\x75\xcf" "\xd3\x63\x7b\x9e\x5e\x1f\x57\x6f\x63\xa0\xe3\xfe\x4f\x83\x4d\x1b\x01\x00" "\x00\x00\x00\x00\x00\xc0\x67\xd6\x8f\x72\x7e\xed\xfb\x7f\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\xd8\x0f\x8a\xe4\x40\x7f\x55\x2d\xcf\x0d\xca" "\xd3\x69\x34\x93\x1c\x4a\xd2\x2a\x66\x86\x9b\xb7\x26\x1a\xec\x13\xf0\xe7" "\x49\x07\x00\x00\x00\x00\xbb\xaf\x5d\xaf\x8f\x14\xff\xeb\x17\x56\x8b\xea" "\x33\xff\xd1\xea\x73\xff\xa1\xbc\x9d\x1b\x59\xce\x62\x96\xd3\xcd\x42\x2e" "\x57\xcf\x02\xfa\x9f\xfa\x1b\x7f\xef\x75\xba\x2b\x77\x3b\xd7\xcb\x65\xf3" "\xc0\xdf\xf8\xd7\x8e\xe2\xa8\x46\x4c\xff\xd9\xc3\xf8\x99\x67\xab\x2d\x9e" "\x1f\xf6\x38\x9f\x6f\xe7\x7b\x39\x91\x99\x5c\xcc\x52\x16\xf3\xfd\xcc\x67" "\x39\x0b\x99\xc9\xb7\xaa\xd2\x7c\x8a\x4c\xd7\x4f\x2f\xa6\x57\xee\xb6\x33" "\x88\x75\x73\xbc\xe7\xd6\xd5\x2e\x6e\x8c\xed\xc5\x91\x72\x19\xdf\xb1\x2a" "\x92\x76\xae\x64\xb1\x8a\xed\x64\x2e\xb5\x06\xa1\x37\xea\xed\x8e\x8d\xcc" "\xf6\xc7\x56\xb2\x61\xc6\x3b\x65\x76\x8a\xd7\x6a\xdb\xcc\xd1\xe5\x7a\x5d" "\xee\xd1\x2f\xea\xf5\xfe\x30\x5d\xed\xf9\xc1\x61\x46\x66\xeb\xdc\x97\xd9" "\x78\x7a\x34\xef\x9b\x73\xbf\xc3\xe3\x64\xe3\x4c\x73\x69\x0c\x9f\x41\x3d" "\xb7\x36\x4b\x59\xdd\x38\xd3\x23\xe5\xfc\x70\xbd\x2e\x73\xfd\xd3\xdd\xcd" "\xf9\x0e\x1f\xa5\xad\xcf\x44\xef\xe7\x65\x6d\x70\xf4\x1d\xdd\x3a\xe7\xc9" "\x97\xff\xf1\x97\x8b\x57\x1b\x37\xae\x5d\xbd\x72\xf3\xc4\xfe\x39\x8c\x1e" "\xd1\xc6\x63\xa2\x33\x92\x89\x17\xb6\x95\x89\x6e\x99\x89\xde\x63\x64\xe2" "\xd0\xe3\xc4\xff\xe4\xb4\xea\x6c\xf4\xaf\xa2\x3b\xbb\x5a\xbe\x54\xf5\x3d" "\x92\xc5\x7c\x27\x6f\xe6\x72\x16\x72\x26\xb3\x99\xcb\xd9\xcc\xe6\x6b\x39" "\x9d\x4e\x4e\x8f\xe4\xf5\xf9\xad\xf3\x5a\x9d\x6b\x8d\x9d\x9d\x6b\xc7\xbf" "\x54\x17\xca\x7b\xd2\xcf\x46\xee\x4d\x7b\x66\xea\x41\x0d\x65\x5e\x9f\x1e" "\xc9\xeb\xe8\x95\x6e\xba\x6a\x1b\x7d\x65\x2d\x4b\xcf\x6c\x23\x4b\x45\x2b" "\xe3\xb3\xf4\xcf\xb1\xa1\x34\xbf\x50\x17\xca\x39\x7e\x3c\x72\xc7\x99\xbc" "\x8d\x99\x98\x1b\xc9\xc4\xb3\x5b\x67\xe2\xd7\xff\x5d\x4d\x72\xb3\x7b\xe3" "\xda\xd2\xd5\xf9\xb7\xb6\x39\xdf\xcb\xf5\xba\x3c\x6d\xdf\x5b\x7f\x6d\xfe" "\xcd\x13\xd9\xa1\x9d\xab\x77\xb7\x3c\x5e\x9e\x29\xff\x63\xa5\x7f\xdb\x18" "\x3d\x3a\xca\xb6\x67\x07\x6d\x1b\xf2\xd5\xaa\xbf\x71\x69\xd6\x83\xad\x6b" "\x6b\xa5\x3a\x9f\xfb\x6d\x0f\x3b\x53\xcb\x91\x8e\xde\x19\x37\x52\xbf\xed" "\x85\xb1\xb3\x74\xaa\xb6\x63\x23\x6d\xeb\xde\xe5\xe4\xcd\x74\x87\xef\x42" "\x00\xd8\xc7\x0e\xbf\x72\xb8\xd5\xbe\xd7\xfe\x5b\xfb\x83\xf6\x4f\xda\x57" "\xdb\x17\x0e\x7d\x73\xea\xec\xd4\x17\x5b\x39\xf8\xd7\xe6\x9f\x0e\xfc\xae" "\xf1\xdb\xc6\xd7\x8b\x57\xf2\x41\x7e\x98\x23\x93\x8e\x14\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x3e\x0d\x6e\xbe\xf3\xee\xb5\xf9\x6e\x77\x61\x69\x1f\x16\xd2\x78\xc2" "\x03\xde\x19\xdb\x34\x48\x45\xff\x95\xd6\xfe\xd8\xf7\x4f\x6a\x61\x6a\xab" "\x23\xea\xf7\x49\xb6\xe8\xde\x9a\x44\xcc\xed\x24\xfb\x22\x75\x69\xee\xc1" "\x5c\x53\x19\xd3\x74\x61\xf8\x4a\x3b\x69\x0c\xe3\x49\x72\x6d\x9f\xfc\xc0" "\x1d\xb0\x1b\x4e\x2d\x5f\x7f\xeb\xd4\xcd\x77\xde\xfd\xca\xe2\xf5\xf9\x37" "\x16\xde\x58\xb8\x71\xfa\xec\x99\xd7\xce\x74\xbe\x3a\x77\xfb\xd4\x95\xc5" "\xee\xc2\x6c\xff\xef\xa4\xa3\x04\x76\xc3\xda\xdb\x80\x49\x47\x02\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x6c\xd7\x5e\xfc\xf3\x86\x31\xd3\x16\xbd\x09" "\xec\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\xf0\xc9\x74\xfe\xf5\x1c\xec\xa5\xc8\xdc\xec\xc9\xd9" "\xb2\xbe\x72\xb7\xd3\x2d\x97\x41\x79\x6d\xcb\x66\x92\x46\x92\xe2\x07\x49" "\xf1\x71\x72\x2e\xfd\x25\xd3\x23\xc3\x15\x0f\x9a\xe7\xd5\x7b\x1f\xfd\xea" "\xe5\xf7\x3f\xec\xac\x8d\xd5\x1c\x6c\xdf\xd8\xd0\xef\x0f\xff\x5e\x5d\xdd" "\xe1\x5e\xf4\xea\x25\x33\x49\x0e\xd4\xeb\x87\x9b\xda\xd6\x78\x97\x46\xc6" "\xeb\xed\x30\xb0\xbe\x62\xb8\x87\x65\xc2\x8e\x0f\x12\x07\x93\xf6\xff\x00" "\x00\x00\xff\xff\x1e\x4b\x07\xce", 1700); syz_mount_image(/*fs=*/0x2000000000c0, /*dir=*/0x200000000980, /*flags=*/0, /*opts=*/0x2000000007c0, /*chdir=*/1, /*size=*/0x6a4, /*img=*/0x200000000cc0); memcpy((void*)0x200000000080, "./bus\000", 6); syscall(__NR_open, /*file=*/0x200000000080ul, /*flags=O_TRUNC|O_SYNC|O_NOFOLLOW|O_NOATIME|O_LARGEFILE|O_CREAT|0x2*/ 0x169242ul, /*mode=S_IWGRP*/ 0x10ul); memcpy((void*)0x200000000080, "./file1\000", 8); syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000080ul, /*flags=O_CREAT|O_APPEND|O_WRONLY*/ 0x441, /*mode=S_IROTH|S_IRUSR*/ 0x104); memcpy((void*)0x200000000440, "./bus\000", 6); memcpy((void*)0x2000000003c0, "./file1\000", 8); syscall(__NR_rename, /*old=*/0x200000000440ul, /*new=*/0x2000000003c0ul); memcpy((void*)0x200000000440, "./bus\000", 6); memcpy((void*)0x2000000003c0, "./file1\000", 8); syscall(__NR_rename, /*old=*/0x200000000440ul, /*new=*/0x2000000003c0ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-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=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; loop(); return 0; }