// https://syzkaller.appspot.com/bug?id=487023d89abc146dc9dcf191b2d632847e88fa94 // 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 #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; static __thread int clone_ongoing; static __thread int skip_segv; static __thread jmp_buf segv_env; static void segv_handler(int sig, siginfo_t* info, void* ctx) { if (__atomic_load_n(&clone_ongoing, __ATOMIC_RELAXED) != 0) { exit(sig); } uintptr_t addr = (uintptr_t)info->si_addr; const uintptr_t prog_start = 1 << 20; const uintptr_t prog_end = 100 << 20; int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0; int valid = addr < prog_start || addr > prog_end; if (skip && valid) { _longjmp(segv_env, 1); } exit(sig); } static void install_segv_handler(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_IGN; syscall(SYS_rt_sigaction, 0x20, &sa, NULL, 8); syscall(SYS_rt_sigaction, 0x21, &sa, NULL, 8); memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = segv_handler; sa.sa_flags = SA_NODEFER | SA_SIGINFO; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGBUS, &sa, NULL); } #define NONFAILING(...) \ ({ \ int ok = 1; \ __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \ if (_setjmp(segv_env) == 0) { \ __VA_ARGS__; \ } else \ ok = 0; \ __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \ ok; \ }) //% 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[1] = {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; install_segv_handler(); intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$ext4 arguments: [ // fs: ptr[in, buffer] { // buffer: {65 78 74 34 00} (length 0x5) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: mount_flags = 0x800080 (8 bytes) // opts: ptr[in, fs_options[ext4_options]] { // fs_options[ext4_options] { // elems: array[fs_opt_elem[ext4_options]] { // fs_opt_elem[ext4_options] { // elem: union ext4_options { // test_dummy_encryption: buffer: {74 65 73 74 5f 64 75 6d 6d 79 // 5f 65 6e 63 72 79 70 74 69 6f 6e} (length 0x15) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // journal_ioprio: fs_opt["journal_ioprio", fmt[hex, int32[0:7]]] // { // name: buffer: {6a 6f 75 72 6e 61 6c 5f 69 6f 70 72 69 6f} // (length 0xe) eq: const = 0x3d (1 bytes) val: int32 = 0x4 (18 // bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // errors_remount: buffer: {65 72 72 6f 72 73 3d 72 65 6d 6f 75 // 6e 74 2d 72 6f} (length 0x11) // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0x47d (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x47d) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x2000000008c0, "ext4\000", 5)); NONFAILING(memcpy((void*)0x200000000300, "./file1\000", 8)); NONFAILING(memcpy((void*)0x2000000000c0, "test_dummy_encryption", 21)); NONFAILING(*(uint8_t*)0x2000000000d5 = 0x2c); NONFAILING(memcpy((void*)0x2000000000d6, "journal_ioprio", 14)); NONFAILING(*(uint8_t*)0x2000000000e4 = 0x3d); NONFAILING(sprintf((char*)0x2000000000e5, "0x%016llx", (long long)4)); NONFAILING(*(uint8_t*)0x2000000000f7 = 0x2c); NONFAILING(memcpy((void*)0x2000000000f8, "errors=remount-ro", 17)); NONFAILING(*(uint8_t*)0x200000000109 = 0x2c); NONFAILING(*(uint8_t*)0x20000000010a = 0); NONFAILING(memcpy( (void*)0x200000000900, "\x78\x9c\xec\xdc\xcb\x6f\x1b\x45\x18\x00\xf0\x6f\x37\x8f\xbe\x49\x28\xe5" "\xd1\x07\x10\x28\x88\x88\x47\xd2\xb4\x05\x7a\xe0\x00\x08\x24\x0e\x45\x42" "\x82\x03\x1c\xa3\x24\xad\x4a\xd3\x06\x35\x41\x6a\xab\x08\x5a\x04\xe5\x84" "\x10\x12\x77\xe0\xc8\xbf\xc0\x09\x2e\x08\x71\x42\xe2\x0a\x77\x54\xa9\x42" "\xb9\xb4\xe5\x64\xb4\xde\xdd\xc6\x71\x1c\x37\x4e\xed\x18\xea\xdf\x4f\xda" "\x76\x66\x77\x76\x67\x3e\xef\x8e\x3d\xbb\x63\x27\x80\x9e\x35\x92\xfd\x93" "\x44\xec\x8c\x88\x3f\x22\x62\x28\xcf\xae\x2c\x30\x92\xff\x77\x63\x69\x71" "\xea\xe6\xd2\xe2\x54\x12\x95\xca\xdb\x7f\x27\xd5\x72\xd7\x97\x16\xa7\xca" "\xa2\xe5\x7e\x3b\x8a\xcc\x68\x1a\x91\x7e\x9a\xc4\xfe\x06\xf5\xce\x5f\xb8" "\x78\x7a\x72\x76\x76\xe6\x5c\x91\x1f\x5f\x38\xf3\xc1\xf8\xfc\x85\x8b\xcf" "\x9d\x3a\x33\x79\x72\xe6\xe4\xcc\xd9\xc3\xc7\x8e\x1d\x3d\x32\xf1\xe2\x0b" "\x87\x9f\x6f\xd4\xec\x6f\x3f\x6b\x31\xce\xac\x4d\xd7\xf7\x7d\x34\x77\x60" "\xef\x1b\xef\x7d\xf5\xe6\xf1\x2f\xb2\x75\x83\x65\xfc\x75\x71\xb4\xc9\x48" "\xb3\x8d\x4f\x56\x2a\x6d\xae\xae\xbb\x76\xd5\xa4\x93\xfe\x2e\x36\x84\x96" "\xf4\x45\x44\x76\xba\x06\xaa\xfd\x7f\x28\xfa\x62\xf9\xe4\x0d\xc5\xeb\x9f" "\x74\xb5\x71\x40\x47\x55\x2a\x95\xca\x8e\xb5\x37\x5f\xaa\x00\x77\xb1\xed" "\x35\xef\x04\x19\x5d\x1e\x7a\x45\xf9\x41\x9f\xdd\xff\x96\x4b\xfd\x20\xe0" "\xe5\xce\x0c\x3d\xfe\x13\xae\xbd\x92\xdf\x00\x5d\xdf\x1a\x53\x37\x96\x16" "\xab\x4b\xbe\xa5\x3f\xd2\xa2\xcc\x40\xdd\xfd\x6d\x3b\x8d\x44\xc4\xbb\x97" "\xfe\xf9\x26\x5b\xa2\x33\xcf\x21\x00\x00\x56\xf8\x31\x1b\xff\x3c\xdb\x68" "\xfc\x97\xc6\x03\x35\xe5\xee\x29\xe6\x86\x86\x23\xe2\xde\x88\xd8\x1d\x11" "\xf7\x45\xc4\x9e\x88\xb8\x3f\xa2\x5a\xf6\xc1\x88\x78\xa8\xc5\xfa\xeb\x27" "\x49\x56\x8f\x7f\xd2\xab\x1b\x0a\x6c\x9d\xb2\xf1\xdf\x4b\xc5\xdc\xd6\xca" "\xf1\x5f\x39\xfa\x8b\xe1\xbe\x22\xb7\xab\x1a\xff\x40\x72\xe2\xd4\xec\xcc" "\xa1\xe2\x35\x19\x8d\x81\x2d\x59\x7e\xa2\x49\x1d\x3f\xbd\xf6\xfb\x97\x6b" "\x6d\xab\x1d\xff\x65\x4b\x56\x7f\x39\x16\x2c\xda\x71\xb5\x7f\xcb\xca\x7d" "\xa6\x27\x17\x26\xef\x24\xe6\x5a\xd7\x2e\x47\xec\xeb\x6f\x14\x7f\x72\x6b" "\x26\x20\x89\x88\xbd\x11\xb1\x6f\x83\x75\x9c\x7a\xfa\xfb\x03\x6b\x6d\xbb" "\x7d\xfc\x4d\xb4\x61\x9e\xa9\xf2\x5d\xc4\x53\xf9\xf9\xbf\x14\x75\xf1\x97" "\x92\xe6\xf3\x93\xe3\x5b\x63\x76\xe6\xd0\x78\x79\x55\xac\xf6\xeb\x6f\x57" "\xde\x5a\xab\xfe\x3b\x8a\xbf\x0d\xb2\xf3\xbf\xbd\xe1\xf5\x7f\x2b\xfe\xe1" "\xa4\x76\xbe\x76\xbe\xf5\x3a\xae\xfc\xf9\xf9\x9a\xf7\x34\xeb\xbc\xfe\x87" "\x6b\xf7\xc9\xae\xff\xc1\xe4\x9d\x6a\x7a\xb0\x58\x77\x7e\x72\x61\xe1\xdc" "\x44\xc4\x60\x72\x3c\x6f\x74\xed\xfa\xc3\xcb\xfb\x96\xf9\xb2\x7c\x16\xff" "\xe8\xc1\xc6\xfd\x7f\x77\x2c\xbf\x12\xfb\x23\x22\xbb\x88\x1f\x8e\x88\x47" "\x22\xe2\xd1\xa2\xed\x8f\x45\xc4\xe3\x11\x71\xb0\x49\xfc\xbf\xbc\xfa\xc4" "\xfb\x1b\x8f\xbf\xb3\xb2\xf8\xa7\x5b\x3a\xff\xcb\x89\xc1\xa8\x5f\xd3\x38" "\xd1\x77\xfa\xe7\x1f\x56\x54\x3a\xbc\x2a\xfe\x9b\xcd\xcf\xff\xd1\x6a\x6a" "\xb4\x58\xb3\x9e\xf7\xbf\xf5\xb4\x6b\x63\x57\x33\x00\x00\x00\xfc\xff\xa4" "\x11\xb1\x33\x92\x74\xec\x56\x3a\x4d\xc7\xc6\xf2\xef\xcb\xef\x89\x48\x67" "\xe7\xe6\x17\x9e\x39\x31\xf7\xe1\xd9\xe9\xfc\x37\x02\xc3\x31\x90\x96\x4f" "\xba\x86\x6a\x9e\x87\x4e\x14\xb7\xf5\x79\xfe\x72\x44\xe4\x5f\x2d\x28\xb7" "\x1f\x29\x9e\x1b\x7f\xdd\xb7\xad\x9a\x1f\x9b\x9a\x9b\x9d\xee\x76\xf0\xd0" "\xe3\x76\xac\xd1\xff\x33\x7f\xf5\x75\xbb\x75\x40\xc7\xf9\xbd\x16\xf4\x2e" "\xfd\x1f\x7a\x97\xfe\x0f\xbd\xab\x71\xff\xdf\xb6\xe9\xed\x00\x36\x5f\x83" "\xfe\xaf\xf3\x43\x8f\x68\xf4\xf9\xff\x71\x17\xda\x01\x6c\xbe\xba\xfe\x6f" "\xda\x0f\x7a\x88\xe7\x7f\xd0\xbb\xf4\x7f\xe8\x5d\xfa\x3f\xf4\xa4\xf9\x6d" "\x71\xfb\x1f\xc9\x37\x4d\x94\x47\xda\xe0\xee\xcd\x12\xfd\xe7\xf3\x43\xb7" "\xff\xc8\x79\x62\x4b\x44\x74\xe6\xc8\x17\x2e\x9e\x8e\x81\x4e\x1d\xb9\x48" "\x0c\xb5\xf0\x67\x0e\xb6\xb6\xbf\x19\x91\x76\xec\xa5\xbb\x2b\x12\xd1\xdf" "\x99\x23\xa7\x9b\x14\x45\x17\xdf\x94\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\xda\xe8\xdf\x00\x00\x00\xff\xff\xc9\xfc\xd2\xbb", 1149)); NONFAILING(syz_mount_image(/*fs=*/0x2000000008c0, /*dir=*/0x200000000300, /*flags=MS_I_VERSION|MS_DIRSYNC*/ 0x800080, /*opts=*/0x2000000000c0, /*chdir=*/1, /*size=*/0x47d, /*img=*/0x200000000900)); // syz_mount_image$fuse arguments: [ // fs: nil // dir: ptr[in, buffer] { // buffer: {2e 2f 63 67 72 6f 75 70 00} (length 0x9) // } // flags: mount_flags = 0xa00008 (8 bytes) // opts: nil // chdir: int8 = 0xec (1 bytes) // size: const = 0x0 (8 bytes) // img: nil // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000400, "./cgroup\000", 9)); NONFAILING( syz_mount_image(/*fs=*/0, /*dir=*/0x200000000400, /*flags=MS_I_VERSION|MS_RELATIME|MS_NOEXEC*/ 0xa00008, /*opts=*/0, /*chdir=*/0xec, /*size=*/0, /*img=*/0)); // chdir arguments: [ // dir: ptr[in, buffer] { // buffer: {2e 2f 63 67 72 6f 75 70 00} (length 0x9) // } // ] NONFAILING(memcpy((void*)0x200000000540, "./cgroup\000", 9)); syscall(__NR_chdir, /*dir=*/0x200000000540ul); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 00} (length 0x2) // } // flags: open_flags = 0x0 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd NONFAILING(memcpy((void*)0x200000000080, ".\000", 2)); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000080ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[0] = res; // getdents64 arguments: [ // fd: fd_dir (resource) // ent: nil // count: len = 0x59 (8 bytes) // ] syscall(__NR_getdents64, /*fd=*/r[0], /*ent=*/0ul, /*count=*/0x59ul); return 0; }