// 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[4] = {0xffffffffffffffff, 0xffffffffffffffff, 0x0, 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); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x200000c0, "/proc/crypto\000", 13); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000c0ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[0] = res; syscall(__NR_read, /*fd=*/r[0], /*buf=*/0x20000200ul, /*len=*/0x2020ul); memcpy((void*)0x20000040, "ext4\000", 5); memcpy((void*)0x20000000, "./file0\000", 8); *(uint8_t*)0x20000840 = 0; memcpy( (void*)0x20001400, "\x78\x9c\xec\xdd\x4d\x6f\x5b\x4b\x19\x00\xe0\xd7\xce\x97\x93\x9b\x7b\x93" "\x7b\xe9\x02\x10\xd0\x52\x0a\x05\x55\x75\x12\xb7\x8d\xaa\x2e\xa0\xac\x10" "\x42\x95\x10\x5d\x82\xd4\x86\xc4\x8d\xa2\xd8\x71\x14\x3b\xa5\x09\x5d\xa4" "\xff\x01\x89\x4a\xac\x60\xc9\x0f\x60\xdd\x15\x7b\x36\x08\x76\x6c\xca\x02" "\x89\x8f\x08\xd4\x54\x62\x61\x74\x8e\x4f\x52\x37\xb5\x9b\xd0\x7c\x38\x8a" "\x9f\x47\x3a\x3a\x67\x66\x1c\xbf\x33\x75\xcf\x4c\xfd\xba\xf1\x04\xd0\xb7" "\x2e\x45\xc4\x56\x44\x0c\x47\xc4\xc3\x88\x98\xc8\xea\x73\xd9\x11\x77\x5b" "\x47\xf2\xb8\x57\xdb\x4f\xe7\x77\xb6\x9f\xce\xe7\xa2\xd9\xbc\xff\xcf\x5c" "\xda\x9e\xd4\x45\xdb\xcf\x24\x3e\xca\x9e\xb3\x10\x11\x3f\xfa\x5e\xc4\x4f" "\x73\xef\xc6\xad\x6f\x6c\x2e\xcf\x55\x2a\xe5\xb5\xac\x3c\xd5\xa8\xae\x4e" "\xd5\x37\x36\xaf\x2f\x55\xe7\x16\xcb\x8b\xe5\x95\x52\x69\x76\x66\x76\xfa" "\xf6\x8d\x5b\xa5\x63\x1b\xeb\xc5\xea\x70\x76\xf5\xe5\x97\x7f\xd8\xfa\xd6" "\xcf\x93\x6e\x8d\x67\x35\xed\xe3\x38\x4e\xad\xa1\x0f\xed\xc5\x49\x0c\x46" "\xc4\x0f\x4e\x22\x58\x0f\x0c\x64\xe3\x19\xee\x75\x47\xf8\x20\xf9\x88\xf8" "\x2c\x22\x2e\xa7\xf7\xff\x44\x0c\xa4\xaf\x26\x00\x70\x9e\x35\x9b\x13\xd1" "\x9c\x68\x2f\x03\x00\xe7\x5d\x3e\xcd\x81\xe5\xf2\xc5\x2c\x17\x30\x1e\xf9" "\x7c\xb1\xd8\xca\xe1\x5d\x88\xb1\x7c\xa5\x56\x6f\x5c\x7b\x54\x5b\x5f\x59" "\x68\xe5\xca\x26\x63\x28\xff\x68\xa9\x52\x9e\xce\x72\x85\x93\x31\x94\x4b" "\xca\x33\xe9\xf5\x9b\x72\x69\x5f\xf9\x46\x44\x7c\x1a\x11\xbf\x18\x19\x4d" "\xcb\xc5\xf9\x5a\x65\xa1\x97\xff\xf0\x01\x80\x3e\xf6\xd1\xbe\xf5\xff\x3f" "\x23\xad\xf5\x1f\x00\x38\xe7\x0a\xbd\xee\x00\x00\x70\xea\xac\xff\x00\xd0" "\x7f\xac\xff\x00\xd0\x7f\xac\xff\x00\xd0\x7f\xac\xff\x00\xd0\x7f\xac\xff" "\x00\xd0\x7f\xac\xff\x00\xd0\x57\x7e\x78\xef\x5e\x72\x34\x77\xb2\xef\xbf" "\x5e\x78\xbc\xb1\xbe\x5c\x7b\x7c\x7d\xa1\x5c\x5f\x2e\x56\xd7\xe7\x8b\xf3" "\xb5\xb5\xd5\xe2\x62\xad\xb6\x98\x7e\x67\x4f\xf5\xa0\xe7\xab\xd4\x6a\xab" "\x33\x37\x63\xfd\xc9\xe4\xb7\x57\xeb\x8d\xa9\xfa\xc6\xe6\x83\x6a\x6d\x7d" "\xa5\xf1\x20\xfd\x5e\xef\x07\xe5\xa1\x53\x19\x15\x00\xf0\x3e\x9f\x5e\x7c" "\xf1\xe7\x5c\x44\x6c\xdd\x19\x4d\x8f\x68\xdb\xcb\xc1\x5a\x0d\xe7\x5b\xbe" "\xd7\x1d\x00\x7a\x66\xa0\xd7\x1d\x00\x7a\xc6\x6e\x5f\xd0\xbf\x8e\xf0\x1e" "\x5f\x7a\x00\xce\x89\x0e\x5b\xf4\xbe\xa5\x10\x11\xa3\xfb\x2b\x9b\xcd\x66" "\xf3\xe4\xba\x04\x9c\xb0\xab\x5f\x90\xff\x87\x7e\xd5\x96\xff\xf7\xbf\x80" "\xa1\xcf\xc8\xff\x43\xff\x92\xff\x87\xfe\xd5\x6c\xe6\x0e\xbb\xe7\x7f\x1c" "\xf6\x81\x00\xc0\xd9\x26\xc7\x0f\x74\xf9\xfc\xff\xb3\xec\xfc\xdb\xec\xc3" "\x81\x9f\x2c\xec\x7f\xc4\xf3\x93\xec\x15\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\x6d" "\xbb\xfb\xff\x16\xb3\xbd\xc0\xc7\x23\x9f\x2f\x16\x23\x3e\x8e\x88\xc9\x18" "\xca\x3d\x5a\xaa\x94\xa7\x23\xe2\x93\x88\xf8\xd3\xc8\xd0\x48\x52\x9e\xe9" "\x71\x9f\x01\x80\xa3\xca\xff\x2d\x97\xed\xff\x75\x75\xe2\xca\xf8\xfe\xd6" "\xe1\xdc\xeb\x91\xf4\x1c\x11\x3f\xfb\xd5\xfd\x5f\x3e\x99\x6b\x34\xd6\xfe" "\x98\xd4\xff\x6b\xaf\xbe\xf1\x3c\xab\x2f\xf5\xa2\xff\x00\xc0\x41\x76\xd7" "\xe9\xf4\xdc\xf6\x46\xfe\xd5\xf6\xd3\xf9\xdd\xe3\x34\xfb\xf3\xf7\xef\x46" "\x44\xa1\x15\x7f\x67\x7b\x38\x76\xf6\xe2\x0f\xc6\x60\x7a\x2e\xc4\x50\x44" "\x8c\xfd\x3b\x97\x95\x5b\x72\x6d\xb9\x8b\xa3\xd8\x7a\x16\x11\x9f\xef\x34" "\xfe\x5c\x8c\xa7\x39\x90\xd6\xce\xa7\xfb\xe3\x27\xb1\x3f\x3e\xd5\xf8\xf9" "\xb7\xe2\xe7\xd3\xb6\xd6\x39\xf9\xb3\xf8\xdc\x31\xf4\x05\xfa\xcd\x8b\x64" "\xfe\xb9\xdb\xe9\xfe\xcb\xc7\xa5\xf4\xdc\xf9\xfe\x2f\xa4\x33\xd4\xd1\x65" "\xf3\x5f\xf2\x54\xf3\x3b\xe9\x1c\xf8\x26\xfe\xee\xfc\x37\xd0\x65\xfe\xbb" "\x74\xd8\x18\x37\x7f\xff\xfd\xd6\xd5\xe8\xbb\x6d\xcf\x22\xbe\x38\x18\xb1" "\x1b\x7b\xa7\x6d\xfe\xd9\x8d\x9f\xeb\x12\xff\xca\x21\xe3\xff\xe5\x4b\x5f" "\xb9\xdc\xad\xad\xf9\xeb\x88\xab\xd1\x39\x7e\x7b\xac\xa9\x46\x75\x75\xaa" "\xbe\xb1\x79\x7d\xa9\x3a\xb7\x58\x5e\x2c\xaf\x94\x4a\xb3\x33\xb3\xd3\xb7" "\x6f\xdc\x2a\x4d\xa5\x39\xea\xa9\xee\xab\xc1\x3f\xee\x5c\xfb\xa4\x5b\x5b" "\x32\xfe\xb1\x2e\xf1\x0b\x07\x8c\xff\xeb\x87\x1c\xff\x6f\xfe\xfb\xf0\xc7" "\x5f\x7d\x4f\xfc\x6f\x7e\xad\x53\xfc\x7c\x5c\x78\x4f\xfc\x64\x4d\xfc\xc6" "\x21\xe3\xcf\x8d\xfd\xae\xd0\xad\x2d\x89\xbf\xd0\x65\xfc\x07\xbd\xfe\xd7" "\x0e\x19\xff\xe5\x5f\x37\xdf\xd9\x36\x1c\x00\xe8\x9d\xfa\xc6\xe6\xf2\x5c" "\xa5\x52\x5e\x73\xe1\xe2\xec\x5f\x24\x7f\x65\xcf\x40\x37\x3a\x5e\x7c\xe7" "\xb4\x62\x0d\xc7\xff\xf5\x53\xcd\xe6\x07\xc5\xea\x36\x63\x1c\x47\xd6\x0d" "\x38\x0b\xf6\x6e\xfa\x88\x78\xdd\xeb\xce\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x1d\x9d\xc6\x6f\x2c\xf5\x7a\x8c\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x9c\x5f\xff\x0b\x00\x00\xff\xff\xfb\xed\xd2\x38", 1254); syz_mount_image( /*fs=*/0x20000040, /*dir=*/0x20000000, /*flags=MS_POSIXACL|MS_SYNCHRONOUS|MS_RELATIME|MS_NOSUID|0x80c*/ 0x21081e, /*opts=*/0x20000840, /*chdir=*/1, /*size=*/0x4e6, /*img=*/0x20001400); memcpy((void*)0x200000c0, "./bus\000", 6); syscall(__NR_creat, /*file=*/0x200000c0ul, /*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*)0x20000000, "./bus\000", 6); res = syscall(__NR_creat, /*file=*/0x20000000ul, /*mode=*/0ul); if (res != -1) r[1] = res; res = syscall(__NR_io_setup, /*n=*/0x202, /*ctx=*/0x200001c0ul); if (res != -1) r[2] = *(uint64_t*)0x200001c0; *(uint64_t*)0x20000540 = 0x200000c0; *(uint64_t*)0x200000c0 = 0x25; *(uint32_t*)0x200000c8 = 0xe7030003; *(uint32_t*)0x200000cc = 0; *(uint16_t*)0x200000d0 = 1; *(uint16_t*)0x200000d2 = 0; *(uint32_t*)0x200000d4 = r[1]; *(uint64_t*)0x200000d8 = 0x20000000; *(uint64_t*)0x200000e0 = 0x16000; *(uint64_t*)0x200000e8 = 0; *(uint64_t*)0x200000f0 = 0; *(uint32_t*)0x200000f8 = 0; *(uint32_t*)0x200000fc = -1; syscall(__NR_io_submit, /*ctx=*/r[2], /*nr=*/8ul, /*iocbpp=*/0x20000540ul); memcpy((void*)0x20000240, ".\000", 2); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000240ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[3] = res; *(uint32_t*)0x20000b40 = 0x4100; *(uint32_t*)0x20000b44 = 0; memcpy((void*)0x20000b48, "\000\000\021\021\"\"33", 8); memset((void*)0x20000b50, 0, 24); memset((void*)0x20000b6c, 0, 20); syscall(__NR_ioctl, /*fd=*/r[3], /*cmd=*/0xc0185879, /*arg=*/0x20000b40ul); return 0; }