// 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; } 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(); 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 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 // 61 61 00} (length 0xfd) // } // flags: mount_flags = 0x10 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // chdir: int8 = 0x11 (1 bytes) // size: len = 0x489 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x489) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000180, "udf\000", 4)); NONFAILING( memcpy((void*)0x2000000005c0, "./" "file0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000", 253)); NONFAILING(memcpy( (void*)0x200000000a40, "\x78\x9c\xec\xdb\xdb\x6b\x1c\xe5\x1f\xc7\xf1\xcf\x77\xb2\xbb\xd9\x6c\xfb" "\xfb\x75\xdb\xa6\x69\x95\x82\xab\x82\x4a\xc5\x9a\x43\x8f\xc6\x8b\x1e\x62" "\xa8\xd0\xa4\x39\x34\x22\x45\x85\x98\x6c\xe2\xd2\x9c\xc8\xa6\x92\x14\xd1" "\xe2\x8d\xb7\xde\x78\x23\x22\x0a\x0a\x52\x45\x0b\x22\xde\x78\xa5\xbd\xf3" "\x0f\x50\x10\x04\xbd\xf0\x42\x04\xf7\xc2\x03\x08\x82\xcc\xec\xcc\xce\x64" "\xb3\x69\xd2\xee\x21\xdd\xf6\xfd\x82\x76\x27\xcf\x7c\x67\xe6\x39\xec\x33" "\xcf\xb3\x3b\xcf\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x48\xa7" "\x9e\x3a\xd9\xd9\x65\x5b\x9d\x0b\x00\x00\xd0\x48\x83\xa3\x23\x9d\xdd\x8c" "\xff\x00\x00\xdc\x55\xce\xf3\xf9\x1f\x00\x00\xe0\x6e\x62\x72\xf4\xbd\x4c" "\x7d\x23\x05\x1b\xf0\xfe\x2e\x4a\x9e\xcd\xcd\x5d\x5a\x1e\xeb\xeb\xaf\x7c" "\x58\x9b\x79\x47\xb6\x78\xf1\xee\xbf\x64\x57\x77\xcf\xa1\xc3\x47\x8e\x1e" "\x0b\x5e\x6f\x7c\x7c\xad\xdd\xa3\x73\xa3\xe7\x4f\x66\x4e\xcf\xcf\x2e\x2c" "\x66\xf3\xf9\xec\x64\x66\x6c\x2e\x37\x31\x3f\x99\xdd\xf4\x19\xaa\x3d\xbe" "\xdc\x01\xaf\x02\x32\xb3\x17\x2f\x4d\x4e\x4d\xe5\x33\xdd\x07\x7b\x56\xed" "\x5e\x4e\xff\xd2\xba\xad\x23\xdd\x7b\xb4\xe3\x84\x13\xc4\x8e\xf5\xf5\xf7" "\x8f\x46\x62\x62\xf1\x5b\xbe\xfa\x1a\xeb\xcd\xf0\x13\x72\xb4\x4f\xa6\xdf" "\x1e\xfa\xd4\x06\x25\x39\xaa\xbe\x2e\x36\x78\xef\xd4\x5b\x9b\x57\x88\x03" "\x5e\x21\xc6\xfa\xfa\xbd\x82\xcc\xe4\xc6\xe7\x96\xdc\x9d\x43\x41\x45\x38" "\x7e\x59\x7d\x89\xa0\x8e\x1a\xd0\x16\x55\x69\x97\xdc\x7c\x59\xa2\x36\x9f" "\xd9\xe2\x72\x74\x42\xa6\x8e\x9f\x0b\x76\x4e\x52\x4b\x50\x0f\x8f\x7a\x5f" "\x0c\xaf\x7f\x60\xac\x26\x97\xbf\x65\x6e\x3e\x9f\x97\xf4\x80\x9a\xa0\xcd" "\x6e\x63\xad\x72\xf4\xa3\x4c\xb3\x3b\x92\x1a\xda\xfa\x66\x45\x83\xc5\xe4" "\x68\x59\xa6\x3f\x7a\x0b\x36\xec\xdd\x0f\xdc\xfe\xe4\xde\x36\xcf\x3e\x93" "\x79\x7a\x6e\x6a\x3e\x12\x3b\x64\x7e\x8f\x6a\xf6\xf1\xa1\x91\x6e\xf3\x7b" "\x53\x52\x8e\x06\xbd\x3b\x7e\xc1\x46\xb6\x3a\x33\x68\x38\x77\xb2\xf4\x96" "\x4c\x7b\x3e\x7e\xd9\x9b\x57\xc8\x9b\x97\xee\xe8\x3d\xfa\xc4\x70\x4f\x74" "\x86\xb1\x77\x83\xf3\xb8\xb1\x07\xfd\xf9\xe3\x66\xc6\xe4\xb8\x1f\x3b\x64" "\x43\x66\x4e\xed\xcb\x05\x00\x00\x00\x00\x00\x00\x40\x6a\x35\x47\xdf\xc9" "\x54\xf8\x2a\x13\x26\xa6\x4d\x4e\xe4\x91\x71\x52\xc5\x07\x43\x99\xad\xc9" "\x22\x80\x7a\x31\x47\x6f\xcb\x34\x3c\x52\xf0\xbe\x86\x8f\xae\x4b\x69\x89" "\xac\xef\x29\x69\xf6\x67\x7f\xf5\xcd\x7f\x5b\xf2\xf4\xfc\xc2\xca\x62\x6e" "\xfa\xa5\xa5\x8a\xfb\x53\xc9\x93\x2f\xe6\x97\x16\xc7\x27\x2a\xef\x56\x9b" "\x7b\x9f\x6d\x89\xa6\x6c\xb4\x8e\xa5\x4a\x71\x73\x94\x90\xe9\xb9\x3f\x3f" "\xb2\xd2\x75\x8b\xf7\x7f\x7f\x29\x40\x98\x9b\x0f\x9f\x0c\xd7\xcc\x24\xcb" "\xaf\xef\xbd\x6f\xfe\x5f\x5c\xcf\x14\x3c\x43\x3a\x7e\x61\x6f\x74\xbb\x62" "\x96\x6f\xe2\xf9\xa8\x7b\x4d\x33\x47\x4b\x32\x9d\xda\xb5\xcf\x5f\xab\x92" "\xd2\x9a\x3a\x53\x31\xee\x73\x99\x7e\x7f\x6f\xbf\x1f\xe7\x24\xdc\xcc\x07" "\xa7\x4d\x17\xcf\x38\x95\x9b\xc9\x76\xba\xb1\x5f\xcb\xf4\xfe\xbf\x41\xac" "\xb7\x2c\x4a\xdb\xfc\xd8\xdd\x61\x6c\x97\x1b\x6b\x32\xbd\x39\xb0\x3a\x76" "\xbb\x1f\xdb\x1e\xc6\x76\xbb\xb1\xfd\x32\x5d\x7f\xa1\x72\xec\x9e\x30\xb6" "\xc7\x8d\x7d\x5d\xa6\x85\x5f\x33\x41\x6c\xca\x8d\xbd\xcf\x8f\xed\x08\x63" "\x0f\x4e\xcc\xcf\x4c\x56\xaa\x4a\xe0\x66\xb9\xfd\xff\x27\x99\xde\x6d\xcf" "\x58\xd0\x37\x62\xc5\xf7\xdf\xda\xfe\xff\x4a\x38\x16\x5c\x29\x3f\xd1\x3a" "\x7d\xbe\xda\xfe\x9f\x8e\xa4\x5d\xf1\xfb\xf5\x05\xb7\xff\xff\xb5\xcf\xeb" "\xcb\x5e\xff\x77\x2a\xf7\xff\x37\x64\xfa\xe4\x8b\xfd\x7e\x5c\xb1\xef\x25" "\xfc\xfd\x3b\xbd\xff\xc3\xfe\xff\xac\x4c\xd3\xdf\xae\x8e\x4d\xf9\xb1\xbb" "\xc2\xd8\xae\x4d\x57\x6c\x93\x70\xdb\x7f\xbf\x4c\x67\xf6\x5c\x2b\xd5\x8d" "\xdf\xfe\x7e\x0b\x84\xad\x16\x6d\xff\x7b\xcb\xdf\x1d\x75\x6a\xff\x9d\x91" "\xb4\xb4\x7f\xdd\xd6\xda\x14\x1d\x92\xf2\x2b\x97\x2f\x8e\xcf\xcc\x64\x17" "\xd9\x60\x83\x0d\x36\x4a\x1b\x5b\x7d\x67\x42\x23\xb8\xe3\xff\x67\xee\x2c" "\xea\xcb\x1f\x4a\xf3\x1d\x7f\xfc\xf7\x3f\xa6\x84\x33\xab\xbf\x5f\x0d\xc7" "\xff\xde\xf2\x13\xd5\x69\xfc\xdf\x15\x49\xeb\xf5\x67\x23\xf1\x98\x94\x5c" "\x9a\x5d\x88\xef\x95\x92\xf9\x95\xcb\x8f\xe5\x66\xc7\xa7\xb3\xd3\xd9\xb9" "\x43\x9d\x47\x3a\x0f\x1f\x3a\xde\x75\xfc\x58\x3c\x11\x4c\xee\xc2\xad\xaa" "\xeb\xea\x4e\xe4\xb6\xff\x37\x32\xfd\xb3\xed\x6a\xe9\xf3\xee\xea\xf9\x5f" "\xe5\xf9\x7f\xaa\xfc\x44\x75\x6a\xff\xdd\x91\xb4\xd4\xaa\xf9\x4a\xd5\x45" "\x87\xdf\xfe\x57\x65\xba\xff\xfa\xb5\xd2\xf7\x12\x37\x9a\xff\x07\xdf\xff" "\x3c\xf2\x60\xf1\xb5\xd4\x3f\xeb\xd4\xfe\xed\x91\xb4\xb4\x7f\xdd\xff\xd5" "\xa6\xe8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\xd4\xe2" "\xe6\xe8\x03\x99\xce\x3c\x1e\xb3\xe0\xb7\x66\x9b\x59\xff\xb7\xe6\x07\x68" "\x75\x5a\xff\xd5\x11\x49\x9b\x6c\xd0\xef\x15\xaa\xae\x54\x00\x68\x02\x8e" "\x1c\xbd\x23\xd3\xc3\x2a\xd8\x6b\x6e\xc2\x76\x69\x20\xfa\x8a\x3b\xda\x7f" "\x01\x00\x00\xff\xff\x47\x01\x23\x8e", 1161)); NONFAILING(syz_mount_image(/*fs=*/0x200000000180, /*dir=*/0x2000000005c0, /*flags=MS_SYNCHRONOUS*/ 0x10, /*opts=*/0x2000000001c0, /*chdir=*/0x11, /*size=*/0x489, /*img=*/0x200000000a40)); // syz_mount_image$fuse arguments: [ // fs: nil // dir: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // flags: mount_flags = 0x3000009 (8 bytes) // opts: nil // chdir: int8 = 0x1 (1 bytes) // size: const = 0x0 (8 bytes) // img: nil // ] // returns fd_dir NONFAILING(memcpy((void*)0x2000000000c0, "./bus\000", 6)); NONFAILING(syz_mount_image( /*fs=*/0, /*dir=*/0x2000000000c0, /*flags=MS_LAZYTIME|MS_STRICTATIME|MS_RDONLY|MS_NOEXEC*/ 0x3000009, /*opts=*/0, /*chdir=*/1, /*size=*/0, /*img=*/0)); // mount$overlay arguments: [ // src: const = 0x0 (8 bytes) // dst: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // type: ptr[in, buffer] { // buffer: {6f 76 65 72 6c 61 79 00} (length 0x8) // } // flags: mount_flags = 0x0 (8 bytes) // opts: ptr[in, fs_options[overlay_options]] { // fs_options[overlay_options] { // elems: array[fs_opt_elem[overlay_options]] { // fs_opt_elem[overlay_options] { // elem: union overlay_options { // workdir: fs_opt["workdir", stringnoz[filename]] { // name: buffer: {77 6f 72 6b 64 69 72} (length 0x7) // eq: const = 0x3d (1 bytes) // val: buffer: {2e 2f 62 75 73} (length 0x5) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[overlay_options] { // elem: union overlay_options { // lowerdir: fs_opt["lowerdir", stringnoz[filename]] { // name: buffer: {6c 6f 77 65 72 64 69 72} (length 0x8) // eq: const = 0x3d (1 bytes) // val: buffer: {2e} (length 0x1) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[overlay_options] { // elem: union overlay_options { // upperdir: fs_opt["upperdir", stringnoz[filename]] { // name: buffer: {75 70 70 65 72 64 69 72} (length 0x8) // eq: const = 0x3d (1 bytes) // val: buffer: {2e 2f 66 69 6c 65 30} (length 0x7) // } // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // ] NONFAILING(memcpy((void*)0x200000000100, "./file0\000", 8)); NONFAILING(memcpy((void*)0x200000000b80, "overlay\000", 8)); NONFAILING(memcpy((void*)0x200000000000, "workdir", 7)); NONFAILING(*(uint8_t*)0x200000000007 = 0x3d); NONFAILING(memcpy((void*)0x200000000008, "./bus", 5)); NONFAILING(*(uint8_t*)0x20000000000d = 0x2c); NONFAILING(memcpy((void*)0x20000000000e, "lowerdir", 8)); NONFAILING(*(uint8_t*)0x200000000016 = 0x3d); NONFAILING(memset((void*)0x200000000017, 46, 1)); NONFAILING(*(uint8_t*)0x200000000018 = 0x2c); NONFAILING(memcpy((void*)0x200000000019, "upperdir", 8)); NONFAILING(*(uint8_t*)0x200000000021 = 0x3d); NONFAILING(memcpy((void*)0x200000000022, "./file0", 7)); NONFAILING(*(uint8_t*)0x200000000029 = 0x2c); NONFAILING(*(uint8_t*)0x20000000002a = 0); syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x200000000100ul, /*type=*/0x200000000b80ul, /*flags=*/0ul, /*opts=*/0x200000000000ul); return 0; }