// https://syzkaller.appspot.com/bug?id=aa51904d50d042b339bdd78dc64f8e2e531a9dd9 // 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"); } else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) { strcat(opts, ",errors=withdraw"); } 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; } 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; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$hfsplus arguments: [ // fs: ptr[in, buffer] { // buffer: {68 66 73 70 6c 75 73 00} (length 0x8) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // flags: mount_flags = 0x221c810 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYRES8: ANYRES8 (resource) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYRESOCT: ANYRES64 (resource) // } // } // } // chdir: int8 = 0x11 (1 bytes) // size: len = 0x6b0 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x6b0) // } // ] // returns fd_dir memcpy((void*)0x200000000000, "hfsplus\000", 8); memcpy((void*)0x2000000000c0, "./file0\000", 8); *(uint8_t*)0x200000000100 = 0; *(uint32_t*)0x200000000101 = 0; sprintf((char*)0x200000000105, "%023llo", (long long)0); memcpy( (void*)0x200000000640, "\x78\x9c\xec\xdd\xcd\x6f\x1c\x67\x19\x00\xf0\x67\xd6\xeb\x8f\x4d\x25\xc7" "\x6d\xd3\x34\xa0\x4a\x98\x44\x2a\xa8\x16\x89\x3f\xe4\x16\x73\x49\x40\x08" "\x19\xa9\x42\x55\x38\x70\xb6\x1a\xa7\xb1\xb2\x71\x83\xed\x22\xb7\x07\xe2" "\x02\x12\x57\x0e\xfc\x01\xe5\x60\x2e\x70\x02\x21\x24\x24\xa4\x48\xe5\x0c" "\xb7\x8a\x9b\xc5\xa9\x12\x12\x97\x9e\xd2\x1e\x18\x34\xb3\x33\xeb\xf1\x76" "\xd7\x5e\xdb\xb1\xd7\xa6\xbf\x5f\x34\xfb\xbe\xef\xbc\x33\xef\x3c\xf3\xcc" "\xc7\x7e\x44\xd6\x04\xf0\x85\xb5\x38\x15\xf5\xc7\xd1\x88\xc5\xa9\xd7\x37" "\xb3\xf6\xce\xf6\x5c\x73\x67\x7b\xee\x41\x59\x8f\x88\xd1\x88\xa8\x45\xd4" "\x5b\x45\x24\xab\x11\xc9\x87\x11\xb7\xa2\x35\xc5\x97\xb2\x99\xc5\x70\x49" "\xaf\xed\xfc\x7a\x65\xe1\xf6\x47\x9f\xec\x7c\xdc\x6a\xd5\x63\x77\xbc\xec" "\xa5\xd1\x3b\xc0\x7a\x3f\x7b\xb1\x55\x4c\x31\x19\x11\x43\x45\x79\x0c\x7b" "\xc6\x7b\xf3\x68\xe3\x8d\xee\x56\x93\x76\x66\xb2\x84\x5d\x2b\x13\x07\x83" "\x36\x1c\x11\xe9\x1e\x3f\xbe\xbc\xdb\xd3\x4d\x3a\x54\x69\xf4\xbc\xde\x81" "\xf3\x23\x69\xbd\x6f\x56\xb4\xae\xff\x89\x88\x0b\x11\x31\x56\xbe\xa1\x6d" "\xb5\x3a\x6b\xa7\x1f\xe1\x81\x0e\x75\x2f\xda\x3a\xb9\x38\x00\x00\x00\xe0" "\xcc\xb8\xf8\xe4\x51\xc4\x66\x8c\x0f\x3a\x0e\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x38\x4f\x8a\xe7\xff\x27\xc5\x54\x2b\xeb\x93\x91\x94\xcf\xff\x1f" "\xa9\x3c\x63\x7f\x64\xc0\xe1\xf6\xd6\x23\xb2\xab\xaf\xe5\xc5\x58\xd9\x7e" "\x5c\x3b\xb5\x88\x00\x00\x00\x00\x00\x00\x00\xe0\xc4\x7c\xe5\x49\xfc\xee" "\x76\x9a\x8e\x97\xed\x34\xc9\xff\xcf\xff\x6a\xde\xb8\x94\xbf\x3e\x13\xef" "\xc4\x7a\x2c\xc7\x5a\x5c\x8f\xcd\x58\x8a\x8d\xd8\x88\xb5\x98\x89\x88\x89" "\xca\x40\x23\x9b\x4b\x1b\x1b\x6b\x33\xe5\x9a\x9f\xa5\x69\xda\x63\xcd\xd9" "\xae\x6b\xce\xf6\x19\x70\xe3\x69\xec\x35\x00\x00\x00\x00\x00\x00\x00\xfc" "\xdf\xb8\x59\x94\x3f\x8b\xc5\x18\x1f\x70\x2c\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\xb0\x47\x12\x31\xd4\x2a\xf2\xe9\x52\x59\x9f\x88\x5a\x3d" "\x22\xc6\x22\x62\x24\x5b\x6e\x2b\xe2\x1f\x65\xfd\x3c\x7b\x3c\xe8\x00\x00" "\x00\x00\xe0\x14\x5c\x7c\x12\x4f\x62\x33\xc6\xcb\x76\x9a\xe4\xdf\xf9\x2f" "\xe7\xdf\xfb\xc7\xe2\x9d\x58\x8d\x8d\x58\x89\x8d\x68\xc6\x72\xdc\xc9\x7f" "\x0b\x68\x7d\xeb\xaf\xed\x6c\xcf\x35\x77\xb6\xe7\x1e\x64\xd3\xe7\xc7\xfd" "\xf6\x7f\x76\xeb\x7f\x1c\x3f\x30\x8c\x7c\xc4\x68\xfd\xf6\xd0\x7d\xcb\x57" "\xf2\x25\x1a\x71\x37\x56\xf2\x39\xd7\xe3\xcd\x78\x3b\x9a\x71\x27\x6a\xf9" "\x9a\x99\x2b\x65\x3c\xdd\xe3\x7a\x3f\x8b\x29\xb9\xd9\x92\xa6\xfd\x25\xe8" "\x4e\x51\x66\x7b\xfe\xab\xa2\x1c\xac\x46\x51\x4e\xe4\x19\x19\x6e\x67\x64" "\xba\x88\x2d\xcb\xc6\xb3\xfb\x67\xa2\x7a\x74\xfa\xd0\xb9\xa5\x99\xa8\xb5" "\x7f\xf9\xb9\x74\x88\x9c\xdf\xdc\x77\x2b\xc9\x7f\xcb\x63\x72\xa1\x9c\x13" "\xf1\xcc\xf7\x0f\xce\xf9\xf0\xa1\x76\xe6\x58\x3a\x33\x31\x5b\x39\xfb\x2e" "\xef\x9f\x89\x88\xaf\xfd\xe9\xf7\x3f\xba\xd7\x5c\xbd\x7f\x2f\xd9\x9a\x1a" "\xfc\x69\x74\x04\xa3\xff\xda\xbd\x6a\x3a\x33\x31\x57\xc9\xc4\x8b\x7d\x67" "\xe2\xee\xfa\xf9\xcc\x44\xa7\x5a\xbc\xd0\xae\x2f\xc6\xf7\xe2\x87\x31\x15" "\x93\xf1\x46\xac\xc5\x4a\xfc\x24\x96\x62\x23\x96\x63\x32\xbe\x9b\xd7\x96" "\x8a\xf3\x39\x7b\x9d\xd8\x3f\x53\xb7\xf6\xb4\xde\x38\x28\x8a\x91\xe2\xb8" "\x0c\x75\xc4\xf4\xd5\x8b\xad\x72\xbf\x98\xae\xe6\xeb\x8e\xc7\x4a\xfc\x20" "\xde\x8e\x3b\xb1\x1c\xaf\xe6\xff\x66\x63\x26\x5e\x8b\xf9\x98\x8f\x85\xca" "\x11\x7e\xa1\x8f\xab\xbe\xd6\xe5\xaa\xff\x73\xef\xe0\xaf\x7d\xbd\xa8\x64" "\xf7\xb7\x5f\x56\xee\x73\x83\x97\xe5\xf5\xd9\x4a\x5e\xab\xf7\xdc\x89\xbc" "\xaf\x3a\xa7\x16\xe9\x68\x6b\xbd\xe7\x9e\xda\xbd\xb1\xad\xfe\xe5\xa2\x92" "\x1d\x89\x9f\x17\xe5\xd9\xd0\xce\xc4\x58\xb4\xdf\x25\xca\xe8\x9e\x2f\x33" "\x30\xdc\x35\x13\xbf\xc9\x6f\x2b\xeb\xcd\xd5\xfb\x6b\xf7\x96\x1e\x76\x8c" "\x9b\x6c\x75\xdf\xde\xcb\xb1\x77\xf7\x0f\x75\x23\x19\x3a\xcc\xc2\x87\x95" "\x9d\x2f\xcf\x65\x07\x2b\x6f\xed\x3d\x3b\xb2\xbe\xe7\xbb\xf6\xcd\xe4\x7d" "\x97\xda\x7d\xb5\xce\xbe\xdf\x36\xda\x7d\x07\x5d\xa9\x23\xc5\x67\xb8\xcf" "\x8f\x34\x9b\xf7\xbd\xd8\xb5\x6f\x2e\xef\xbb\x52\xe9\xdb\xfd\xbc\xf5\x59" "\x9a\xa6\xad\xcf\x5b\x00\x9c\x79\x17\x5e\xb9\x30\xd2\xf8\x77\xe3\xef\x8d" "\x0f\x1a\xbf\x68\xdc\x6b\xbc\x3e\xf6\x9d\xd1\x6f\x8e\xbe\x34\x12\xc3\x7f" "\x1b\xfe\x56\x7d\x7a\xe8\xe5\xda\x4b\xc9\x1f\xe2\x83\xf8\x69\x1c\xfc\x0d" "\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x38\xd0\xfa\xbb\xef\xdd\x5f\x6a\x36\x97\xd7\x3a" "\x2a\x69\x9a\x3e\xea\xd1\x75\x22\x95\xa8\x47\xec\x99\xf3\xd7\xbf\x54\x96" "\x89\x88\xfc\x61\x40\xfd\x0f\x98\x2d\x7d\xab\x16\x91\xcf\xa9\x47\x51\x39" "\x5c\x60\x8f\x8e\xb6\x3b\xef\x1f\x35\x09\xff\x2c\x8e\x49\x39\x27\x4d\x5b" "\x8f\x5d\x3b\xa5\x43\x70\x84\xca\x58\xcf\xf3\xa7\xb3\xf2\x69\x9a\xa6\x67" "\x23\xe6\x7e\x2a\x69\xe1\xac\xc4\x73\x02\x95\x57\xd2\x34\xdd\x77\x99\x41" "\xde\x95\x80\xd3\x70\x63\xe3\xc1\xc3\x1b\xeb\xef\xbe\xf7\x8d\x95\x07\x4b" "\x6f\x2d\xbf\xb5\xbc\xba\x30\x3f\xbf\x30\xbd\x30\xff\xea\x70\xdc\x5d\x69" "\x2e\x4f\xdf\xc8\x5f\x07\x1d\x25\x70\x12\x2a\x9f\xc0\x01\x00\x00\x00\x00" "\x00\x00\x00\x00\x80\x73\xa2\xbf\x3f\xce\x49\x8e\xf7\xb7\x3d\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\xc7\xb0\x38\x15\xf5\xc7\x91\xc4\xcc\xf4\xf5\xe9\xac\xbd\xb3\x3d\xd7" "\xcc\xa6\xb2\xbe\xbb\xe4\xa7\x11\x51\x8b\x88\x64\x32\x22\xf9\x30\xe2\x56" "\xb4\xa6\x98\xa8\x0c\x97\xf4\xda\xce\x56\xc4\xed\x8f\x3e\xd9\xf9\xb8\xd5" "\xaa\x17\x53\xbe\x7c\x6d\xbf\xf5\xfa\xb3\x55\x4c\x31\x19\x11\x43\x45\xd9" "\xc5\x58\xb7\x99\xe9\xa3\x5e\xe3\x25\xf9\x38\x0f\x7b\x8f\xd7\xa1\xd7\x5e" "\x24\xed\xbe\x2c\x61\xd7\xca\xc4\xc1\xa0\xfd\x2f\x00\x00\xff\xff\xf6\xa0" "\x1c\xa1", 1712); syz_mount_image( /*fs=*/0x200000000000, /*dir=*/0x2000000000c0, /*flags=MS_LAZYTIME|MS_POSIXACL|MS_REC|MS_SYNCHRONOUS|MS_SILENT|MS_RELATIME|0x800*/ 0x221c810, /*opts=*/0x200000000100, /*chdir=*/0x11, /*size=*/0x6b0, /*img=*/0x200000000640); // open arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: open_flags = 0x64842 (8 bytes) // mode: open_mode = 0x86 (8 bytes) // ] // returns fd memcpy((void*)0x200000000080, "./file1\000", 8); syscall( __NR_open, /*file=*/0x200000000080ul, /*flags=O_NONBLOCK|O_NOFOLLOW|O_NOATIME|O_DIRECT|O_CREAT|0x2*/ 0x64842ul, /*mode=S_IWOTH|S_IROTH|S_IWUSR*/ 0x86ul); // creat arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // mode: open_mode = 0x0 (8 bytes) // ] // returns fd memcpy((void*)0x200000000580, "./bus\000", 6); syscall(__NR_creat, /*file=*/0x200000000580ul, /*mode=*/0ul); // rename arguments: [ // old: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // new: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // ] memcpy((void*)0x200000000080, "./bus\000", 6); memcpy((void*)0x2000000000c0, "./file1\000", 8); syscall(__NR_rename, /*old=*/0x200000000080ul, /*new=*/0x2000000000c0ul); // unlinkat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: unlinkat_flags = 0x0 (8 bytes) // ] memcpy((void*)0x200000000000, "./file1\000", 8); syscall(__NR_unlinkat, /*fd=*/0xffffff9c, /*path=*/0x200000000000ul, /*flags=*/0ul); return 0; }