// 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$ext4 arguments: [ // fs: ptr[in, buffer] { // buffer: {65 78 74 34 00} (length 0x5) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // flags: mount_flags = 0x21081e (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 { // i_version: buffer: {69 5f 76 65 72 73 69 6f 6e} (length 0x9) // } // comma: const = 0x2c (1 bytes) // } // 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 { // bh: buffer: {62 68} (length 0x2) // } // 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 = 0x523 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x523) // } // ] // returns fd_dir memcpy((void*)0x200000000180, "ext4\000", 5); memcpy((void*)0x200000000000, "./bus\000", 6); memcpy((void*)0x200000000080, "i_version", 9); *(uint8_t*)0x200000000089 = 0x2c; memcpy((void*)0x20000000008a, "nogrpid", 7); *(uint8_t*)0x200000000091 = 0x2c; memcpy((void*)0x200000000092, "bh", 2); *(uint8_t*)0x200000000094 = 0x2c; *(uint8_t*)0x200000000095 = 0; memcpy( (void*)0x200000000c00, "\x78\x9c\xec\xdd\xcf\x6f\x1c\x57\x1d\x00\xf0\xef\x4c\xb2\xb6\x93\xb8\x75" "\x5a\x7a\x00\x04\x6d\x68\x0b\x01\x45\x59\xc7\x9b\xd6\xaa\x7a\x80\x72\x42" "\x08\x55\x42\xf4\x08\x22\x35\xf6\xc6\xb2\xbc\xeb\xb5\xbc\xeb\x52\x9b\x48" "\xb8\x67\xae\x48\x54\xe2\x04\x47\xfe\x00\xce\x3d\x71\xe7\x82\xe0\xc6\xa5" "\x1c\x90\xf8\x61\x81\x6a\x24\x0e\x53\xcd\xec\xd8\xd9\xd8\xbb\xf6\xa6\x89" "\xbd\x96\xf7\xf3\x91\x46\xf3\xde\xbc\xf1\x7e\xdf\x8b\x33\xef\xcd\xbc\x5d" "\xef\x0b\x60\x6c\xdd\x88\x88\x9d\x88\x98\x88\x88\x77\x23\x62\xa6\x3c\x9e" "\x94\x5b\xbc\xd5\xdd\xf2\xf3\x3e\xd9\x7d\xb0\xb8\xb7\xfb\x60\x31\x89\x2c" "\x7b\xe7\x5f\x49\x51\x9e\x1f\x8b\x9e\x9f\xc9\x5d\x2b\x5f\x73\x2a\x22\x7e" "\xf0\x9d\x88\x9f\x24\x47\xe3\xb6\xb7\xb6\x57\x17\x1a\x8d\xfa\x46\x99\x9f" "\xed\x34\xd7\x67\xdb\x5b\xdb\xb7\x57\x9a\x0b\xcb\xf5\xe5\xfa\x5a\xad\x36" "\x3f\x37\x7f\xe7\x8d\xbb\xaf\xd7\x1e\xa3\x35\x53\xc7\x96\xbe\xd4\x9c\x28" "\x53\x5f\xfe\xf8\x8f\x3b\xdf\xf8\x59\x5e\xad\xe9\xf2\x48\x6f\x3b\x9e\xa6" "\x6e\xd3\x2b\x07\x71\x72\x97\x23\xe2\x7b\xa7\x11\x6c\x04\x2e\x95\xed\x99" "\x18\x75\x45\xf8\x4c\xd2\x88\x78\x3e\x22\x5e\x2e\xae\xff\x99\xb8\x54\xfc" "\x36\x01\x80\x8b\x2c\xcb\x66\x22\x9b\xe9\xcd\x03\x00\x17\x5d\x5a\xcc\x81" "\x25\x69\xb5\x9c\x0b\x98\x8e\x34\xad\x56\xbb\x73\x78\x2f\xc4\xd5\xb4\xd1" "\x6a\x77\x6e\xdd\x6f\x6d\xae\x2d\x75\xe7\xca\xae\x47\x25\xbd\xbf\xd2\xa8" "\xdf\x29\xe7\x0a\xaf\x47\x25\xc9\xf3\x73\x45\xfa\x61\xbe\x76\x28\x7f\x37" "\x22\x9e\x8b\x88\x5f\x4e\x5e\x29\xf2\xd5\xc5\x56\x63\x69\x94\x37\x3e\x00" "\x30\xc6\xae\x1d\x1a\xff\xff\x3b\xd9\x1d\xff\x01\x80\x0b\xee\xf8\x8f\xcd" "\x00\x00\x17\x91\xf1\x1f\x00\xc6\x8f\xf1\x1f\x00\xc6\x8f\xf1\x1f\x00\xc6" "\x4f\x77\xfc\xbf\xf2\xb8\x3f\x96\x65\xd9\xcf\x4f\xa3\x3a\x00\xc0\x19\xf0" "\xfc\x0f\x00\xe3\xc7\xf8\x0f\x00\x63\xe5\xfb\x6f\xbf\x9d\x6f\xd9\x5e\xf9" "\xfd\xd7\x4b\xef\x6d\x6d\xae\xb6\xde\xbb\xbd\x54\x6f\xaf\x56\x9b\x9b\x8b" "\xd5\xc5\xd6\xc6\x7a\x75\xb9\xd5\x5a\x2e\xbe\xb3\xa7\x79\xd2\xeb\x35\x5a" "\xad\xf5\xb9\xd7\x62\xf3\xfd\xeb\xdf\x5c\x6f\x77\x66\xdb\x5b\xdb\xf7\x9a" "\xad\xcd\xb5\xce\xbd\xe2\x7b\xbd\xef\xd5\x2b\xc5\x59\x3b\x67\xd0\x32\x00" "\x60\x90\xe7\x5e\xfa\xe8\x2f\x49\x3e\x22\xbf\x79\xa5\xd8\xa2\x67\x2d\x87" "\xca\x48\x6b\x06\x9c\xb6\x74\xd4\x15\x00\x46\xe6\xd2\xa8\x2b\x00\x8c\x8c" "\xd5\xbe\x60\x7c\x3d\x7c\xc6\x7f\xec\x0f\x01\x98\x1e\x80\x0b\xa2\xcf\x12" "\xbd\x8f\x98\xea\xf7\x07\x42\x59\x96\x65\xa7\x57\x25\xe0\x94\xdd\xfc\x82" "\xf9\x7f\x18\x57\x3d\xf3\xff\x3e\x05\x0c\x63\xe6\xa4\xf9\xff\x62\x6d\x60" "\x6f\x12\xc2\x85\x64\xfe\x1f\xc6\x57\x96\x25\xc3\xae\xf9\x1f\xc3\x9e\x08" "\x00\x9c\x6f\xc7\xcc\xf1\x5f\x3f\xcb\xfb\x10\x60\x74\x06\xbc\xff\xff\x7c" "\xb9\xff\x5d\xf9\xe6\xc0\x8f\x96\x0e\x9f\xf1\xe1\x69\xd6\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\xce\xb7\xfd\xf5\x7f\xab\xe5\x32\xbf\xd3\x91\xa6\xd5\x6a\xc4" "\x33\xc5\x02\x40\x95\xe4\xfe\x4a\xa3\x7e\x27\x22\x9e\x8d\x88\x3f\x4f\x56" "\x26\xf3\xfc\xdc\x88\xeb\x0c\x00\x3c\xa9\xf4\xef\x49\xb9\xfe\xd7\xcd\x99" "\x57\xa7\x1f\x29\x7a\xf1\xda\x41\x72\x22\x22\x7e\xfa\xeb\x77\x7e\xf5\xfe" "\x42\xa7\xb3\xf1\xa7\x88\x89\xe4\xdf\x93\xfb\xc7\x3b\x1f\x96\xc7\x6b\x27" "\x06\x9b\x3a\x8d\x16\x00\x00\xc7\xdb\x1f\xa7\x8b\x7d\xcf\x83\xfc\x27\xbb" "\x0f\x16\xf7\xb7\xb3\xac\xcf\x3f\xbe\xdd\xbd\x2b\xc8\xe3\xee\xed\x4e\xc4" "\xde\x41\xfc\xcb\x71\xb9\xd8\x4f\x45\x25\x22\xae\xfe\x27\x29\xf3\x5d\x49" "\xcf\xdc\xc5\x93\xd8\xf9\x20\x22\x3e\xdf\xaf\xfd\x49\x4c\x17\x73\x20\xdd" "\x5b\x96\xc3\xf1\xf3\xd8\xcf\x9c\x69\xfc\xf4\x91\xf8\x69\xb9\x40\x73\x5a" "\xfe\x5b\x7c\xee\x29\xd4\x05\xc6\xcd\x47\x79\xff\xf3\x56\xbf\xeb\x2f\x8d" "\x1b\xc5\xbe\xff\xf5\x3f\x55\xf4\x50\x4f\xae\xec\xff\xf2\x97\x5a\xdc\x2b" "\xfa\xc0\x87\xf1\xf7\xfb\xbf\x4b\x03\xfa\xbf\x1b\xc3\xc6\x78\xed\x0f\xdf" "\xed\xa6\xae\x1c\x2d\xfb\x20\xe2\x8b\x97\x23\xf6\x63\xef\xf5\xf4\x3f\xfb" "\xf1\x93\x01\xf1\x5f\x1d\x32\xfe\x5f\xbf\xf4\xe2\xcb\x83\xca\xb2\xdf\x44" "\xdc\x8c\xfe\xf1\x7b\x63\xcd\x76\x9a\xeb\xb3\xed\xad\xed\xdb\x2b\xcd\x85" "\xe5\xfa\x72\x7d\xad\x56\x9b\x9f\x9b\xbf\xf3\xc6\xdd\xd7\x6b\xb3\xc5\x1c" "\xf5\xec\xe0\xd1\xe0\x9f\x6f\xde\x7a\x76\x50\x59\xde\xfe\xab\x03\xe2\x4f" "\x9d\xd0\xfe\xaf\x0e\xd9\xfe\xdf\xfe\xff\xdd\x1f\x7e\xe5\x98\xf8\x5f\x7f" "\xa5\x5f\xfc\x34\x5e\x38\x26\x7e\x3e\x26\x7e\x6d\xc8\xf8\x0b\x57\x7f\x3f" "\xf0\xb9\x3b\x8f\xbf\x74\xb4\xfd\xc9\x30\xbf\xff\x5b\x43\xc6\xff\xf8\x6f" "\xdb\x47\x96\x0d\x07\x00\x46\xa7\xbd\xb5\xbd\xba\xd0\x68\xd4\x37\x24\xc6" "\x34\xf1\xe3\x38\x17\xd5\x18\x2e\x91\xff\x97\x3d\x07\xd5\xe8\x9b\xf8\xd6" "\x59\xc5\x9a\x88\xfe\x45\xbf\x78\xa5\x7b\x4d\x1f\x2a\xca\xb2\xcf\x14\x6b" "\x50\x8f\xf1\x34\x66\xdd\x80\xf3\xe0\xe0\xa2\x8f\x88\xff\x8d\xba\x32\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x5f\x67\xf1\x17\x4b\xa3\x6e" "\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x17\xd7\xa7\x01\x00\x00\xff\xff\xf8\x4d\xd3" "\x43", 1315); syz_mount_image( /*fs=*/0x200000000180, /*dir=*/0x200000000000, /*flags=MS_POSIXACL|MS_SYNCHRONOUS|MS_RELATIME|MS_NOSUID|0x80c*/ 0x21081e, /*opts=*/0x200000000080, /*chdir=*/1, /*size=*/0x523, /*img=*/0x200000000c00); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: open_flags = 0x181642 (4 bytes) // mode: open_mode = 0x148 (2 bytes) // ] // returns fd memcpy((void*)0x200000000180, "./file1\000", 8); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000180ul, /*flags=O_TRUNC|O_SYNC|O_CREAT|O_CLOEXEC|O_APPEND|0x2*/ 0x181642, /*mode=S_IXGRP|S_IXUSR|S_IRUSR*/ 0x148); if (res != -1) r[0] = res; // openat$fuse arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 66 75 73 65 00} (length 0xa) // } // flags: const = 0x2 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_fuse memcpy((void*)0x200000002000, "/dev/fuse\000", 10); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000002000ul, /*flags=*/2, /*mode=*/0); if (res != -1) r[1] = res; // ioctl$EXT4_IOC_MOVE_EXT arguments: [ // fd: fd (resource) // cmd: const = 0xc028660f (4 bytes) // arg: ptr[in, move_extent] { // move_extent { // reserved: const = 0xc (4 bytes) // donor_fd: fd (resource) // orig_start: int64 = 0x0 (8 bytes) // donor_start: int64 = 0x8000000000000000 (8 bytes) // len: int64 = 0x2 (8 bytes) // moved_len: int64 = 0xfffefffffdffffff (8 bytes) // } // } // ] *(uint32_t*)0x200000000040 = 0xc; *(uint32_t*)0x200000000044 = r[1]; *(uint64_t*)0x200000000048 = 0; *(uint64_t*)0x200000000050 = 0x8000000000000000; *(uint64_t*)0x200000000058 = 2; *(uint64_t*)0x200000000060 = 0xfffefffffdffffff; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0xc028660f, /*arg=*/0x200000000040ul); return 0; }