// 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"); } 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; } uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; 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; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$udf arguments: [ // fs: ptr[in, buffer] { // buffer: {75 64 66 00} (length 0x4) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // flags: mount_flags = 0x14444 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {69 6f 63 68 61 72 73 65 74 3d 61 73 63 69 69 2c // 6e 6f 61 64 69 6e 69 63 62 00 00 64 69 6e 69 63 62 2c 67 69 64 3d // 69 67 6e 6f 72 65 2c 75 69 64 3d 66 6f 72 67 65 74 2c 75 6d 61 73 // 6b 3d 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 // 30 30 32 2c 07 6f 6e 67 61 64 2c 67 69 64 3d 77 1d 0f 4d 30 dc 61 // 46 9a 58 13 42 d9 8a 7a 4c 35 34 a9 71 c3 e2 6d e7 2e dc 9e c3 db // 40 3d 8b 2e 97 0b 9d ce a4 48 dd bb 5a 11 6c e6 f6 7d 99 a7 7a a5 // 0b ce 7f c5 45 1b cf 5b 13 e9 69 8d 80 38 5c 54 ff f7 7d 38 aa 97 // 03 31 4c d1 9a 07 58 93 a1 64 8d d8 ef 78 a1 18 12 2e e7 a0 e4 00 // 00 00 00 00 00 00 00 00 00 00 00} (length 0xcb) // } // union ANYUNION { // ANYRESDEC: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {2c 6e 6f 73 74 72 69 63 74 2c 00} (length 0xb) // } // } // } // chdir: int8 = 0xfe (1 bytes) // size: len = 0xc22 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0xc22) // } // ] // returns fd_dir memcpy((void*)0x200000000100, "udf\000", 4); memcpy((void*)0x200000000f00, "./file0\000", 8); memcpy((void*)0x200000001d80, "\x69\x6f\x63\x68\x61\x72\x73\x65\x74\x3d\x61\x73\x63\x69\x69\x2c\x6e" "\x6f\x61\x64\x69\x6e\x69\x63\x62\x00\x00\x64\x69\x6e\x69\x63\x62\x2c" "\x67\x69\x64\x3d\x69\x67\x6e\x6f\x72\x65\x2c\x75\x69\x64\x3d\x66\x6f" "\x72\x67\x65\x74\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\x30\x32" "\x2c\x07\x6f\x6e\x67\x61\x64\x2c\x67\x69\x64\x3d\x77\x1d\x0f\x4d\x30" "\xdc\x61\x46\x9a\x58\x13\x42\xd9\x8a\x7a\x4c\x35\x34\xa9\x71\xc3\xe2" "\x6d\xe7\x2e\xdc\x9e\xc3\xdb\x40\x3d\x8b\x2e\x97\x0b\x9d\xce\xa4\x48" "\xdd\xbb\x5a\x11\x6c\xe6\xf6\x7d\x99\xa7\x7a\xa5\x0b\xce\x7f\xc5\x45" "\x1b\xcf\x5b\x13\xe9\x69\x8d\x80\x38\x5c\x54\xff\xf7\x7d\x38\xaa\x97" "\x03\x31\x4c\xd1\x9a\x07\x58\x93\xa1\x64\x8d\xd8\xef\x78\xa1\x18\x12" "\x2e\xe7\xa0\xe4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 203); sprintf((char*)0x200000001e4b, "%020llu", (long long)0); memcpy((void*)0x200000001e5f, ",nostrict,\000", 11); memcpy( (void*)0x2000000002c0, "\x78\x9c\xec\xdd\x41\x6c\x1c\xd7\x7d\x07\xe0\xff\x1b\x2d\x45\x4a\x6e\x2b" "\x26\x4e\x54\xbb\x8d\xdb\x4d\x5b\xa4\x32\x63\xb9\xb2\xa4\x98\x8a\x55\xb8" "\xab\x9a\x66\x1b\x40\x96\x89\x50\xcc\x2d\x00\x57\xe4\x4a\x5d\x98\x22\x09" "\x92\x6a\x64\x23\x6d\x98\x5e\x7a\xe8\x21\x40\x51\xf4\x90\x13\x81\xd6\x28" "\x90\xa2\x81\xd1\x14\x41\x8f\x6c\xeb\x02\xc9\xc5\x87\x22\xa7\x9e\x88\x16" "\x36\x82\xa2\x07\xb6\x08\x90\x53\xc0\x60\x66\xdf\x8a\x4b\x8a\xb2\x68\x53" "\xa4\x28\xfb\xfb\x6c\xea\x37\x3b\xf3\xde\xcc\x7b\x33\xeb\x19\x59\xd0\x9b" "\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\xc4\xef\xbf" "\x7c\xe9\xcc\x73\xe9\x61\xb7\x02\x00\x38\x48\x57\xc6\xbf\x7c\xe6\xac\xe7" "\x3f\x00\x7c\xac\x5c\xf5\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x70\xd8\xa5\x28\xe2\xf1\x48\x31\x7f\x65\x3d\x4d\x56\x9f\x3b\x06\x2e" "\xb7\x67\x6f\xdd\x9e\x18\x19\xdd\xb9\xda\xb1\x54\xd5\x3c\x52\x95\x2f\x7f" "\x06\x9e\x3b\x7b\xee\xfc\x17\x9e\x1f\xbe\xd0\xcd\xf7\xaf\xff\xa0\x3d\x19" "\xaf\x8e\x5f\xbd\x54\x7f\x69\xee\xe6\xfc\x42\x6b\x71\xb1\x35\x5d\x9f\x98" "\x6d\x4f\xcd\x4d\xb7\x76\xbd\x87\xbd\xd6\xdf\x6e\xa8\x3a\x01\xf5\x9b\xaf" "\xdd\x9a\xbe\x7e\x7d\xb1\x7e\xf6\xd9\x73\x5b\x36\xdf\x1e\x7c\xaf\xff\xb1" "\x93\x83\x17\x87\x9f\x3e\xfd\x54\xb7\xec\xc4\xc8\xe8\xe8\x78\x4f\x99\x5a" "\xdf\x87\x3e\xfa\x5d\xee\x35\xc2\xe3\x68\x14\x71\x3a\x52\x3c\xf3\xdd\x1f" "\xa7\x66\x44\x14\xb1\xf7\x73\x71\x9f\xef\xce\x7e\x3b\x56\x75\x62\xa8\xea" "\xc4\xc4\xc8\x68\xd5\x91\x99\x76\x73\x76\xa9\xdc\x38\xd6\x3d\x11\x45\x44" "\xbd\xa7\x52\xa3\x7b\x8e\x0e\xe0\x5a\xec\x49\x23\x62\xb9\x6c\x7e\xd9\xe0" "\xa1\xb2\x7b\xe3\xf3\xcd\x85\xe6\xb5\x99\x56\x7d\xac\xb9\xb0\xd4\x5e\x6a" "\xcf\xcd\x8e\xa5\x4e\x6b\xcb\xfe\xd4\xa3\x88\x0b\x29\x62\x25\x22\xd6\xfa" "\xef\xde\x5d\x5f\x14\x51\x8b\x14\xdf\x3e\xb1\x9e\xae\x45\xc4\x91\xee\x79" "\xf8\x7c\x35\x30\xf8\xde\xed\x28\xf6\xb1\x8f\xbb\x50\xb6\xb3\xde\x17\xb1" "\x52\x3c\x02\xd7\xec\x10\xeb\x8f\x22\x5e\x89\x14\x3f\x79\xbb\x88\xa9\xf2" "\x9c\xe5\x9f\xf8\x5c\xc4\x2b\x65\x7e\x3f\xe2\xcd\x32\x5f\x8c\x48\xe5\x17" "\xe3\x7c\xc4\xbb\x3b\x7c\x8f\x78\x34\xd5\xa2\x88\xbf\x28\xaf\xff\xc5\xf5" "\x34\x1d\x11\x1b\x27\x3a\xeb\x47\xeb\x97\xbf\x52\xff\xd2\xec\xf5\xb9\x9e" "\xb2\xdd\xfb\xca\x23\xff\x7c\x38\x48\x87\xfc\xde\x34\x10\x45\x34\xab\x3b" "\xfe\x7a\xfa\xf0\xbf\xd9\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\xe0\x41\x3b\x16\x45\x3c\x19\x29\x5e\xfe\x8f\x3f\xae\xc6\x15\x47\x35" "\x2e\xfd\xc4\xc5\xe1\x3f\x18\xfc\xc5\xde\x31\xe3\x4f\xdc\x67\x3f\x65\xd9" "\x67\x23\x62\xb9\xd8\xdd\x98\xdc\xa3\x79\x08\xf1\x58\x1a\x4b\xe9\x21\x8f" "\x25\xfe\x38\x1b\x88\x22\xfe\x24\x8f\xff\xfb\xe6\xc3\x6e\x0c\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xc7\x5a\x11\x3f\x8a\x14" "\x2f\xbc\x73\x2a\xad\x44\xef\x9c\xe2\xed\xd9\x1b\xf5\xab\xcd\x6b\x33\x9d" "\x59\x61\xbb\x73\xff\x76\xe7\x4c\xdf\xd8\xd8\xd8\xa8\xa7\x4e\x36\x72\x4e" "\xe6\x5c\xce\xb9\x92\x73\x35\xe7\x5a\xce\x28\x72\xfd\x9c\x8d\x9c\x93\x39" "\x97\x73\xae\xe4\x5c\xcd\xb9\x96\x33\x8e\xe4\xfa\x39\x1b\x39\x27\x73\x2e" "\xe7\x5c\xc9\xb9\x9a\x73\x2d\x67\xd4\x72\xfd\x9c\x8d\x9c\x93\x39\x97\x73" "\xae\xe4\x5c\xcd\xb9\x96\x33\x0e\xc9\xdc\xbd\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x1f\x25\x45\x14\xf1\xb3\x48\xf1\xad\xaf\xad\xa7\x48\x11" "\xd1\x88\x98\x8c\x4e\xae\xf6\x77\xcb\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x53\x7f\x2a\xe2\x7b\x91" "\xa2\xfe\x87\x8d\x3b\xeb\x6a\x11\x91\xaa\x7f\x3b\x4e\x95\xbf\x9c\x8f\xc6" "\xd1\x32\x3f\x19\x8d\xe1\x32\x5f\x8c\xc6\xa5\x9c\xcd\x2a\x6b\x8d\x6f\xde" "\xf7\x68\x69\x5f\xfa\xc0\x87\xd7\x97\x8a\xf8\x61\xa4\xe8\x1f\x78\xeb\xce" "\xd5\xc9\xd7\xbf\xaf\xf3\x69\xf3\x9a\xbd\xf9\xf5\xcd\x4f\xbf\x52\xeb\xe4" "\x91\xee\xc6\xc1\xf7\xfa\x1f\x3b\x79\xe2\xe2\xf0\xe8\xaf\x3d\x71\xaf\xe5" "\x1d\xaf\xfe\xd0\xe5\xf6\xec\xad\xdb\xf5\x89\x91\xd1\xd1\xf1\x9e\xd5\xb5" "\x7c\xf4\x4f\xf6\xac\x1b\xcc\xc7\x2d\x1e\x4c\xd7\x89\x88\xc5\xd7\xdf\x78" "\xad\x39\x33\xd3\x5a\xb0\xf0\xf1\x58\xa8\x75\x16\x6a\x71\x48\xda\x73\x50" "\x0b\xf9\x7e\x15\x87\xa5\x3d\xdb\x17\x1a\x87\xa3\x19\x9b\x0b\x0f\xf9\xc6" "\xc4\x81\x28\x9f\xff\xef\x46\x8a\xdf\x79\xe7\x3f\xbb\x0f\xfc\xee\xf3\xff" "\x17\x3a\x9f\xee\x3c\xe1\xe3\xa7\x7f\xba\xf9\xfc\x7f\x61\xfb\x8e\xf6\xe9" "\xf9\xff\x78\xcf\xba\x17\xf2\xef\x46\xfa\x6a\x11\x03\x4b\x37\xe7\xfb\x4e" "\x46\x0c\x2c\xbe\xfe\xc6\xe9\xf6\xcd\xe6\x8d\xd6\x8d\xd6\xec\xf9\x33\x67" "\xbe\x38\x3c\xfc\xc5\x73\x67\xfa\x8e\x46\x0c\x5c\x6f\xcf\xb4\x7a\x96\xf6" "\x7c\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x56\x2a" "\xe2\xf7\x22\x45\xf3\x87\xeb\xa9\x1e\x11\xb7\xab\xf1\x5a\x83\x17\x87\x9f" "\x3e\xfd\xd4\x91\x38\x52\x8d\xb7\xda\x32\x6e\xeb\xd5\xf1\xab\x97\xea\x2f" "\xcd\xdd\x9c\x5f\x68\x2d\x2e\xb6\xa6\xeb\x13\xb3\xed\xa9\xb9\xe9\xd6\x6e" "\x0f\x37\x50\x0d\xf7\x9a\x18\x19\xdd\x97\xce\xdc\xd7\xb1\x7d\x6e\xff\xb1" "\x81\x97\xe6\xe6\x5f\x5f\x68\xdf\xf8\xa3\xa5\x1d\xb7\x1f\x1f\xb8\x74\x6d" "\x71\x69\xa1\x39\xb5\xf3\xe6\x38\x16\x45\x44\xa3\x77\xcd\x50\xd5\xe0\x89" "\x91\xd1\xaa\xd1\x33\xed\xe6\x6c\x55\x75\xec\x01\xbd\x4a\xa1\x2f\x15\xf1" "\x5f\x91\x62\xea\x7c\x3d\x7d\x36\xaf\xcb\xe3\xff\xb6\x8f\xf0\xdf\x32\xfe" "\x7f\x79\xfb\x8e\xf6\x69\xfc\xdf\x27\x7a\xd6\x95\xc7\x4c\xa9\x88\x9f\x46" "\x8a\xdf\xfe\xcb\x27\xe2\xb3\x55\x3b\x8f\xc7\x5d\xe7\x2c\x97\xfb\xdb\x48" "\x31\x74\xe1\x33\xb9\x5c\x1c\x2d\xcb\x75\xdb\xd0\x79\xaf\x40\x67\x64\x60" "\x59\xf6\xff\x22\xc5\x3f\xfe\x6c\x6b\xd9\xee\x78\xc8\xc7\x37\xcb\x3e\xb7" "\xeb\x13\xfb\x88\x28\xaf\xff\x89\x48\xf1\xbd\x3f\xff\x4e\xfc\x46\x5e\xb7" "\xf5\xfd\x0f\x3b\x5f\xff\xe3\xdb\x77\xb4\x4f\xd7\xff\x53\x3d\xeb\x8e\x6f" "\x79\x5f\xc1\x9e\xbb\x4e\xbe\xfe\xa7\x23\xc5\x8b\x8f\xbf\x15\xbf\x99\xd7" "\xbd\xdf\xfb\x3f\x8a\xd8\xd8\xd8\xf8\x46\xc4\xa9\x5c\xf8\xce\xfb\x39\xf6" "\xe9\xfa\x7f\xba\x67\xdd\x60\x74\x8e\xfb\x5b\x0f\xae\xfb\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x8f\xac\xbe\x54\xc4\xdf\x45\x8a\xa7\x46\x6b\xe9\xf9" "\xbc\x6e\x37\x7f\xff\x6f\x7a\xfb\x8e\xf6\xe9\xef\x7f\xfd\x72\xcf\xba\xe9" "\x03\x9a\xaf\x68\xcf\x27\x15\x00\x00\x00\x00\x0e\x89\xbe\x54\xc4\x8f\x22" "\xc5\x8d\xa5\xb7\xee\x8c\xa1\xde\x3a\xfe\xbb\x67\xfc\xe7\xef\x6e\xce\xbd" "\x3e\x92\xb6\x6d\xad\xfe\x9c\xef\x97\xaa\xf7\x06\x3c\xc8\x3f\xff\xeb\x35" "\x98\x8f\x3b\xb9\xf7\x6e\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xc0\xa1\x92\x52\x11\xcf\xe7\xf9\xd4\x27\xef\x33\x9f\xfa\x6a" "\xa4\x78\xf9\x7f\x9e\xc9\xe5\xd2\xc9\xb2\x5c\x77\x1e\xf8\xc1\xea\xd7\x81" "\x2b\x73\xb3\xa7\x2f\xcd\xcc\xcc\x4d\x35\x97\x9a\xd7\x66\x5a\xf5\xf1\xf9" "\xe6\x54\xab\xac\xfb\xa9\x48\xb1\xfe\x37\x9f\xc9\x75\x8b\x6a\x7e\xf5\xee" "\x7c\xf3\x9d\x39\xde\x07\x36\xba\x73\xb1\x2f\x44\x8a\xd1\xbf\xef\x96\xed" "\xcc\xc5\xde\x9d\x9b\xbc\x33\x1f\x78\x67\x2e\xf6\xb2\xec\x27\x22\xc5\x7f" "\xff\xc3\xd6\xb2\xdd\x79\xac\x3f\xbd\x59\xf6\x6c\x59\xf6\xaf\x23\xc5\x57" "\xff\x79\xe7\xb2\x27\x37\xcb\x9e\x2b\xcb\x7e\x27\x52\xfc\xe0\xab\xf5\x6e" "\xd9\xe3\x65\xd9\xee\xfb\x51\x3b\xef\x24\x1d\xa8\xc5\x4c\xeb\xd9\xa9\xb9" "\x99\xbb\x5e\x85\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x1f\x54\x5f\x2a\xe2\xcf\x22\xc5\xff\xde\x5c\x89\xe5\x3c\xec\x3f" "\xcf\xff\xdf\x9d\x81\xbf\xd6\x2d\xfb\xe6\xd7\x7b\xe6\xfb\xdf\xe6\x76\x35" "\xcf\xff\x60\x35\xff\xff\xbd\x96\x3f\xcc\xfc\xff\x83\x0f\xac\xa7\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\xe8\x48" "\x51\xc4\x1b\x91\x62\xfe\xca\x7a\x5a\xed\x2f\x3f\x77\x0c\x5c\x6e\xcf\xde" "\xba\x3d\x31\x32\xba\x73\xb5\x63\xa9\xaa\x79\xa4\x2a\x5f\xfe\x0c\x3c\x77" "\xf6\xdc\xf9\x2f\x3c\x3f\x7c\xa1\x9b\xef\x5f\xff\x41\x7b\x32\x5e\x1d\xbf" "\x7a\xa9\xfe\xd2\xdc\xcd\xf9\x85\xd6\xe2\x62\x6b\xba\x3e\x31\xdb\x9e\x9a" "\x9b\x6e\xed\x7a\x0f\x7b\xad\xbf\x79\xea\x3a\x86\xaa\x13\x50\xbf\xf9\xda" "\xad\xe9\xeb\xd7\x17\xeb\x67\x9f\x3d\xb7\x65\xf3\xed\xc1\xf7\xfa\x1f\x3b" "\x39\x78\x71\xf8\xe9\xd3\x4f\x75\xcb\x4e\x8c\x8c\x8e\x8e\xf7\x94\xa9\xf5" "\x7d\x80\xa3\x7f\xa0\xc6\x6d\x3a\x1a\x45\xfc\x55\xa4\x78\xe6\xbb\x3f\x4e" "\xff\xd2\x1f\x51\xc4\xde\xcf\xc5\x7d\xbe\x3b\xfb\xed\x58\xd5\x89\xa1\xaa" "\x13\x13\x23\xa3\x55\x47\x66\xda\xcd\xd9\xa5\x72\xe3\x58\xf7\x44\x14\x11" "\xf5\x9e\x4a\x8d\xee\x39\x3a\x80\x6b\xb1\x27\x8d\x88\xe5\xb2\xf9\x65\x83" "\x87\xca\xee\x8d\xcf\x37\x17\x9a\xd7\x66\x5a\xf5\xb1\xe6\xc2\x52\x7b\xa9" "\x3d\x37\x3b\x96\x3a\xad\x2d\xfb\x53\x8f\x22\x2e\xa4\x88\x95\x88\x58\xeb" "\xbf\x7b\x77\x7d\x51\xc4\x6b\x91\xe2\xdb\x27\xd6\xd3\xbf\xf6\x47\x1c\xe9" "\x9e\x87\xcf\x5f\x19\xff\xf2\x99\xb3\xf7\x6e\x47\xb1\x8f\x7d\xdc\x85\xb2" "\x9d\xf5\xbe\x88\x95\xe2\x11\xb8\x66\x87\x58\x7f\x14\xf1\x4f\x91\xe2\x27" "\x6f\x9f\x8a\x7f\xeb\x8f\xa8\x45\xe7\x27\x3e\x17\xf1\x4a\x99\xdf\x8f\x78" "\xb3\xcc\x17\x23\x52\x8a\xd8\xf8\x46\xc4\xbb\x3b\x7c\x8f\x78\x34\xd5\xa2" "\x88\xff\x2f\xaf\xff\xc5\xf5\xf4\x76\x7f\x79\x3f\xe8\xde\x57\x2e\x7f\xa5" "\xfe\xa5\xd9\xeb\x73\x3d\x65\xbb\xf7\x95\x5d\x3d\x1f\x7e\xfd\xde\xc7\x7c" "\xe8\xcf\x87\x83\x74\xc8\xef\x4d\x03\x51\xc4\x0f\xaa\x3b\xfe\x7a\xfa\x77" "\xff\x5d\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x22\x45" "\xfc\x6a\xa4\x78\xe1\x9d\x53\xa9\x1a\x1f\x7c\x67\x4c\x71\x7b\xf6\x46\xfd" "\x6a\xf3\xda\x4c\x67\x58\x5f\x77\xec\x5f\x77\xcc\xf4\xc6\xc6\xc6\x46\x3d" "\x75\xb2\x91\x73\x32\xe7\x72\xce\x95\x9c\xab\x39\xd7\x72\x46\x91\xeb\xe7" "\x6c\xe4\x9c\xcc\xb9\x9c\x73\x25\xe7\x6a\xce\xb5\x9c\x71\x24\xd7\xcf\xd9" "\xc8\x39\x99\x73\x39\xe7\x4a\xce\xd5\x9c\x6b\x39\xa3\x96\xeb\xe7\x6c\xe4" "\x9c\xcc\xb9\x9c\x73\x25\xe7\x6a\xce\xb5\x9c\x71\x48\xc6\xee\x01\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x2d\x45\xf5\x4f\x8a" "\x6f\x7d\x6d\x3d\x6d\xf4\x77\xe6\x97\x9e\x8c\x4e\xae\x9a\x0f\xf4\x23\xef" "\xe7\x01\x00\x00\xff\xff\x37\x80\xfe\xbb", 3106); syz_mount_image(/*fs=*/0x200000000100, /*dir=*/0x200000000f00, /*flags=MS_POSIXACL|MS_REC|MS_NODEV|MS_NOATIME|0x40*/ 0x14444, /*opts=*/0x200000001d80, /*chdir=*/0xfe, /*size=*/0xc22, /*img=*/0x2000000002c0); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: open_flags = 0x2 (4 bytes) // mode: open_mode = 0x96 (2 bytes) // ] // returns fd memcpy((void*)0x200000000040, "./file1\000", 8); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000040ul, /*flags=O_RDWR*/ 2, /*mode=S_IWOTH|S_IROTH|S_IWGRP|S_IWUSR*/ 0x96); if (res != -1) r[0] = res; // pwrite64 arguments: [ // fd: fd (resource) // buf: ptr[in, buffer] { // buffer: {32} (length 0x1) // } // count: len = 0x155c2 (8 bytes) // pos: intptr = 0x8000c64 (8 bytes) // ] memset((void*)0x200000000140, 50, 1); syscall(__NR_pwrite64, /*fd=*/r[0], /*buf=*/0x200000000140ul, /*count=*/0x155c2ul, /*pos=*/0x8000c64ul); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: open_flags = 0x42 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x200000000440, "./file1\000", 8); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000440ul, /*flags=O_CREAT|O_RDWR*/ 0x42, /*mode=*/0); if (res != -1) r[1] = res; // write$P9_RREADLINK arguments: [ // fd: wfd9p (resource) // data: ptr[in, p9_msg[P9_RREADLINK, p9_rreadlink]] { // p9_msg[P9_RREADLINK, p9_rreadlink] { // size: bytesize = 0xffffffffffffff23 (4 bytes) // type: const = 0x17 (1 bytes) // tag: int16 = 0x2 (2 bytes) // payload: p9_rreadlink { // target_len: len = 0x7 (2 bytes) // target: buffer: {2e 2f 66 69 6c 65 30} (length 0x7) // } // } // } // size: bytesize = 0xfffffdab (8 bytes) // ] *(uint32_t*)0x200000000000 = 0xffffff23; *(uint8_t*)0x200000000004 = 0x17; *(uint16_t*)0x200000000005 = 2; *(uint16_t*)0x200000000007 = 7; memcpy((void*)0x200000000009, "./file0", 7); syscall(__NR_write, /*fd=*/r[1], /*data=*/0x200000000000ul, /*size=*/0xfffffdabul); // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // mode: open_mode = 0x0 (8 bytes) // ] memcpy((void*)0x2000000000c0, "./bus\000", 6); syscall(__NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x2000000000c0ul, /*mode=*/0ul); return 0; }