// 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 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"); } 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=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); intptr_t res = 0; memcpy((void*)0x20000740, "ext4\000", 5); memcpy((void*)0x20000140, "./bus\000", 6); *(uint8_t*)0x20000200 = 0; memcpy( (void*)0x20000ec0, "\x78\x9c\xec\xdc\xcf\x6b\x1c\xe5\x1b\x00\xf0\x67\xa6\xd9\xa6\x3f\xf2\xfd" "\x6e\x04\x0f\xea\x41\x84\x16\x5a\x28\x9d\x24\xcd\xa5\x3d\x19\x2f\xde\x0a" "\x85\x82\xd7\x1a\x92\x49\x08\x99\x64\x43\x76\x53\x9b\x58\xb0\xf5\x2c\xd4" "\xe6\xa2\x20\x88\xde\x3d\x7a\x15\x4a\xfd\x03\xbc\x49\x41\xc1\xbb\x20\x5a" "\xe3\x41\xbc\xac\xcc\x66\x93\xb6\x71\x37\xdd\xb6\x49\xb7\xa4\x9f\x0f\x4c" "\xe7\x79\xdf\x99\xd9\xe7\x7d\xba\x93\x37\x3b\x90\x77\x03\x78\x69\xbd\x55" "\xfe\x93\x44\x0c\x45\xc4\xa5\x88\xa8\xb6\xfb\xd3\x88\x38\xdc\x8a\x8e\x44" "\xdc\xd8\x3c\x6f\xe3\xfe\xf5\xa9\x72\x4b\xa2\xd9\xbc\xfc\x7b\x52\x5e\x16" "\x1b\xcd\xea\xf6\x6b\x25\xed\xfd\xf1\x68\x5d\x12\xaf\x45\xc4\xdd\x4a\xc4" "\x99\x8f\xff\x9b\xb7\xbe\xba\x36\x3f\x59\x14\xf9\x72\xbb\x3d\xd2\x58\x58" "\x1a\xa9\xaf\xae\x9d\x9d\x5b\x98\x9c\xcd\x67\xf3\xc5\xb1\xf1\x0b\xa3\xe7" "\xc7\xc7\xcf\x8f\x8e\xef\x59\xad\x27\xdf\xbb\x70\xf4\xf6\x0f\xef\xae\xaf" "\xff\xf8\x6d\xe3\xd6\x9b\x03\x67\x93\x98\x68\xd5\x1d\xed\xda\xf6\x2c\xd1" "\x43\x36\xff\x4f\x2a\x31\xb1\xa3\x7f\x71\x3f\x92\xf5\x51\xd2\xef\x01\x00" "\x00\xd0\x93\xf2\x73\xfe\xa1\x88\x18\x68\x7d\x4a\xad\xc6\xa1\x56\x04\x00" "\x00\x00\x1c\x24\xcd\xc1\x26\x00\x00\x00\x70\xe0\x25\xd1\xef\x11\x00\x00" "\x00\x00\xfb\x6b\xeb\xef\x00\xb6\xd6\xf6\xee\xd7\x3a\xd8\x6e\x7e\x7b\x27" "\x22\x86\x3b\xe5\x1f\x68\xad\x21\x8e\x38\x12\x95\x88\x38\xb6\x91\x3c\xb2" "\x32\x21\xd9\xbc\x0c\x9e\xc9\x8d\x9b\x11\x71\x67\xa2\xc3\xfd\x97\xb4\xef" "\xbf\xa7\x37\xba\xa3\x6d\x8d\xf4\x8b\xe7\x4e\x39\xff\x4c\x74\x9a\x7f\xd2" "\xed\xf9\x27\x3a\xcc\x3f\x03\x5b\xdf\x9d\xf0\x8c\xba\xcf\x7f\x0f\xf2\x1f" "\xea\x32\xff\x5d\xea\x31\xc7\x77\x5f\xbe\x5e\xe9\x9a\xff\x66\xc4\x1b\x03" "\x9d\xf2\x27\xdb\xf9\x93\x2e\xf9\xdf\xef\x31\xff\xad\xf5\x4f\x6e\x77\x3b" "\xd6\xfc\x3a\xe2\x54\xc7\xdf\x3f\xc9\x23\xb9\x76\xf9\x7e\x88\x91\x99\xb9" "\x62\xd7\x1f\xad\xbb\xff\x9c\xbe\xb7\x5b\xfd\xc7\xba\xe5\x4f\x76\xaf\x7f" "\xa9\xc7\xfa\x3f\xdc\xf8\x73\xbe\xdb\x5c\x52\xe6\x3f\x7d\xa2\xe3\xfb\x3f" "\xf8\x70\xae\x9d\xf9\xcb\x7b\xe2\xd3\xf6\xb1\x34\x22\x6e\xb7\xf7\x65\x7b" "\x7d\x47\x8e\x13\x0b\x3f\x7d\xbf\x5b\xfd\xd3\x5d\xea\x7f\xdc\xfb\xff\x55" "\x8f\xf5\xff\xf2\xcd\xe0\xb5\x1e\x4f\x05\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x80\x96\x34\x22\x86\x22\x49\xb3\xed\x38\x4d\xb3\x2c\xe2\x78\x44\xbc\x1a" "\xc7\xd2\xa2\x56\x6f\x9c\x99\xa9\xad\x2c\x4e\x97\xc7\x22\x86\xa3\x92\xce" "\xcc\x15\xf9\x68\x44\x54\x37\xdb\x49\xd9\x1e\x6b\xc5\x0f\xda\xe7\x76\xb4" "\xc7\x23\xe2\x95\x9f\x8f\x6e\x26\x9d\x2b\xf2\x6c\xaa\x56\x4c\xf7\xbb\x78" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb6\x1d\x8f\x88\xa1\x48\xd2\x2c\x22" "\xd2\x88\xf8\xab\x9a\xa6\x59\xd6\xef\x51\x01\x00\x00\x00\x7b\x6e\xb8\xdf" "\x03\x00\x00\x00\x00\xf6\x9d\xe7\x7f\x00\x00\x00\x38\xf8\x9e\xf6\xf9\x3f" "\xd9\xe3\x71\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xda\xa5\x8b\x17\xcb\xad\xb9" "\x71\xff\xfa\x54\xd9\x9e\xbe\xba\xba\x32\x5f\xbb\x7a\x76\x3a\xaf\xcf\x67" "\x0b\x2b\x53\xd9\x54\x6d\x79\x29\x9b\xad\xd5\x66\x8b\x3c\x9b\xaa\x2d\x3c" "\xee\xf5\x8a\x5a\x6d\x69\xec\x42\xac\x5c\x1b\x69\xe4\xf5\xc6\x48\x7d\x75" "\xed\xca\x42\x6d\x65\xb1\x71\x65\x6e\x61\x72\x36\xbf\x92\x57\x9e\x4b\x55" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3c\xa9\xa1\xd6\x96\xa4\x59\x44\xa4" "\xad\x38\x4d\xb3\x2c\xe2\x7f\x11\x31\x1c\x95\x64\x66\xae\xc8\x47\x23\xe2" "\xff\x11\x71\xaf\x5a\x19\x2c\xdb\x63\xfd\x1e\x34\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x7b\xae\xbe\xba\x36\x3f\x59\x14\xf9\xb2\x40\x20\x78\x6e\xc1" "\x47\x11\xf1\x02\x0c\x63\x97\xa0\xdf\x33\x13\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\x50\x5f\x5d\x9b\x9f\x2c\x8a\x7c\xb9\xde\xef\x91\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\xd0\x5f\xe9\xaf\x49\x44\x94\xdb\xa9\xea\xc9\xa1\x9d" "\x47\x0f\x27\x7f\x57\x5b\xfb\x88\xf8\xe0\x8b\xcb\x9f\x5d\x9b\x6c\x34\x96" "\xc7\xca\xfe\x3f\xb6\xfb\x1b\x9f\xb7\xfb\xcf\xf5\x63\xfc\x00\x00\x00\xf0" "\x52\x78\xfb\x49\x4e\xde\x7a\x4e\xdf\x7a\x8e\x07\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xe8\x55\x7d\x75\x6d\x7e\xb2\x28\xf2\xe5" "\x7d\x0c\xfa\x5d\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\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\xf0\x74\xfe\x0d\x00\x00\xff\xff\xe8\x7e\xc5" "\x4f", 1855); syz_mount_image( /*fs=*/0x20000740, /*dir=*/0x20000140, /*flags=MS_I_VERSION|MS_REC|MS_SYNCHRONOUS|MS_NODIRATIME*/ 0x804810, /*opts=*/0x20000200, /*chdir=*/1, /*size=*/0x73f, /*img=*/0x20000ec0); memcpy((void*)0x20000080, "./file0\000", 8); syscall(__NR_chdir, /*dir=*/0x20000080ul); memcpy((void*)0x20000040, "ext4\000", 5); memcpy((void*)0x20000200, "./bus\000", 6); memcpy((void*)0x20000140, "nombcache", 9); *(uint8_t*)0x20000149 = 0x2c; memcpy((void*)0x2000014a, "abort", 5); *(uint8_t*)0x2000014f = 0x2c; memcpy((void*)0x20000150, "dioread_lock", 12); *(uint8_t*)0x2000015c = 0x2c; memcpy((void*)0x2000015d, "norecovery", 10); *(uint8_t*)0x20000167 = 0x2c; memcpy((void*)0x20000168, "discard", 7); *(uint8_t*)0x2000016f = 0x2c; memcpy((void*)0x20000170, "dioread_lock", 12); *(uint8_t*)0x2000017c = 0x2c; memcpy((void*)0x2000017d, "noload", 6); *(uint8_t*)0x20000183 = 0x2c; memcpy((void*)0x20000184, "usrquota", 8); *(uint8_t*)0x2000018c = 0x2c; memcpy((void*)0x2000018d, "commit", 6); *(uint8_t*)0x20000193 = 0x3d; sprintf((char*)0x20000194, "0x%016llx", (long long)2); *(uint8_t*)0x200001a6 = 0x2c; *(uint8_t*)0x200001a7 = 0; memcpy( (void*)0x20000400, "\x78\x9c\xec\xdd\xdf\x6b\x5b\x55\x1c\x00\xf0\xef\x4d\xdb\xfd\xea\x74\x1d" "\x8c\xa1\x3e\x48\x61\x0f\x4e\xe6\xd2\xb5\xf5\xc7\x04\x1f\xe6\xa3\xe8\x70" "\xa0\xef\x33\xb4\x77\x65\x34\x59\x46\x93\x8e\xb5\x0e\xdc\x1e\xdc\x8b\x2f" "\x32\x04\x11\x07\xe2\x1f\xe0\xbb\x8f\xc3\x7f\xc0\xbf\x62\xa0\x83\x21\xa3" "\xe8\x83\x2f\x91\x9b\xde\x74\xd9\x9a\xb4\x59\x97\xad\x99\xf9\x7c\xe0\xb6" "\xe7\xdc\x7b\xd3\x73\x4f\xce\xfd\x9e\x9e\x93\x93\x90\x00\x86\xd6\x64\xf6" "\xa3\x10\xf1\x6a\x44\x7c\x9b\x44\x1c\x6a\x3b\x36\x1a\xf9\xc1\xc9\xf5\xf3" "\xd6\x1e\x5c\x9b\xcb\xb6\x24\x1a\x8d\xcf\xfe\x4a\x22\xc9\xf7\xb5\xce\x4f" "\xf2\xdf\xe3\x79\xe6\x95\x88\xf8\xed\xeb\x88\x13\x85\xcd\xe5\xd6\x56\x56" "\x17\x4b\xe5\x72\xba\x94\xe7\xa7\xea\x95\xcb\x53\xb5\x95\xd5\x93\x17\x2b" "\xa5\x85\x74\x21\xbd\x34\x33\x3b\x7b\xfa\x9d\xd9\x99\xf7\xdf\x7b\xb7\x6f" "\x75\x7d\xf3\xdc\x3f\x3f\x7c\x7a\xe7\xa3\xd3\xdf\x1c\x5b\xfb\xfe\x97\x7b" "\x87\x6f\x25\x71\x26\x0e\xe6\xc7\xda\xeb\xf1\x14\xae\xb7\x67\x26\x63\x32" "\x7f\x4e\xc6\xe2\xcc\x63\x27\x4e\xf7\xa1\xb0\x41\x92\xec\xf6\x05\xb0\x23" "\x23\x79\x9c\x8f\x45\xd6\x07\x1c\x8a\x91\x3c\xea\x81\xff\xbf\xaf\x22\xa2" "\x01\x0c\xa9\x44\xfc\xc3\x90\x6a\x8d\x03\x5a\x73\xfb\x3e\xcd\x83\x5f\x18" "\xf7\x3f\x5c\x9f\x00\x6d\xae\xff\xe8\xfa\x6b\x23\xb1\xaf\x39\x37\x3a\xb0" "\x96\x3c\x32\x33\xca\xe6\xbb\x13\x7d\x28\x3f\x2b\xe3\xd7\x3f\x6f\xdf\xca" "\xb6\xe8\xdf\xeb\x10\x00\xdb\xba\x7e\x23\x22\x4e\x8d\x8e\x6e\xee\xff\x92" "\xbc\xff\xdb\xb9\x53\x3d\x9c\xf3\x78\x19\xfa\x3f\x78\x7e\xee\x64\xe3\x9f" "\xb7\x3a\x8d\x7f\x0a\x1b\xe3\x9f\xe8\x30\xfe\x19\xef\x10\xbb\x3b\xb1\x7d" "\xfc\x17\xee\xf5\xa1\x98\xae\xb2\xf1\xdf\x07\x1d\xc7\xbf\x1b\x8b\x56\x13" "\x23\x79\xee\xa5\xe6\x98\x6f\x2c\xb9\x70\xb1\x9c\x66\x7d\xdb\xcb\x11\x71" "\x3c\xc6\xf6\x66\xf9\xad\xd6\x73\x4e\xaf\xdd\x6d\x74\x3b\xd6\x3e\xfe\xcb" "\xb6\xac\xfc\xd6\x58\x30\xbf\x8e\x7b\xa3\x7b\x1f\x7d\xcc\x7c\xa9\x5e\x7a" "\x9a\x3a\xb7\xbb\x7f\x23\xe2\xb5\x8e\xe3\xdf\x64\xa3\xfd\x93\x0e\xed\x9f" "\x3d\x1f\xe7\x7a\x2c\xe3\x68\x7a\xfb\xf5\x6e\xc7\xb6\xaf\xff\xb3\xd5\xf8" "\x39\xe2\x8d\x8e\xed\xff\x70\x45\x2b\xd9\x7a\x7d\x72\xaa\x79\x3f\x4c\xb5" "\xee\x8a\xcd\xfe\xbe\x79\xf4\xf7\x6e\xe5\xef\x76\xfd\xb3\xf6\x3f\xb0\x75" "\xfd\x27\x92\xf6\xf5\xda\xda\x93\x97\xf1\xd3\xbe\x7f\xd3\x6e\xc7\x76\x7a" "\xff\xef\x49\x3e\x6f\xa6\xf7\xe4\xfb\xae\x96\xea\xf5\xa5\xe9\x88\x3d\xc9" "\x27\x9b\xf7\xcf\x3c\x7c\x6c\x2b\xdf\x3a\x3f\xab\xff\xf1\x63\x5b\xf7\x7f" "\x9d\xee\xff\xfd\x11\xf1\x45\x8f\xf5\xbf\x79\xe4\x66\xd7\x53\x07\xa1\xfd" "\xe7\x9f\xa8\xfd\x9f\x3c\x71\xf7\xe3\x2f\x7f\xec\x56\x7e\x6f\xed\xff\x76" "\x33\x75\x3c\xdf\xd3\x4b\xff\xd7\xeb\x05\x3e\xcd\x73\x07\x00\x00\x00\x00" "\x00\x00\x83\xa6\x10\x11\x07\x23\x29\x14\x37\xd2\x85\x42\xb1\xb8\xfe\xfe" "\x8e\x23\x71\xa0\x50\xae\xd6\xea\x27\x2e\x54\x97\x2f\xcd\x47\xf3\xb3\xb2" "\x13\x31\x56\x68\xad\x74\x8f\xb7\xbd\x1f\x62\x3a\x7f\x3f\x6c\x2b\x3f\xf3" "\x58\x7e\x36\x22\x0e\x47\xc4\x77\x23\xfb\x9b\xf9\xe2\x5c\xb5\x3c\xbf\xdb" "\x95\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01" "\x31\xde\xe5\xf3\xff\x99\x3f\x46\x76\xfb\xea\x80\x67\xce\x57\x7e\xc3\xf0" "\xda\x36\xfe\xfb\xf1\x4d\x4f\xc0\x40\xf2\xff\x1f\x86\x97\xf8\x87\xe1\x25" "\xfe\x61\x78\x89\x7f\x18\x5e\xe2\x1f\x86\x97\xf8\x87\xe1\x25\xfe\x61\x78" "\x89\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\xe8\xab\x73\x67\xcf\x66\x5b\x63\xed\xc1\xb5\xb9\x2c" "\x3f\x7f\x65\x65\x79\xb1\x7a\xe5\xe4\x7c\x5a\x5b\x2c\x56\x96\xe7\x8a\x73" "\xd5\xa5\xcb\xc5\x85\x6a\x75\xa1\x9c\x16\xe7\xaa\x95\xed\xfe\x5e\xb9\x5a" "\xbd\x3c\x3d\x13\xcb\x57\xa7\xea\x69\xad\x3e\x55\x5b\x59\x3d\x5f\xa9\x2e" "\x5f\xaa\x9f\xbf\x58\x29\x2d\xa4\xe7\xd3\xb1\xe7\x52\x2b\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\xb1\xd4\x56\x56\x17\x4b" "\xe5\x72\xba\x24\x21\xb1\xa3\xc4\xe8\x60\x5c\x86\x44\x9f\x13\xbb\xdd\x33" "\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x43\xff\x05\x00" "\x00\xff\xff\xcb\x6f\x38\xb3", 1357); syz_mount_image(/*fs=*/0x20000040, /*dir=*/0x20000200, /*flags=MS_RELATIME*/ 0x200000, /*opts=*/0x20000140, /*chdir=*/0xfe, /*size=*/0x54d, /*img=*/0x20000400); memcpy((void*)0x20000080, "cgroup.controllers\000", 19); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000080ul, /*flags=*/0x275aul, /*mode=*/0ul); if (res != -1) r[0] = res; memcpy((void*)0x20000080, "./bus\000", 6); syscall(__NR_open, /*file=*/0x20000080ul, /*flags=O_SYNC|O_NOATIME|O_CREAT|O_RDWR|0x400000000*/ 0x400141042ul, /*mode=*/0ul); memcpy((void*)0x20000380, "/dev/loop", 9); *(uint8_t*)0x20000389 = 0x30; *(uint8_t*)0x2000038a = 0; memcpy((void*)0x20000140, "./bus\000", 6); syscall(__NR_mount, /*src=*/0x20000380ul, /*dst=*/0x20000140ul, /*type=*/0ul, /*flags=MS_BIND*/ 0x1000ul, /*data=*/0ul); memcpy((void*)0x20000100, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x20000100ul, /*flags=O_SYNC|O_NOCTTY|O_NOATIME|O_RDWR|0x3c*/ 0x14113eul, /*mode=*/0ul); if (res != -1) r[1] = res; memcpy((void*)0x20000080, "#! ", 3); *(uint8_t*)0x20000083 = 0xa; syscall(__NR_write, /*fd=*/r[1], /*data=*/0x20000080ul, /*len=*/0x208e24bul); memcpy((void*)0x20001700, "\x00\x00\x00\x00\x4c\x90\x02\x00\x00\x00\x00\x00\x03", 13); syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0xc0185879, /*arg=*/0x20001700ul); return 0; }