// https://syzkaller.appspot.com/bug?id=28c4a71ecc4b55c2bbc7d921f0972df1a1a701b9 // 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, 0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x3ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x400000000000ul, /*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=*/0x400001000000ul, /*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*)0x400000000180, "net_prio.prioidx\000", 17); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x400000000180ul, /*flags=*/0x275a, /*mode=*/0); if (res != -1) r[0] = res; memcpy((void*)0x400000000000, "#! ", 3); *(uint8_t*)0x400000000003 = 0xa; syscall(__NR_write, /*fd=*/r[0], /*data=*/0x400000000000ul, /*len=*/0x208e24bul); syscall(__NR_mmap, /*addr=*/0x400000000000ul, /*len=*/0xb36000ul, /*prot=PROT_WRITE*/ 2ul, /*flags=MAP_STACK|MAP_POPULATE|MAP_FIXED|MAP_SHARED*/ 0x28011ul, /*fd=*/r[0], /*offset=*/0ul); *(uint64_t*)0x4000000015c0 = 0x400000000080; *(uint64_t*)0x4000000015c8 = 0xffffffff000; syscall(__NR_preadv, /*fd=*/r[0], /*vec=*/0x4000000015c0ul, /*vlen=*/5ul, /*off_low=*/0, /*off_high=*/0); memcpy((void*)0x400000000080, "ext4\000", 5); memcpy((void*)0x400000000240, "./file1\000", 8); memcpy((void*)0x400000000840, "discard", 7); *(uint8_t*)0x400000000847 = 0x2c; memcpy((void*)0x400000000848, "nodiscard", 9); *(uint8_t*)0x400000000851 = 0x2c; memcpy((void*)0x400000000852, "noquota", 7); *(uint8_t*)0x400000000859 = 0x2c; memcpy((void*)0x40000000085a, "noinit_itable", 13); *(uint8_t*)0x400000000867 = 0x2c; memcpy((void*)0x400000000868, "stripe", 6); *(uint8_t*)0x40000000086e = 0x3d; sprintf((char*)0x40000000086f, "0x%016llx", (long long)0x79); *(uint8_t*)0x400000000881 = 0x2c; memcpy((void*)0x400000000882, "resgid", 6); *(uint8_t*)0x400000000888 = 0x3d; sprintf((char*)0x400000000889, "0x%016llx", (long long)0); *(uint8_t*)0x40000000089b = 0x2c; memcpy((void*)0x40000000089c, "sysvgroups", 10); *(uint8_t*)0x4000000008a6 = 0x2c; memcpy((void*)0x4000000008a7, "delalloc", 8); *(uint8_t*)0x4000000008af = 0x2c; memcpy((void*)0x4000000008b0, "delalloc", 8); *(uint8_t*)0x4000000008b8 = 0x2c; *(uint8_t*)0x4000000008b9 = 0; memcpy( (void*)0x4000000002c0, "\x78\x9c\xec\xdd\xcf\x6b\x1c\x6f\x19\x00\xf0\x67\x26\xd9\x6f\x7f\xe5\x6b" "\x52\xf5\x50\x0b\xb6\xc5\x56\xd2\xa2\xdd\x4d\x1a\xdb\x06\x0f\xb5\x82\xd8" "\x53\xc1\x5a\xef\x35\x26\x9b\x10\xb2\xc9\x86\xec\xa6\x6d\x42\x91\x14\xef" "\x0a\x22\x2a\x78\xf2\xe4\x45\xf0\x0f\x10\xa4\x7f\x82\x08\x05\xbd\x4b\x15" "\x45\xb4\xd5\x83\x07\x75\x65\x67\x67\x6b\x1b\x77\x9b\x48\xb7\x3b\x35\xf9" "\x7c\x60\x3a\xef\x3b\xef\xee\x3e\xcf\xdb\xb0\x33\xf3\xce\xbc\xec\x04\x70" "\x68\x9d\x8b\x88\x9b\x11\x31\x12\x11\x97\x22\x62\x3c\xdf\x9e\xe6\xcb\xad" "\x76\xfb\x9d\xce\xeb\x5e\x3c\x7f\x34\xdf\x5e\x92\x68\xb5\xee\xfe\x39\x89" "\x24\xdf\xd6\xfd\xac\x24\x5f\x9f\x88\x88\x9d\x88\x38\x1a\x11\x5f\xbd\x15" "\xf1\x8d\xe4\xbf\xe3\x36\xb6\xb6\x57\xe6\x6a\xb5\xea\x46\x5e\xaf\x34\x57" "\xd7\x2b\x8d\xad\xed\xcb\xcb\xab\x73\x4b\xd5\xa5\xea\xda\xcc\xcc\xf4\xb5" "\xd9\xeb\xb3\x57\x67\xa7\x06\xd2\xcf\x89\x88\xb8\xf1\xa5\xdf\x7f\xff\x3b" "\x3f\xf9\xf2\x8d\x5f\x7c\xf6\xc1\x6f\xef\xfd\xf1\xe2\x37\xdb\x69\x8d\xe5" "\xed\xaf\xf6\x63\x90\x3a\x5d\x2f\x65\xff\x17\x5d\xa3\x11\xb1\xf1\x2e\x82" "\x15\x60\x24\x5f\x97\xfa\xb4\x7f\x7b\x64\x88\xc9\x00\x00\xb0\xa7\xf6\x39" "\xfe\x47\x23\xe2\x53\xd9\xf9\xff\x78\x8c\x64\x67\xa7\x00\x00\x00\xc0\x41" "\xd2\xfa\xc2\x58\xfc\x23\x89\x68\x01\x00\x00\x00\x07\x56\x9a\xcd\x81\x4d" "\xd2\x72\x3e\x17\x60\x2c\xd2\xb4\x5c\xee\xcc\xe1\xfd\x78\x1c\x4f\x6b\xf5" "\x46\xf3\x33\x8b\xf5\xcd\xb5\x85\xce\x5c\xd9\x89\x28\xa5\x8b\xcb\xb5\xea" "\x54\x3e\x57\x78\x22\x4a\x49\xbb\x3e\x9d\xcf\xb1\xed\xd6\xaf\xec\xaa\xcf" "\x44\xc4\xc9\x88\xf8\xde\xf8\xb1\xac\x5e\x9e\xaf\xd7\x16\x8a\xbe\xf8\x01" "\x00\x00\x00\x87\xc4\x89\x5d\xe3\xff\xbf\x8d\x67\xe3\xff\x23\x45\xe7\x05" "\x00\x00\x00\x0c\xd8\x44\xd1\x09\x00\x00\x00\x00\xef\x9c\xf1\x3f\x00\x00" "\x00\x1c\x7c\xc6\xff\x00\x00\x00\x70\xa0\x7d\xe5\xf6\xed\xf6\xd2\xea\x3e" "\xff\x7a\xe1\xfe\xd6\xe6\x4a\xfd\xfe\xe5\x85\x6a\x63\xa5\xbc\xba\x39\x5f" "\x9e\xaf\x6f\xac\x97\x97\xea\xf5\xa5\xec\x37\xfb\x56\xf7\xfa\xbc\x5a\xbd" "\xbe\xfe\xb9\x58\xdb\x7c\x58\x69\x56\x1b\xcd\x4a\x63\x6b\xfb\xde\x6a\x7d" "\x73\xad\x79\x6f\xf9\xb5\x47\x60\x03\x00\x00\x00\x43\x74\xf2\xec\x93\xdf" "\x24\x11\xb1\xf3\xf9\x63\xd9\xd2\xf6\x41\xd1\x49\x01\x43\x91\xec\xd1\x9e" "\x3d\x24\xe4\x59\x5e\xf9\xdd\x10\x12\x02\x86\x66\xa4\xe8\x04\x80\xc2\x8c" "\x16\x9d\x00\x50\x98\x52\xd1\x09\x00\x85\xdb\xeb\x3a\x40\xdf\xc9\x3b\xbf" "\x1c\x7c\x2e\x00\x00\xc0\xbb\x31\xf9\x89\xfe\xf7\xff\x5d\x1b\x80\x83\x2d" "\x2d\x3a\x01\x00\x60\xe8\xdc\xff\x87\xc3\xab\xf4\xfa\x0c\xc0\xab\xc5\x65" "\x02\x14\xe5\x23\x7b\xb4\xbf\xfd\xfd\xff\x56\xeb\x7f\x4a\x08\x00\x00\x18" "\xb8\xb1\x6c\x49\xd2\x72\x7e\x2f\x70\x2c\xd2\xb4\x5c\x8e\xf8\x30\x7b\x2c" "\x40\x29\x59\x5c\xae\x55\xa7\xf2\xf1\xc1\xaf\xc7\x4b\x47\xda\xf5\xe9\xec" "\x9d\xc9\x9e\x73\x86\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x80\x8e\x56\x2b\x89\x16\x00\x00\x00\x70\xa0\x45" "\xa4\x7f\x48\xb2\x5f\xf3\x8f\x98\x1c\xbf\x30\xb6\xfb\xfa\xc0\x07\xc9\xdf" "\xc7\xb3\x75\x44\x3c\xf8\xd1\xdd\x1f\x3c\x9c\x6b\x36\x37\xa6\xdb\xdb\xff" "\xf2\x72\x7b\xf3\x87\xf9\xf6\x2b\x45\x5c\xc1\x00\x00\x00\x00\x76\xeb\x8e" "\xd3\xbb\xe3\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\x18\xa4\x17\xcf\x1f\xcd\x77\x97\x61\xc6\xfd\xd3\x17" "\x23\x62\xa2\x67\xfc\xb3\x47\xb3\xd5\xd1\x28\x45\xc4\xf1\xbf\x26\x31\xfa" "\xca\xfb\x92\x88\x18\x19\x40\xfc\x9d\xc7\x11\x71\xaa\x57\xfc\xa4\x9d\x56" "\x4c\x44\x27\x8b\x5e\xf1\x8f\x15\x18\x3f\x8d\x88\x13\x03\x88\x0f\x87\xd9" "\x93\xf6\xfe\xe7\x66\xaf\xef\x5f\x1a\xe7\xb2\x75\xef\xef\xdf\x68\xbe\xbc" "\xad\xfe\xfb\xbf\x34\xba\xfb\xbf\x91\x3e\xfb\x9f\x0f\xf7\x19\xe3\xf4\xd3" "\x9f\x55\xfa\xc6\x7f\x1c\x71\x7a\xb4\xf7\xfe\xa7\x1b\x3f\xe9\x13\xff\xfc" "\x3e\xe3\x7f\xfd\x6b\xdb\xdb\xfd\xda\x5a\x3f\x8e\x98\xec\x79\xfc\x49\x5e" "\x8b\x55\x69\xae\xae\x57\x1a\x5b\xdb\x97\x97\x57\xe7\x96\xaa\x4b\xd5\xb5" "\x99\x99\xe9\x6b\xb3\xd7\x67\xaf\xce\x4e\x55\x16\x97\x6b\xd5\xfc\xdf\x9e" "\x31\xbe\xfb\xc9\x9f\xff\xeb\x4d\xfd\x3f\xde\x27\xfe\xc4\x1e\xfd\xbf\xb0" "\xcf\xfe\xff\xf3\xe9\xc3\xe7\x1f\xeb\x14\x4b\xbd\xe2\x5f\x3c\xdf\xfb\xf8" "\x7b\xaa\x4f\xfc\x34\x3f\xf6\x7d\x3a\x2f\xb7\xdb\x27\xbb\xe5\x9d\x4e\xf9" "\x55\x67\x7e\xfa\xab\x33\x6f\xea\xff\x42\x9f\xfe\xbf\xfc\xfb\xf7\x38\xd0" "\xb6\x63\x5e\xdc\x67\xff\x2f\xdd\xf9\xd6\xb3\x7d\xbe\x14\x00\x18\x82\xc6" "\xd6\xf6\xca\x5c\xad\x56\xdd\xf8\x7f\x2c\xa4\xf1\x5e\xa4\xa1\x30\x90\xc2" "\x91\xf7\x23\x0d\x85\x4e\xa1\xe8\x3d\x13\x00\x00\x30\x68\xff\x39\xe9\x2f" "\x3a\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38" "\xbc\x86\xf1\x73\x62\xbb\x63\xee\x14\xd3\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\x00\x00\x00\x00\x00\x00\x00\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\x37\xfa" "\x77\x00\x00\x00\xff\xff\xb1\xfe\xd9\x7a", 1234); syz_mount_image(/*fs=*/0x400000000080, /*dir=*/0x400000000240, /*flags=MS_LAZYTIME|MS_MANDLOCK*/ 0x2000040, /*opts=*/0x400000000840, /*chdir=*/0x10, /*size=*/0x4d2, /*img=*/0x4000000002c0); memcpy((void*)0x400000000040, "./bus\000", 6); res = syscall(__NR_creat, /*file=*/0x400000000040ul, /*mode=*/0ul); if (res != -1) r[1] = res; memcpy((void*)0x400000000180, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x400000000180ul, /*flags=O_TRUNC|O_SYNC|O_NOATIME|O_LARGEFILE|O_CREAT|O_RDWR|0x3c*/ 0x14927eul, /*mode=*/0ul); if (res != -1) r[2] = res; syscall(__NR_fallocate, /*fd=*/r[2], /*mode=*/0ul, /*off=*/0ul, /*len=*/0x1000f4ul); memcpy((void*)0x400000000380, "/dev/loop", 9); *(uint8_t*)0x400000000389 = 0x30; *(uint8_t*)0x40000000038a = 0; memcpy((void*)0x400000000140, "./bus\000", 6); syscall(__NR_mount, /*src=*/0x400000000380ul, /*dst=*/0x400000000140ul, /*type=*/0ul, /*flags=MS_BIND*/ 0x1000ul, /*data=*/0ul); memcpy((void*)0x400000000100, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x400000000100ul, /*flags=O_SYNC|O_NOCTTY|O_NOATIME|O_RDWR|0x3c*/ 0x14113eul, /*mode=*/0ul); if (res != -1) r[3] = res; *(uint32_t*)0x400000000000 = 0x2a; *(uint8_t*)0x400000000004 = 0x29; *(uint16_t*)0x400000000005 = 1; *(uint32_t*)0x400000000007 = 3; *(uint8_t*)0x40000000000b = 0x40; *(uint32_t*)0x40000000000c = 2; *(uint64_t*)0x400000000010 = 3; *(uint64_t*)0x400000000018 = 4; *(uint8_t*)0x400000000020 = 7; *(uint16_t*)0x400000000021 = 7; memcpy((void*)0x400000000023, "./file0", 7); syscall(__NR_write, /*fd=*/r[2], /*data=*/0x400000000000ul, /*size=*/0x2aul); memcpy((void*)0x400000000080, "#! ", 3); *(uint8_t*)0x400000000083 = 0xa; syscall(__NR_write, /*fd=*/r[3], /*data=*/0x400000000080ul, /*len=*/0x208e24bul); syscall(__NR_fallocate, /*fd=*/r[1], /*mode=FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE*/ 3ul, /*off=*/0ul, /*len=*/0x1a00ul); return 0; }