// https://syzkaller.appspot.com/bug?id=d83b0f7a09db4d080b183681028bd1c163dda6cd // 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 #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; //% 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; } uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x200000c0, "udf\000", 4); memcpy((void*)0x20000180, "./file0\000", 8); memcpy((void*)0x20000000, "shortad", 7); *(uint8_t*)0x20000007 = 0x2c; memcpy((void*)0x20000008, "gid", 3); *(uint8_t*)0x2000000b = 0x3d; sprintf((char*)0x2000000c, "%020llu", (long long)0); *(uint8_t*)0x20000020 = 0x2c; memcpy((void*)0x20000021, "uid=forget", 10); *(uint8_t*)0x2000002b = 0x2c; memcpy((void*)0x2000002c, "gid=forget", 10); *(uint8_t*)0x20000036 = 0x2c; memcpy((void*)0x20000037, "volume", 6); *(uint8_t*)0x2000003d = 0x3d; sprintf((char*)0x2000003e, "%020llu", (long long)0x3ff); *(uint8_t*)0x20000052 = 0x2c; memcpy((void*)0x20000053, "utf8", 4); *(uint8_t*)0x20000057 = 0x2c; memcpy((void*)0x20000058, "novrs", 5); *(uint8_t*)0x2000005d = 0x2c; memcpy((void*)0x2000005e, "lastblock", 9); *(uint8_t*)0x20000067 = 0x3d; sprintf((char*)0x20000068, "%020llu", (long long)2); *(uint8_t*)0x2000007c = 0x2c; memcpy((void*)0x2000007d, "iocharset", 9); *(uint8_t*)0x20000086 = 0x3d; memcpy((void*)0x20000087, "cp855", 5); *(uint8_t*)0x2000008c = 0x2c; *(uint8_t*)0x2000008d = 0; memcpy( (void*)0x2001fd40, "\x78\x9c\xec\xdd\x4d\x6c\x5c\xd7\x7d\x37\xe0\xff\xb9\x1c\x8a\x23\xf9\x7d" "\x2b\x26\x76\x14\x27\x8d\x8b\x49\x5b\xa4\xb2\x62\xb9\xfa\x8a\xa9\x58\x85" "\x3b\xaa\x69\xb6\x01\x64\x59\x08\xc5\xec\x02\x70\x24\x8e\xd4\x81\x29\x92" "\x20\xa9\x46\x36\xd2\x82\xe9\xa6\x8b\x2e\x02\x14\x45\x17\x59\x11\x68\x8d" "\x02\x29\x1a\x18\x4d\x11\x74\xc9\xb4\x2e\x90\x6c\xbc\x28\xb2\xea\x8a\x68" "\x61\x23\x28\xba\x60\x8b\x00\x59\x05\x2c\xee\x9d\x33\xd2\x90\x22\x6d\x46" "\x14\x25\x4a\x7a\x1e\x9b\xfa\xcd\xdc\x7b\xce\x9d\x73\xee\x19\xdf\x2b\x0b" "\x3a\xf7\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\xf1" "\x7b\xaf\x9d\x3f\x71\x32\x3d\xec\x56\x00\x00\x0f\xd2\xc5\xf1\xaf\x9e\x38" "\xe5\xfe\x0f\x00\x4f\x94\xcb\xfe\xff\x1f\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xf6\xbb\x14\x45\x3c\x1d\x29\xe6\x2e\xae\xa5\xc9\xea\x7d\x57" "\xfd\x42\x67\xf0\xe6\xad\x89\xd1\xb1\xad\xab\x1d\x4c\x55\xcd\x81\xaa\x7c" "\xf9\x53\x3f\x79\xea\xf4\x99\x2f\xbd\x34\x72\xb6\x97\x17\x3a\x33\x1f\x51" "\xff\x7e\xfb\x6c\xbc\x31\x7e\xf9\x7c\xe3\xd5\xd9\x1b\x73\xf3\xed\x85\x85" "\xf6\x54\x63\x62\xa6\x73\x75\x76\xaa\xbd\xe3\x23\xec\xb6\xfe\x66\xc7\xaa" "\x13\xd0\xb8\xf1\xe6\xcd\xa9\x6b\xd7\x16\x1a\xa7\x5e\x3c\xbd\x61\xf7\xad" "\xe1\x0f\x87\x9e\x3a\x32\x7c\x6e\xe4\xf9\xe3\xcf\xf5\xca\x4e\x8c\x8e\x8d" "\x8d\xdf\x29\x52\xef\x2f\x5f\xbb\xe7\x86\x74\x6d\x37\xc3\xe3\x40\x14\x71" "\x3c\x52\xbc\xf0\xbd\x9f\xa6\x56\x44\x14\xb1\xfb\x73\x51\x7f\xb0\x63\xbf" "\xd9\xc1\xaa\x13\xc7\xaa\x4e\x4c\x8c\x8e\x55\x1d\x99\xee\xb4\x66\x16\xcb" "\x9d\x97\x7a\x27\xa2\x88\x68\xf4\x55\x6a\xf6\xce\xd1\xd6\x63\x11\xb5\xc1" "\x07\xda\x87\xed\x35\x23\x96\xca\xe6\x97\x0d\x3e\x56\x76\x6f\x7c\xae\x35" "\xdf\xba\x32\xdd\x6e\x5c\x6a\xcd\x2f\x76\x16\x3b\xb3\x33\x97\x52\xb7\xb5" "\x65\x7f\x1a\x51\xc4\xd9\x14\xb1\x1c\x11\xab\x43\x77\x1f\x6e\x30\x8a\xa8" "\x45\x8a\xef\x1c\x5e\x4b\x57\x22\x62\xa0\x77\x1e\xbe\x58\x4d\x0c\xde\xbe" "\x1d\xc5\x1e\xf6\x71\x07\xca\x76\x36\x06\x23\x96\x8b\x47\x60\xcc\xf6\xb1" "\xa1\x28\xe2\xf5\x48\xf1\xb3\xf7\x8e\xc6\xd5\x7c\x9d\xa9\xae\x35\x5f\x88" "\x78\xbd\xcc\x1f\x44\xbc\x53\xe6\x2b\x11\xa9\xfc\x62\x9c\x89\xf8\x60\x8b" "\xef\x11\x8f\xa6\x5a\x14\xf1\xe7\xe5\xf8\x9f\x5b\x4b\x53\xd5\xf5\xa0\x77" "\x5d\xb9\xf0\xb5\xc6\x57\x66\xae\xcd\xf6\x95\xed\x5d\x57\x7e\xc9\xfb\xc3" "\x5d\x57\x8a\x87\x74\x7f\x38\xb8\x29\x1f\x8c\x7d\x7e\x6d\xaa\x47\x11\xad" "\xea\x8a\xbf\x96\xee\xfd\x37\x3b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xdc\x6f\x07\xa3\x88\xcf\x44\x8a\xd7\xfe\xed\x8f\xaa\x79\xc5" "\x51\xcd\x4b\x3f\x7c\x6e\xe4\xf7\x87\xff\x7f\xff\x9c\xf1\x67\x3f\xe6\x38" "\x65\xd9\x17\x23\x62\xa9\xd8\xd9\x9c\xdc\x03\x79\x62\xe0\xa5\x74\x29\xa5" "\x87\x3c\x97\xf8\x49\x56\x8f\x22\xfe\x38\xcf\xff\xfb\xd6\xc3\x6e\x0c\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x13\xad\x88\x9f" "\x44\x8a\x97\xdf\x3f\x9a\x96\xa3\x7f\x4d\xf1\xce\xcc\xf5\xc6\xe5\xd6\x95" "\xe9\xee\xaa\xb0\xbd\xb5\x7f\x7b\x6b\xa6\xaf\xaf\xaf\xaf\x37\x52\x37\x9b" "\x39\x27\x73\x2e\xe5\x5c\xce\xb9\x92\x73\x35\x67\x14\xb9\x7e\xce\x66\xce" "\xc9\x9c\x4b\x39\x97\x73\xae\xe4\x5c\xcd\x19\x03\xb9\x7e\xce\x66\xce\xc9" "\x9c\x4b\x39\x97\x73\xae\xe4\x5c\xcd\x19\xb5\x5c\x3f\x67\x33\xe7\x64\xce" "\xa5\x9c\xcb\x39\x57\x72\xae\xe6\x8c\x7d\xb2\x76\x2f\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\xe3\xa4\x88\x22\x7e\x11\x29\xbe\xfd\x8d\xb5\x14" "\x29\x22\x9a\x11\x93\xd1\xcd\x95\xa1\x87\xdd\x3a\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x34\x94\x8a\xf8" "\x7e\xa4\x68\xfc\x41\xf3\xf6\xb6\x5a\x44\xa4\xea\xdf\xae\xa3\xe5\x2f\x67" "\xa2\x79\xa0\xcc\x4f\x46\x73\xa4\xcc\x57\xa2\x79\x3e\x67\xab\xca\x5a\xf3" "\x5b\x0f\xa1\xfd\xec\xce\x60\x2a\xe2\xc7\x91\x62\xa8\xfe\xee\xed\x01\xcf" "\xe3\x3f\xd8\x7d\x77\xfb\x6b\x10\xef\x7c\xf3\xce\xbb\xcf\xd6\xba\x39\xd0" "\xdb\x39\xfc\xe1\xd0\x53\x47\x0e\x9f\x1b\x19\xfb\xb5\x67\xb7\x7b\x9d\xb6" "\x6a\xc0\xb1\x0b\x9d\x99\x9b\xb7\x1a\x13\xa3\x63\x63\xe3\x7d\x9b\x6b\xf9" "\xd3\x3f\xd9\xb7\x6d\x38\x7f\x6e\x71\x7f\xba\x4e\x44\x2c\xbc\xf5\xf6\x9b" "\xad\xe9\xe9\xf6\xfc\xbd\xbf\x28\xbf\x02\xbb\xa8\xfe\x08\xbd\x48\xb5\x27" "\xa5\xa7\x5e\x54\x2f\xa2\xb6\x2f\x9a\xf1\x70\xfa\xce\x13\xa0\xbc\xff\x7f" "\x10\x29\x7e\xfb\xfd\x7f\xef\xdd\xf0\xbb\xf7\xff\x7a\xfc\xbf\xee\xbb\xdb" "\x77\xf8\xf8\xf9\x9f\xdc\xb9\xff\xbf\xbc\xf9\x40\x3b\xbc\xff\xd7\x36\xd7" "\xcb\xf7\xff\xf2\x9e\xbe\xd5\xfd\xff\xe9\xbe\x6d\x2f\xe7\xdf\x8d\x0c\xd6" "\x22\xea\x8b\x37\xe6\x06\x8f\x44\xd4\x17\xde\x7a\xfb\x78\xe7\x46\xeb\x7a" "\xfb\x7a\x7b\xe6\xcc\x89\x13\x5f\x1e\x19\xf9\xf2\xe9\x13\x83\x07\x22\xea" "\xd7\x3a\xd3\xed\xbe\x57\xf7\xe5\x74\x01\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x3c\x38\xa9\x88\xdf\x8d\x14\xad\x1f\xaf\xa5\x46\x44\xdc" "\xaa\xe6\x6b\x0d\x9f\x1b\x79\xfe\xf8\x73\x03\x31\x50\xcd\xb7\xda\x30\x6f" "\xfb\x8d\xf1\xcb\xe7\x1b\xaf\xce\xde\x98\x9b\x6f\x2f\x2c\xb4\xa7\x1a\x13" "\x33\x9d\xab\xb3\x53\xed\x9d\x7e\x5c\xbd\x9a\xee\x35\x31\x3a\xb6\x27\x9d" "\xf9\x58\x07\xf7\xb8\xfd\x07\xeb\xaf\xce\xce\xbd\x35\xdf\xb9\xfe\x87\x8b" "\x5b\xee\x3f\x54\x3f\x7f\x65\x61\x71\xbe\x75\x75\xeb\xdd\x71\x30\x8a\x88" "\x66\xff\x96\x63\x55\x83\x27\x46\xc7\xaa\x46\x4f\x77\x5a\x33\x55\xd5\x4b" "\x5b\x4e\xa6\xff\xe5\x0d\xa6\x22\xfe\x23\x52\x5c\x3d\xd3\x48\x9f\xcf\xdb" "\xf2\xfc\xff\xcd\x33\xfc\x37\xcc\xff\x5f\xda\x7c\xa0\x3d\x9a\xff\xff\x89" "\xbe\x6d\xe5\x67\xa6\x54\xc4\xcf\x23\xc5\x6f\xfd\xc5\xb3\xf1\xf9\xaa\x9d" "\x87\xe2\xae\x73\x96\xcb\xfd\x4d\xa4\x38\x76\xf6\x73\xb9\x5c\x1c\x28\xcb" "\xf5\xda\xd0\x7d\xae\x40\x77\x66\x60\x59\xf6\x7f\x22\xc5\x3f\xfc\x62\x63" "\xd9\xde\x7c\xc8\xa7\xef\x94\x3d\xb9\xe3\x13\xfb\x88\x28\xc7\xff\x70\xa4" "\xf8\xfe\x9f\x7d\x37\x7e\x3d\x6f\xdb\xf8\xfc\x87\xad\xc7\xff\xd0\xe6\x03" "\xed\xd1\xf8\x3f\xd3\xb7\xed\xd0\x86\xe7\x15\xec\xba\xeb\xe4\xf1\x3f\x1e" "\x29\x5e\x79\xfa\xdd\xf8\x8d\xbc\xed\xa3\x9e\xff\xd1\x7b\xf6\xc6\xd1\x5c" "\xf8\xf6\xf3\x39\xf6\x68\xfc\x3f\xd5\xb7\x6d\x38\x7f\xee\x6f\xde\x9f\xae" "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x3c\xd2\x06\x53\x11\x7f\x1b\x29\x7e" "\x38\x56\x4b\x2f\xe5\x6d\x3b\xf9\xfb\x7f\x53\x9b\x0f\xb4\x47\x7f\xff\xeb" "\xd3\x7d\xdb\xa6\xee\xcf\x7a\x45\x1f\xfb\x62\xd7\x27\x15\x00\x00\x00\x00" "\xf6\x89\xc1\x54\xc4\x4f\x22\xc5\xf5\xc5\x77\x6f\xcf\xa1\xde\x38\xff\xbb" "\x6f\xfe\xe7\xef\xdc\x99\xff\x39\x9a\x36\xed\xad\xfe\x9c\xef\x57\xaa\xe7" "\x06\xdc\xcf\x3f\xff\xeb\x37\x9c\x3f\x77\x72\xf7\xdd\x06\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x7d\x25\xa5\x22\x5e\xca\xeb" "\xa9\x4f\x56\xf3\xf9\xa7\xb6\x5d\x4f\x7d\x25\x52\xbc\xf6\x5f\x2f\xe4\x72" "\xe9\x48\x59\xae\xb7\x0e\xfc\x70\xf5\x6b\xfd\xe2\xec\xcc\xf1\xf3\xd3\xd3" "\xb3\x57\x5b\x8b\xad\x2b\xd3\xed\xc6\xf8\x5c\xeb\x6a\xbb\xac\xfb\x4c\xa4" "\x58\xfb\xeb\xcf\xe5\xba\x45\xb5\xbe\x7a\x6f\xbd\xf9\xee\x1a\xef\x77\xd6" "\x62\x9f\x8f\x14\x63\x7f\xd7\x2b\xdb\x5d\x8b\xbd\xb7\x36\xf9\x33\xbd\xb2" "\x4b\xed\x93\x65\xd9\x4f\x44\x8a\xff\xfc\xfb\x8d\x65\x7b\xeb\x58\x7f\xea" "\xce\x71\x4f\x95\x65\xff\x2a\x52\x7c\xfd\x9f\xb6\x2e\x7b\xe4\x4e\xd9\xd3" "\x65\xd9\xef\x46\x8a\x1f\x7d\xbd\xd1\x2b\x7b\xa8\x2c\xdb\x7b\x3e\xea\xa7" "\xef\x94\x7d\xf1\xea\x6c\xb1\x07\xa3\x02\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xc0\x93\x66\x30\x15\xf1\xa7\x91\xe2\xbf\x6f\x2c" "\xdf\x9e\xcb\x9f\xd7\xff\x1f\xec\x7b\x5b\x79\xe7\x9b\x7d\xeb\xfd\x6f\x72" "\xab\x5a\xe7\x7f\xb8\x5a\xff\x7f\xbb\xd7\xf7\xb2\xfe\x7f\xf5\x5c\x81\xa5" "\xed\x3e\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x1e\x4f\x29\x8a\x78\x3b\x52\xcc\x5d\x5c\x4b\x2b\x43\xe5\xfb\xae" "\xfa\x85\xce\xcc\xcd\x5b\x13\xa3\x63\x5b\x57\x3b\x98\xaa\x9a\x03\x55\xf9" "\xf2\xa7\x7e\xf2\xd4\xe9\x33\x5f\x7a\x69\xe4\x6c\x2f\x3f\xba\xfe\xfd\xf6" "\x99\x78\x63\xfc\xf2\xf9\xc6\xab\xb3\x37\xe6\xe6\xdb\x0b\x0b\xed\xa9\xc6" "\xc4\x4c\xe7\xea\xec\x54\x7b\xc7\x47\xd8\x6d\xfd\xcd\x8e\x55\x27\xa0\x71" "\xe3\xcd\x9b\x53\xd7\xae\x2d\x34\x4e\xbd\x78\x7a\xc3\xee\x5b\xc3\x1f\x0e" "\x3d\x75\x64\xf8\xdc\xc8\xf3\xc7\x9f\xeb\x95\x9d\x18\x1d\x1b\x1b\xef\x2b" "\x53\x1b\xbc\xe7\x4f\xbf\x4b\xda\x66\xfb\x81\x28\xe2\x2f\x23\xc5\x0b\xdf" "\xfb\x69\xfa\xe1\x50\x44\x11\xbb\x3f\x17\x1f\xf3\xdd\xd9\x6b\x07\xab\x4e" "\x1c\xab\x3a\x31\x31\x3a\x56\x75\x64\xba\xd3\x9a\x59\x2c\x77\x5e\xea\x9d" "\x88\x22\xa2\xd1\x57\xa9\xd9\x3b\x47\x0f\x60\x2c\x76\xa5\x19\xb1\x54\x36" "\xbf\x6c\xf0\xb1\xb2\x7b\xe3\x73\xad\xf9\xd6\x95\xe9\x76\xe3\x52\x6b\x7e" "\xb1\xb3\xd8\x99\x9d\xb9\x94\xba\xad\x2d\xfb\xd3\x88\x22\xce\xa6\x88\xe5" "\x88\x58\x1d\xba\xfb\x70\x83\x51\xc4\x9b\x91\xe2\x3b\x87\xd7\xd2\x3f\x0f" "\x45\x0c\xf4\xce\xc3\x17\x2f\x8e\x7f\xf5\xc4\xa9\xed\xdb\x51\xec\x61\x1f" "\x77\xa0\x6c\x67\x63\x30\x62\xb9\xf8\xa8\x31\xdb\xa2\xc3\x6c\x30\x14\x45" "\xfc\x63\xa4\xf8\xd9\x7b\x47\xe3\x5f\x86\x22\x6a\xd1\xfd\x89\x2f\x44\xbc" "\x5e\xe6\x0f\x22\xde\x89\xee\x78\xa7\xf2\x8b\x71\x26\xe2\x03\xa7\xf5\xb1" "\x51\x8b\x22\xfe\xb7\x1c\xff\x73\x6b\xe9\xbd\xa1\xf2\x7a\xd0\xbb\xae\x5c" "\xf8\x5a\xe3\x2b\x33\xd7\x66\xfb\xca\xf6\xae\x2b\x8f\xfc\xfd\xe1\x41\xda" "\xe7\xf7\x93\x7a\x14\xf1\xa3\xea\x8a\xbf\x96\xfe\xd5\x7f\xd7\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfb\x48\x11\xbf\x1a\x29\x5e\x7e" "\xff\x68\xaa\xe6\x07\xdf\x9e\x53\xdc\x99\xb9\xde\xb8\xdc\xba\x32\xdd\x9d" "\xd6\xd7\x9b\xfb\xd7\x9b\x33\xbd\xbe\xbe\xbe\xde\x48\xdd\x6c\xe6\x9c\xcc" "\xb9\x94\x73\x39\xe7\x4a\xce\xd5\x9c\x51\xe4\xfa\x39\x9b\x65\xd6\xd7\xd7" "\x27\xf3\xfb\xa5\x9c\xcb\x39\x57\x72\xae\xe6\x8c\x81\x5c\x3f\x67\x33\xe7" "\x64\xce\xa5\x9c\xcb\x39\x57\x72\xae\xe6\x8c\x5a\xae\x9f\xb3\x99\x73\x32" "\xe7\x52\xce\xe5\x9c\x2b\x39\x57\x73\xc6\x3e\x99\xbb\x07\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x5e\x8a\xea\x9f\x14\xdf\xfe" "\xc6\x5a\x5a\x1f\xaa\xd6\x97\x1e\xe8\xed\x5b\xb1\x1e\xe8\x63\xef\xff\x02" "\x00\x00\xff\xff\x4a\x5a\xf8\x29", 3122); syz_mount_image(/*fs=*/0x200000c0, /*dir=*/0x20000180, /*flags=MS_NODIRATIME*/ 0x800, /*opts=*/0x20000000, /*chdir=*/1, /*size=*/0xc32, /*img=*/0x2001fd40); memcpy((void*)0x20000100, "./file1\000", 8); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000100ul, /*flags=O_CREAT|O_RDWR*/ 0x42, /*mode=*/0); if (res != -1) r[0] = res; memcpy((void*)0x20000040, "./file1\000", 8); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000040ul, /*flags=O_CREAT|O_RDWR*/ 0x42, /*mode=S_IXOTH|S_IROTH*/ 5); if (res != -1) r[1] = res; memset((void*)0x20000140, 50, 1); syscall(__NR_pwrite64, /*fd=*/r[1], /*buf=*/0x20000140ul, /*count=*/1ul, /*pos=*/0x8000c61ul); *(uint32_t*)0x200000c0 = 0x18; *(uint32_t*)0x200000c4 = 0; *(uint64_t*)0x200000c8 = 0; *(uint32_t*)0x200000d0 = 0; *(uint32_t*)0x200000d4 = 0; syscall(__NR_write, /*fd=*/r[0], /*arg=*/0x200000c0ul, /*len=*/0xfffffdeful); memcpy((void*)0x200003c0, "./file1\000", 8); memcpy((void*)0x20000f40, "./" "file0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000", 252); syscall(__NR_rename, /*old=*/0x200003c0ul, /*new=*/0x20000f40ul); return 0; }