// 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$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 32 00} (length 0x8) // } // flags: mount_flags = 0x88 (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 { // nogrpid: buffer: {6e 6f 67 72 70 69 64} (length 0x7) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // min_batch_time: fs_opt["min_batch_time", fmt[hex, int32]] { // name: buffer: {6d 69 6e 5f 62 61 74 63 68 5f 74 69 6d 65} // (length 0xe) eq: const = 0x3d (1 bytes) val: int32 = 0x0 (18 // bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // debug_want_extra_isize: fs_opt["debug_want_extra_isize", // fmt[hex, int32]] { // name: buffer: {64 65 62 75 67 5f 77 61 6e 74 5f 65 78 74 72 // 61 5f 69 73 69 7a 65} (length 0x16) eq: const = 0x3d (1 // bytes) val: int32 = 0x68 (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // nobarrier: buffer: {6e 6f 62 61 72 72 69 65 72} (length 0x9) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // nodiscard: buffer: {6e 6f 64 69 73 63 61 72 64} (length 0x9) // } // comma: const = 0x2c (1 bytes) // } // 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) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0x3 (1 bytes) // size: len = 0x45c (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x45c) // } // ] // returns fd_dir memcpy((void*)0x200000000540, "ext4\000", 5); memcpy((void*)0x2000000001c0, "./file2\000", 8); memcpy((void*)0x200000000240, "nogrpid", 7); *(uint8_t*)0x200000000247 = 0x2c; memcpy((void*)0x200000000248, "min_batch_time", 14); *(uint8_t*)0x200000000256 = 0x3d; sprintf((char*)0x200000000257, "0x%016llx", (long long)0); *(uint8_t*)0x200000000269 = 0x2c; memcpy((void*)0x20000000026a, "debug_want_extra_isize", 22); *(uint8_t*)0x200000000280 = 0x3d; sprintf((char*)0x200000000281, "0x%016llx", (long long)0x68); *(uint8_t*)0x200000000293 = 0x2c; memcpy((void*)0x200000000294, "nobarrier", 9); *(uint8_t*)0x20000000029d = 0x2c; memcpy((void*)0x20000000029e, "nodiscard", 9); *(uint8_t*)0x2000000002a7 = 0x2c; memcpy((void*)0x2000000002a8, "test_dummy_encryption", 21); *(uint8_t*)0x2000000002bd = 0x2c; *(uint8_t*)0x2000000002be = 0; memcpy( (void*)0x200000000580, "\x78\x9c\xec\xdb\xcd\x8f\x53\x55\x1b\x00\xf0\xe7\x76\x5a\xbe\x79\x67\x5e" "\x82\x1f\x7c\xa8\xa3\x68\x24\x7e\xcc\x30\x03\x22\x0b\x37\x1a\x4d\x5c\x68" "\x62\xa2\x0b\x74\x37\xce\x0c\x04\x29\x8c\x61\xc6\x44\x08\xd1\xd1\x18\x5c" "\x1a\x12\x17\xee\x88\xee\x4c\xfc\x0b\x5c\xe9\xc6\x28\x2b\x13\xb7\xba\x37" "\x24\xc4\xb0\x01\x59\xd5\xdc\xf6\xde\xa1\x2d\x6d\x29\xb5\xb4\x60\x7f\xbf" "\xa4\xf4\x9c\xde\x73\x73\x9e\x87\x7b\x4f\xef\xb9\xf7\x4c\x03\x18\x59\x93" "\xe9\x3f\x49\xc4\x96\x88\xf8\x3d\x22\xc6\x6b\xd5\xc6\x06\x93\xb5\xb7\x6b" "\x57\xce\xce\xff\x7d\xe5\xec\x7c\x12\x95\xca\x9b\x7f\x25\xd5\x76\x57\xaf" "\x9c\x9d\xcf\x9b\xe6\xfb\x6d\xce\x2b\xc5\x88\xc2\x67\x49\xec\x6a\xd1\xef" "\xf2\xe9\x33\xc7\xe7\xca\xe5\xc5\x53\x59\x7d\x7a\xe5\xc4\xfb\xd3\xcb\xa7" "\xcf\x3c\x7b\xec\xc4\xdc\xd1\xc5\xa3\x8b\x27\x67\x0f\x1d\x3a\xb0\x7f\xe6" "\xf9\x83\xb3\xcf\xf5\x25\xcf\x34\xaf\xab\x3b\x3f\x5a\xda\xbd\xe3\xd5\xb7" "\xcf\xbf\x3e\x7f\xf8\xfc\xbb\xbf\x7c\x97\xe4\xf9\x37\xe5\xd1\x27\x93\x9d" "\x36\x3e\x51\xa9\xf4\xb9\xbb\xe1\xda\x5a\x57\x4e\x8a\xf1\xcd\x57\x43\x8c" "\x85\xee\x8d\xd5\x86\x69\x94\xaa\xe3\x7f\x3c\xc6\xaa\xb5\x9a\xf1\x78\xe5" "\xd3\xa1\x06\x07\xdc\x51\x95\x4a\xa5\x72\x7f\xfb\xcd\xab\x15\xe0\x3f\x2c" "\x89\x61\x47\x00\x0c\x47\x7e\xa1\x4f\xef\x7f\xf3\xd7\x80\xa6\x1e\x77\x85" "\xcb\x2f\xd6\x6e\x80\xd2\xbc\xaf\x65\xaf\xda\x96\x62\x14\xb2\x36\xa5\xa6" "\xfb\xdb\x7e\x9a\x8c\x88\xc3\xab\xd7\x2f\xa4\xaf\xb8\x33\xcf\x21\x00\x00" "\x1a\xfc\x90\xce\x7f\x9e\x69\x35\xff\x2b\x44\xfd\x73\xa1\xff\x65\x6b\x28" "\x13\x11\xf1\xff\x88\xd8\x16\x11\x07\x23\x62\x7b\x44\xdc\x17\x51\x6d\xfb" "\x40\x44\x3c\x78\x9b\xfd\x37\x2f\x92\xdc\x3c\xff\x29\x5c\xea\x29\xb1\x2e" "\xa5\xf3\xbf\x17\xb2\xb5\xad\xc6\xf9\x5f\x3e\xfb\x8b\x89\xb1\xac\xb6\xb5" "\x9a\x7f\x29\x39\x72\xac\xbc\xb8\x2f\xfb\x3f\xd9\x1b\xa5\xf5\x69\x7d\xa6" "\x43\x1f\x3f\xbe\xfc\xdb\x17\xed\xb6\x55\xe7\x7f\xa5\xac\xb2\x7a\xfd\x42" "\xda\x7f\x3e\x17\xcc\xe2\xb8\x54\x5c\xdf\xb8\xcf\xc2\xdc\xca\x5c\xaf\xf9" "\x36\xbb\xfc\x49\xc4\xce\x62\xab\xfc\x93\xb5\x95\x80\x24\x22\x76\x44\xc4" "\xce\x1e\xfb\x38\xf6\xd4\xb7\xbb\xdb\x6d\xab\x9f\xff\x1e\x6e\x99\x7f\x07" "\xc5\x1e\x03\xaa\x53\xf9\x3a\xe2\xc9\xda\xf1\x5f\x8d\xa6\xfc\x73\x49\xe7" "\xf5\xc9\xe9\x0d\x51\x5e\xdc\x37\x9d\x9f\x15\x37\xbb\xf8\xeb\xb9\x37\xda" "\xf5\xff\xaf\xf2\xef\x83\xf4\xf8\x6f\x6a\x79\xfe\xaf\x99\x48\xea\xd7\x6b" "\x97\x6f\xbf\x8f\x73\x7f\x7c\xde\xf6\x9e\xe6\xd6\xf9\xb7\x3e\xff\xd7\x25" "\x6f\x55\xcb\xf9\x51\xfa\x70\x6e\x65\xe5\xd4\x4c\xc4\xba\xe4\xb5\x5a\xd0" "\xf5\x9f\xcf\xde\xd8\x37\xaf\xe7\xed\xd3\xfc\xf7\xee\x69\x3d\xfe\xb7\x65" "\xfb\xa4\x7d\xec\x8a\x88\xf4\x24\x7e\x28\x22\x1e\x8e\x88\x47\xb2\xd8\x1f" "\x8d\x88\xc7\x22\x62\x4f\x87\xfc\x7f\x7e\xe9\xf1\xf7\x7a\xcf\xbf\xc1\x86" "\x0e\xdd\xf4\x24\xcd\x7f\xa1\xe5\xf1\x5f\x3b\xff\x9b\x8e\xff\x8d\xc2\xba" "\x68\xfe\xa4\x75\x61\xec\xf8\x4f\xdf\x37\x74\x3a\x71\x3b\xf9\xa7\xc7\xff" "\x40\xb5\xb4\x37\xfb\xa4\x9b\xef\xbf\x6e\xe2\xea\xed\x6c\x06\x00\x00\x80" "\x7b\x4f\x21\x22\xb6\x44\x52\x98\x5a\x2b\x17\x0a\x53\x53\xb5\xbf\xe1\xdf" "\x1e\x9b\x0a\xe5\xa5\xe5\x95\xa7\x8f\x2c\x7d\x70\x72\xa1\xf6\x1b\x81\x89" "\x28\x15\xf2\x27\x5d\xe3\x75\xcf\x43\x67\xb2\xdb\xfa\xbc\x3e\xdb\x54\xdf" "\x9f\x3d\x37\xfe\x72\x6c\x63\xb5\x3e\x35\xbf\x54\x5e\x18\x76\xf2\x30\xe2" "\x36\xb7\x19\xff\xa9\x3f\xc7\x86\x1d\x1d\x70\xc7\xf5\x61\x1d\x0d\xb8\x47" "\x19\xff\x30\xba\x8c\x7f\x18\x5d\xc6\x3f\x8c\xae\x16\xe3\x7f\x63\xf6\x7e" "\x71\xd0\xb1\x00\x83\xd5\xea\xfa\xff\xf1\x10\xe2\x00\x06\xaf\x69\xfc\x5b" "\xf6\x83\x11\xe2\xfe\x1f\x46\x57\x37\xe3\xff\x9d\x01\xc4\x01\x0c\x9e\xeb" "\x3f\x8c\xa4\xe5\x8d\x71\xeb\x1f\xc9\x2b\x28\xdc\x54\x88\x42\x37\x8d\x93" "\xec\xda\x72\x77\xc4\xac\xd0\x7d\x61\xd8\xdf\x4c\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xfd\xf1\x4f\x00\x00\x00\xff\xff\x1e\x5a\xe0" "\xe5", 1116); syz_mount_image(/*fs=*/0x200000000540, /*dir=*/0x2000000001c0, /*flags=MS_NOEXEC|MS_DIRSYNC*/ 0x88, /*opts=*/0x200000000240, /*chdir=*/3, /*size=*/0x45c, /*img=*/0x200000000580); // 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 = 0x8 (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 { // 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) // } // 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 { // 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) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // ] memcpy((void*)0x200000000100, "./file0\000", 8); memcpy((void*)0x200000000b80, "overlay\000", 8); memcpy((void*)0x200000000180, "upperdir", 8); *(uint8_t*)0x200000000188 = 0x3d; memcpy((void*)0x200000000189, "./file0", 7); *(uint8_t*)0x200000000190 = 0x2c; memcpy((void*)0x200000000191, "lowerdir", 8); *(uint8_t*)0x200000000199 = 0x3d; memset((void*)0x20000000019a, 46, 1); *(uint8_t*)0x20000000019b = 0x2c; memcpy((void*)0x20000000019c, "workdir", 7); *(uint8_t*)0x2000000001a3 = 0x3d; memcpy((void*)0x2000000001a4, "./bus", 5); *(uint8_t*)0x2000000001a9 = 0x2c; *(uint8_t*)0x2000000001aa = 0; syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x200000000100ul, /*type=*/0x200000000b80ul, /*flags=MS_NOEXEC*/ 8ul, /*opts=*/0x200000000180ul); return 0; }