// https://syzkaller.appspot.com/bug?id=c2fe1403d829cf5c2110804d8e90123502249963 // 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 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, loopfd = -1, 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) { memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; 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"); } 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) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } errno = err; return res; } uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); intptr_t res = 0; memcpy((void*)0x20000040, "ext4\000", 5); memcpy((void*)0x20000080, "./file1\000", 8); memcpy( (void*)0x20000740, "\x78\x9c\xec\xdd\xdf\x6b\x1c\x5b\x1d\x00\xf0\xef\x4c\xb2\x35\x69\x53\x93" "\xaa\x0f\xb5\x60\x5b\x6c\x25\x2d\xda\x4d\xd2\xd8\x36\xf8\x50\x2b\x88\x7d" "\x2a\xa8\xf5\xbd\xc6\x64\x13\x42\x36\xd9\x90\xdd\xb4\x4d\x28\x92\xe2\x1f" "\x20\x88\xa8\xe0\x53\x9f\x7c\xf1\x3f\x10\xa4\x0f\xfe\x01\x22\x08\xfa\x2e" "\xfe\x44\xb4\xbd\xf7\xe1\x3e\xdc\x7b\xf7\xb2\xbb\xb3\xbd\x69\xba\x9b\x0d" "\xf7\x6e\x32\x25\xf9\x7c\x60\x3a\xe7\x9c\x99\xcd\xf7\x7b\xb6\xec\xec\xcc" "\x9c\xc3\x4e\x00\xc7\xd6\xc5\x88\xb8\x13\x11\x03\x11\x71\x35\x22\x46\xb3" "\xf6\x34\x5b\xee\x36\x2a\xdb\xad\xfd\x5e\xbe\x78\x32\xd7\x58\x92\xa8\xd7" "\xef\xff\x2f\x89\x24\x6b\x6b\xff\xad\x24\x5b\x9f\x6a\xbd\x24\x86\x22\xe2" "\xfb\x77\x23\x7e\x94\xbc\x19\xb7\xba\xb9\xb5\x3c\x5b\x2e\x97\xd6\xb3\xfa" "\x44\x6d\x65\x6d\xa2\xba\xb9\x75\x6d\x69\x65\x76\xb1\xb4\x58\x5a\x9d\x9e" "\x9e\xba\x39\x73\x6b\xe6\xc6\xcc\x64\x5f\xfa\x39\x16\x11\xb7\xbf\xfd\xcf" "\x5f\xfc\xf4\x37\xdf\xb9\xfd\xfb\xaf\x3d\xfa\xdb\x83\xff\x5c\xf9\x71\x23" "\xad\x91\x6c\xfb\xce\x7e\xf4\x53\xab\xeb\x85\xe6\x7b\xd1\x36\x18\x11\xeb" "\x07\x11\x2c\x07\x03\xd9\xba\xd0\x73\xcf\x3f\x1c\x78\x2e\x00\x00\xf4\xd6" "\x38\xc7\xff\x5c\x44\x7c\xb9\x79\xfe\x3f\x1a\x03\xcd\xb3\x53\x00\x00\x00" "\xe0\x28\xa9\x7f\x73\x24\xde\x4f\x22\xea\x00\x00\x00\xc0\x91\x95\x36\xe7" "\xc0\x26\x69\x31\x9b\x0b\x30\x12\x69\x5a\x2c\xb6\xe6\xf0\x7e\x21\x4e\xa6" "\xe5\x4a\xb5\xf6\xd5\x85\xca\xc6\xea\x7c\x6b\xae\xec\x58\x14\xd2\x85\xa5" "\x72\x69\x32\x9b\x2b\x3c\x16\x85\xa4\x51\x9f\xca\xe6\xd8\xb6\xeb\xd7\x77" "\xd5\xa7\x23\xe2\x4c\x44\xfc\x7c\x74\xb8\x59\x2f\xce\x55\xca\xf3\x79\xdf" "\xfc\x00\x00\x00\x80\x63\xe2\xd4\xae\xeb\xff\x77\x47\x5b\xd7\xff\x00\x00" "\x00\xc0\x11\x33\x96\x77\x02\x00\x00\x00\xc0\x81\x7b\xed\xfa\xff\x59\x7e" "\x79\x00\x00\x00\x00\x07\xc7\xf8\x3f\x00\x00\x00\x1c\x69\xdf\xbd\x77\xaf" "\xb1\xd4\xdb\xcf\xbf\x9e\x7f\xb8\xb9\xb1\x5c\x79\x78\x6d\xbe\x54\x5d\x2e" "\xae\x6c\xcc\x15\xe7\x2a\xeb\x6b\xc5\xc5\x4a\x65\xb1\xf9\x9b\x7d\x2b\xbd" "\xfe\x5e\xb9\x52\x59\xfb\x7a\xac\x6e\x3c\x9e\xa8\x95\xaa\xb5\x89\xea\xe6" "\xd6\x83\x95\xca\xc6\x6a\xed\xc1\xd2\x6b\x8f\xc0\x06\x00\x00\x00\x0e\xd1" "\x99\x0b\xcf\xff\x9a\x44\xc4\xf6\x37\x86\x9b\x4b\xc3\x89\xbc\x93\x02\x0e" "\x45\xd2\x6b\x87\x9d\x77\xed\xfe\x71\xb0\xb9\x00\x87\x6b\x20\xef\x04\x80" "\xdc\x0c\xe6\x9d\x00\x90\x9b\x42\xde\x09\x00\xb9\xeb\x75\x1f\xa0\xeb\xe4" "\x9d\x3f\xf6\x3f\x17\x00\x00\xe0\x60\x8c\x7f\xf1\xd5\xf8\xff\x70\xbb\xad" "\x3d\xfe\xdf\xfb\xde\x40\xcf\xd1\x43\xe0\x2d\x96\xe6\x9d\x00\x00\x70\xe8" "\x8c\xff\xc3\xf1\x55\x30\x03\x10\x8e\xbd\xcf\xee\x6e\x48\x22\xb6\x77\x54" "\x3f\xfd\xf8\x7f\xbd\xfe\x49\xf2\x02\x00\x00\xfa\x67\xa4\xb9\x24\x69\x31" "\x1b\x0b\x1c\x89\x34\x2d\x16\x23\x4e\x37\x1f\x0b\x50\x48\x16\x96\xca\xa5" "\xc9\xec\xfa\xe0\x2f\xa3\x85\xcf\x34\xea\x53\xcd\x57\x26\x46\xff\x01\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60" "\x9f\xea\xf5\x24\xea\x00\x00\x00\xc0\x91\x16\x91\xfe\x3b\xc9\x9e\xe4\x3f" "\x3e\x7a\x79\x64\xf7\xfd\x81\x13\xc9\x7b\xa3\xcd\x75\x44\x3c\xfa\xf5\xfd" "\x5f\x3e\x9e\xad\xd5\xd6\xa7\x1a\xed\xff\x7f\xd5\x5e\xfb\x55\xd6\x7e\xdd" "\xf3\xc4\x01\x00\x00\xe0\x6d\xd0\xbe\x4e\x6f\x5f\xc7\x03\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\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\x3f\xbd\x7c" "\xf1\x64\xae\xbd\xbc\xb1\xf1\xc4\xc1\xc5\xfd\xef\xb7\x22\x62\xac\x53\xfc" "\xc1\x18\x6a\xae\x87\xa2\x10\x11\x27\xdf\x49\x62\x70\xc7\xeb\x92\x88\x18" "\xe8\x43\xfc\xed\xa7\x11\x71\xb6\x53\xfc\xa4\x91\x56\x8c\x65\x59\x74\x8a" "\x3f\x9c\x63\xfc\x34\x22\x4e\xf5\x21\x3e\x1c\x67\xcf\x1b\xc7\x9f\x3b\x9d" "\x3e\x7f\x69\x5c\x6c\xae\x3b\x7f\xfe\x1a\xe5\x7f\xf5\x21\x7e\xf7\xe3\x5f" "\xfa\xea\xf8\x37\xd0\xe5\xf8\x73\x7a\x9f\x31\xce\x6d\xef\x11\xff\x69\xc4" "\xb9\xc1\xce\xc7\x9f\x76\xfc\xa4\x4b\xfc\x4b\xfb\x8c\xff\xc3\x1f\x6c\x6d" "\x75\xdb\x56\x7f\x16\x31\xde\xf1\xfb\x27\x79\x2d\xd6\x44\x6d\x65\x6d\xa2" "\xba\xb9\x75\x6d\x69\x65\x76\xb1\xb4\x58\x5a\x9d\x9e\x9e\xba\x39\x73\x6b" "\xe6\xc6\xcc\xe4\xc4\xc2\x52\xb9\x94\xfd\xdb\x31\xc6\xcf\xbe\xf4\xbb\x0f" "\xf7\xea\xff\xc9\x2e\xf1\xc7\x5a\xfd\xbf\xd0\xad\xff\x97\xf7\xd9\xff\x0f" "\xfe\xfc\xf8\xc5\xe7\x5b\xc5\x42\xa7\xf8\x57\x2e\x75\xfe\xfe\x3d\xdb\x8a" "\xff\xc6\xfb\x9f\x66\xdf\x7d\x5f\xc9\xca\x8d\xed\xe3\xed\xf2\x76\xab\xbc" "\xd3\xf9\xdf\xfe\xe9\xfc\x5e\xfd\x9f\xef\xd2\xff\x5e\xff\xff\x57\xf6\xd9" "\xff\xab\xdf\xfb\xc9\xdf\xf7\xb9\x2b\x00\x70\x08\xaa\x9b\x5b\xcb\xb3\xe5" "\x72\x69\x5d\xa1\x73\xa1\x5e\xf7\x46\x29\x1c\xc9\x42\x0c\xed\xb5\x4f\xde" "\x47\x26\x00\x00\xa0\xdf\x3e\x3e\xe9\xcf\x3b\x13\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\xbe\x0e\xe3\x97\xc6\x76\xc7\xdc" "\xe3\xe7\xa8\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x72\xf3\x51\x00\x00\x00\xff\xff\x2b\xe2" "\xd3\xc7", 1244); res = -1; res = syz_mount_image(/*fs=*/0x20000040, /*dir=*/0x20000080, /*flags=*/0x4500, /*opts=*/0x200000c0, /*chdir=*/0xe, /*size=*/0x4dc, /*img=*/0x20000740); if (res != -1) r[0] = res; memcpy((void*)0x20000080, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x20000080ul, /*flags=*/0xa2643ul, /*mode=*/0ul); if (res != -1) r[1] = res; memcpy((void*)0x20001280, "/dev/loop", 9); *(uint8_t*)0x20001289 = 0x30; *(uint8_t*)0x2000128a = 0; memcpy((void*)0x20001240, "./bus\000", 6); syscall(__NR_mount, /*src=*/0x20001280ul, /*dst=*/0x20001240ul, /*type=*/0ul, /*flags=*/0x1000ul, /*data=*/0ul); memcpy((void*)0x20000400, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x20000400ul, /*flags=*/0x14103eul, /*mode=*/0ul); if (res != -1) r[2] = res; syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x600000ul, /*prot=*/0x3000002ul, /*flags=*/0x11ul, /*fd=*/r[2], /*offset=*/0ul); memcpy((void*)0x20000000, "ext4\000", 5); memcpy((void*)0x20000140, "./mnt\000", 6); memcpy( (void*)0x200000c0, "noinit_itable,data_err=abort,delalloc,lazytime,noauto_da_alloc,resuid=", 70); *(uint16_t*)0x20000106 = r[1]; *(uint32_t*)0x20000108 = r[0]; memcpy( (void*)0x20000280, "\x78\x9c\xec\xdd\x3f\x68\x24\x55\x1c\x07\xf0\xef\xcc\xee\x7a\xe6\x6e\xd1" "\x53\x1b\x41\xfc\x03\x22\xa2\x81\x70\x76\x82\xcd\xd9\x28\x1c\xc8\x71\x8a" "\x08\x2a\x9c\x88\xd8\x28\x77\x42\x4c\xd0\x2a\xb1\xb2\xb1\xd0\x5a\x25\x95" "\x4d\x10\x3b\xa3\xa5\xa4\x09\x36\x8a\x60\x15\x35\x45\x6c\x84\x18\x2c\x0c" "\x16\x5a\xac\xcc\x4e\x22\x31\xd9\x60\x74\xb3\xbb\x92\xf9\x7c\x60\x76\x66" "\x76\xdf\x9b\xdf\x1b\x66\xbe\x6f\xb7\x19\x36\x40\x63\x9d\x4f\x72\x31\x49" "\x2b\xc9\x74\x92\x4e\x92\x62\x7f\x83\x7b\xea\xe5\xfc\xee\xee\xd2\xd4\xda" "\xd5\xa4\xd7\x7b\xea\x97\xa2\xdf\xae\xde\xaf\xed\xf5\x3b\x97\x64\x31\xc9" "\xc3\x49\x56\xcb\x22\xaf\xb4\x93\xf9\x95\xe7\x36\x7f\x5b\x7f\xfc\xfe\x77" "\xe6\x3a\xf7\x7d\xb4\xf2\xec\xd4\x58\x4f\x72\xd7\xf6\xe6\xc6\x13\x3b\x1f" "\x5e\x7e\xfb\xd3\x4b\x0f\xcd\x7f\xfd\xed\xd6\xe5\x22\x17\xd3\xfd\xdb\x79" "\x9d\xbc\x62\xc0\x7b\xed\x22\xb9\x75\x14\xc5\xfe\x27\x8a\xf6\xa4\x47\xc0" "\x71\x5c\x79\xe3\x93\xef\xaa\xdc\xdf\x96\xe4\xde\x7e\xfe\x3b\x29\x53\x5f" "\xbc\x77\x67\x6f\x58\xed\xe4\xc1\x0f\x8e\xea\xfb\xde\xcf\xdf\xdc\x31\xce" "\xb1\x02\x27\xaf\xd7\xeb\x54\xdf\x81\x8b\x3d\xa0\x71\xca\x24\xdd\x14\xe5" "\x4c\x92\x7a\xbb\x2c\x67\x66\xea\xdf\xf0\xdf\xb7\xce\x96\xaf\x5e\x9f\x7d" "\x7d\xfa\xe5\xeb\x73\xd7\x5e\x9a\xf4\x4c\x05\x9c\x94\x6e\xb2\xf1\xd8\xe7" "\x67\x3e\x3b\x77\x20\xff\x3f\xb5\xea\xfc\x03\xa7\x57\x95\xff\xa7\xaf\x2c" "\xff\x50\x6d\xef\xb4\x06\xb5\x78\x72\x6b\xec\x83\x02\x46\xeb\xce\x7a\x55" "\xe5\x7f\xfa\x85\x85\x07\x72\x64\xfe\x81\xd3\x4a\xfe\xa1\xb9\xe4\x1f\x9a" "\x4b\xfe\xa1\xb9\xe4\x1f\x9a\x4b\xfe\xa1\xb9\xe4\x1f\x9a\x4b\xfe\xa1\xb9" "\xe4\x1f\x9a\x4b\xfe\xa1\xb9\xf6\xe7\x1f\x00\x68\x96\xde\x99\x49\x3f\x81" "\x0c\x4c\xca\xa4\xe7\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xe0\xb0\xa5\xa9\xb5\xab\x7b\xcb\xb8\x6a\x7e\xf9\x7e\xb2\xfd\x68" "\x92\xf6\xa0\xfa\xad\xfe\xff\x11\x27\x37\xf6\x5f\xcf\xfe\x5a\x54\xcd\xfe" "\x52\xd4\xdd\x86\xf2\xfc\xdd\x43\x1e\x60\x48\x1f\x8f\xe6\xe9\xeb\x37\x6f" "\x3e\x66\xc3\x9b\x7e\x1c\x49\xfd\x63\xfb\xea\xae\xc9\xd6\x5f\xb8\x96\x2c" "\xbe\x95\xe4\x42\xbb\x7d\xf8\xfe\x2b\x76\xef\xbf\xff\xee\x96\x7f\xf8\xbc" "\xf3\xe2\x90\x05\xfe\xa5\xe2\xc0\xfe\x23\xcf\x8c\xb7\xfe\x41\x7f\x2c\x4f" "\xb6\xfe\xa5\xf5\xe4\x8b\x6a\xfe\xb9\x30\x68\xfe\x29\x73\x7b\x7f\x3d\x78" "\xfe\xe9\x56\xd7\x6f\xc8\xfa\xaf\xfd\x3e\xe4\x01\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x18\x9b\x3f\x03\x00\x00\xff\xff\xf4\x61\x6f\x0c", 591); syz_mount_image(/*fs=*/0x20000000, /*dir=*/0x20000140, /*flags=*/0x10, /*opts=*/0x200000c0, /*chdir=*/-1, /*size=*/0x24f, /*img=*/0x20000280); *(uint64_t*)0x200001c0 = 0; *(uint64_t*)0x200001c8 = 0x80000000; *(uint64_t*)0x200001d0 = 0; syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0xc0185879, /*arg=*/0x200001c0ul); return 0; }