// https://syzkaller.appspot.com/bug?id=ea5f2e12508e28487b0d667c5de1f3dc130c7b6c // 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_ioctl #define __NR_ioctl 29 #endif #ifndef __NR_memfd_create #define __NR_memfd_create 279 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_openat #define __NR_openat 56 #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[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-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=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*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$nilfs2 arguments: [ // fs: ptr[in, buffer] { // buffer: {6e 69 6c 66 73 32 00} (length 0x7) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 32 00} (length 0x8) // } // flags: mount_flags = 0x90 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0xdb0 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0xdb0) // } // ] // returns fd_dir memcpy((void*)0x20000dc0, "nilfs2\000", 7); memcpy((void*)0x20000400, "./file2\000", 8); memcpy( (void*)0x20000e00, "\x78\x9c\xec\xdd\x4b\x6f\x5c\xd5\x1d\x00\xf0\x73\xc7\x9e\x38\x2f\x1a\x87" "\x98\xc6\x4d\xd3\x24\x25\xa5\xb8\x8f\xd8\x24\x58\xa5\xbb\x1a\x29\x5d\xa0" "\x4a\xa8\x12\x9f\x00\xa5\x81\x86\x1a\xfa\x08\x5d\x80\x82\x94\xb0\xe8\xb6" "\x91\x10\x1f\xa0\x88\x7d\x17\x7d\x66\x81\x14\xb1\x4a\xc5\xa6\x55\xbf\x00" "\x62\xd5\x4d\x8a\x90\x68\x1b\x55\x82\x41\xb6\xcf\x19\x8f\xff\x99\xd1\x9d" "\x71\x6c\x8f\xc7\xf3\xfb\x49\x77\xce\xdc\xfb\x3f\xf7\x9e\x73\xe6\x71\xe7" "\xce\x7d\x9d\x04\x8c\xad\xc6\xea\xe3\xe2\xe2\x6c\x95\xd2\xdb\xb7\xde\xba" "\x78\xef\xf4\xe4\xff\x56\xa6\x9c\x6e\xe7\x38\xb3\xfa\x38\x99\xc7\x96\x52" "\x4a\xcd\xf6\x7c\x29\x4d\x87\xe5\x2d\x4d\xad\xa5\x9f\x7d\x72\xed\x52\x67" "\xfa\x79\x4e\xab\x74\x21\x55\xa9\x6a\x4f\x4f\xcf\xde\x6d\xcf\x7b\x28\xa5" "\x74\x3d\x9d\x49\xb7\xd3\x74\x7a\xee\xe3\xe3\x37\x5f\xfa\xe0\x99\xe5\xf7" "\x8e\xdd\x38\x76\xf1\x8d\xb9\x3b\xdb\xd3\x7a\x00\x00\x18\x2f\xf7\x7e\xf4" "\xee\x2f\xff\xf6\xf8\x0f\xaf\x1d\xfd\xff\xef\x4f\x2d\xa5\xa9\xf6\xf4\xb2" "\x7d\xbe\x94\xc7\x0f\xe7\xed\xfe\xa5\x6a\x6d\x3c\x27\xed\xff\x01\x55\x47" "\x5a\x75\x8c\x17\xfb\x42\xbe\xc9\x3c\x34\x42\xbe\x89\x2e\xf9\x3a\xcb\x69" "\x86\x7c\x93\x3d\xca\xdf\x17\x96\xdb\xec\x91\x6f\xaa\xa6\xfc\x89\x8e\x69" "\xdd\xda\x0d\xa3\x6c\xfd\x7f\x7c\xd5\x98\xdf\x30\xde\x68\xcc\xcf\xaf\xfd" "\x27\x5f\xf1\xe1\xc4\xbe\x6a\xfe\x95\x2b\xcb\x2f\x5c\x1d\x52\x45\x81\x2d" "\xf7\xe9\xe9\xbc\x8b\xcf\x60\x30\x8c\xdd\xd0\x3a\x32\xec\x35\x10\xc0\x9a" "\x78\xdc\xf0\x3e\xd7\xe3\x9e\x85\x07\xd3\x5e\xda\x64\x7f\xe5\xdf\x7d\xba" "\xd1\x7d\x7e\xd8\x02\x3b\xfd\xf9\x57\xfe\x68\x95\xff\xee\x0d\x6b\x1c\xb6" "\xce\x5e\xfd\x34\x95\x76\x95\xef\xd1\xe1\x3c\x1e\x8f\x23\x4c\x86\xf9\x06" "\xfd\xfe\x97\xe5\xc5\xe3\x11\xcd\x3e\xeb\xd9\xeb\x38\xc2\xa8\x1c\x5f\xe8" "\x55\xcf\x89\x1d\xae\xc7\x66\xf5\xaa\x7f\xfc\x5c\xec\x55\x5f\xcb\x69\x79" "\x1d\x4e\x85\x78\xe7\xf7\x27\xbe\xa7\xa3\xf2\x1e\x03\xdd\xdd\xb3\xff\xdf" "\x60\x18\xdb\xa1\x35\xec\x15\x10\xb0\x6b\xc5\xf3\xe6\x5a\x59\x89\xc7\xf3" "\xfa\x62\x7c\xaa\x26\xbe\xbf\x26\x7e\xa0\x26\x7e\xb0\x26\x7e\xa8\x26\x0e" "\xe3\xec\x0f\xaf\xfe\x36\xdd\xac\xd6\xff\xe7\xc7\xff\xf4\x83\xee\x0f\x2b" "\xfb\xd9\x1e\xca\xe9\x97\x06\xac\x4f\xdc\x1f\x39\x68\xf9\xf1\xbc\xdf\x41" "\x3d\x68\xf9\xf1\x7c\x62\xd8\xd5\xe6\xfe\x7b\xf2\xd3\x5f\xdf\xfe\x7b\x3c" "\xff\xff\xf3\x70\xfe\xff\xd9\xfc\x5b\x3a\x9d\x57\x10\x65\x7f\x61\xdc\xaf" "\xde\x3e\xf7\x3f\x5c\x18\xdc\xe8\x91\xef\xe1\x50\x9d\x87\xba\xe4\x5f\x7d" "\x3e\xb3\x31\x5f\x35\xb3\xbe\x9c\xd4\xb1\x9e\xb9\xaf\x1e\xb3\x1b\xe7\x3b" "\xd2\x2b\xdf\xc9\x8d\xf9\xa6\x43\xbe\x83\x79\x5b\x64\x7f\xa8\x6f\xdc\x3e" "\x39\x18\xe6\x2b\xdb\x1f\x65\xbd\x5a\x5e\xaf\xc9\xd0\xde\x66\x68\xc7\xbe" "\x50\x8f\xf2\xce\x1c\xcd\xe9\xfe\xd0\x9e\xa3\xbd\xda\x15\x76\x64\xef\x0b" "\xf9\x9a\x79\x38\x16\xda\x35\x13\xda\xf5\x48\x98\xef\xcb\xa1\x5d\xd5\xec" "\xc6\x76\xc5\xfd\xe7\xa5\x3e\xc7\xc3\xf4\x78\x9c\xa4\xe4\x0b\x6f\xdb\x7d" "\xbf\x4b\xf1\xbd\x88\xd7\x65\x3c\x9a\xd3\x37\x73\xfa\x4e\x4e\xdf\xcf\xe9" "\x47\x5d\xca\x1d\x47\xe5\xf3\xd8\xeb\xfc\xff\xf2\xf9\x9c\x4d\xcd\xea\x85" "\x2b\xcb\x97\x9f\xc8\xe3\xe5\x73\x7a\x67\xa2\x39\xb5\x32\xfd\xfc\x0e\xd7" "\x1b\x78\x70\xfd\x5e\xff\x33\x9b\x36\x5e\xff\x73\xb8\x3d\xbd\xd9\xe8\x5c" "\x2f\x1c\x59\x9f\x5e\x75\xae\x17\xa6\xc3\xf4\x0b\x3d\xa6\x3f\x99\xc7\xcb" "\xef\xd9\x4f\x27\x0e\xac\x4e\x9f\xbf\xf4\xf3\xe5\x9f\x6c\x75\xe3\x61\xcc" "\x5d\x7d\xed\xf5\x9f\x3d\xbf\xbc\x7c\xf9\x57\x9e\x78\x32\xf2\x4f\xae\xa7" "\x94\x76\x41\x35\xf6\xc4\x93\x61\xaf\x99\x80\xed\xb6\xf0\xea\xcb\xbf\x58" "\xb8\xfa\xda\xeb\xe7\xae\xbc\xfc\xfc\x8b\x97\x5f\xbc\xfc\xca\xf9\x27\xbe" "\xff\xbd\x27\x9f\x7a\x6a\x71\x61\x75\xab\x7e\xa1\x73\xdb\x1e\xd8\x5b\xd6" "\x7f\xf4\x87\x5d\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x6f\xd5\x81" "\xee\x93\x73\x9a\xaf\x07\x6c\xf4\xba\xbf\x6d\xb9\x9e\xbc\x5c\x9f\x1e\xaf" "\x8f\x67\x34\x94\xf7\xad\x7c\x1a\xca\x7d\x0c\xca\xf5\x9f\xbd\xee\xeb\x52" "\xae\xdf\x3c\xba\x03\x75\x64\xeb\xed\xc4\xe5\x44\xc3\x6e\x23\xd0\xdd\xbf" "\xdd\xff\xd7\x60\x18\xdb\xa1\xd5\x72\x17\x7f\x60\x77\x18\x76\xff\x7f\xe5" "\xbe\x87\x25\x3d\x7c\xee\x9f\x47\x57\x86\x92\xed\xee\xd3\x1b\xd7\x97\xf1" "\xfe\x85\xf0\x20\x76\x7b\xff\x73\xca\xdf\x5b\xfd\xff\xb5\xfb\xbf\xea\x7b" "\xfd\x17\x7a\xcc\x9a\xde\x5c\xb9\x7f\xbc\x77\xe0\x1f\x1d\xc5\xa6\x13\xfd" "\x96\x1f\xdb\x5f\xee\x03\x3b\x33\x58\xf9\x7f\xca\xe5\x97\xd6\x3c\x96\xfa" "\x2b\xbf\xf5\xbb\x50\x7e\xbc\x51\x69\x9f\xfe\x1c\xca\x3f\xd8\x67\xf9\xf7" "\xb5\xff\xe4\xe6\xca\xff\x4b\x2e\xbf\xbc\x6c\x73\x67\xfb\x2d\x7f\xad\xc6" "\x55\x63\x63\x3d\xe2\x7e\xe3\x72\x1f\xc0\xb8\xdf\xb8\xf8\x6b\x68\x7f\xb9" "\xb7\xdf\xc0\xed\xdf\x64\x47\x6d\xb7\x72\xf9\x30\xce\x46\xa5\x9f\xc9\x41" "\x8d\x4a\xff\x9f\xbd\x94\xe5\x96\xf5\x60\x5e\x3d\xb7\x8f\xd3\x95\xfb\x6f" "\xc7\xfe\x0e\x06\xad\x7f\xb9\xef\x77\xf9\x1d\x78\x24\x2c\xbf\xaa\xf9\x7d" "\xdb\x7c\xff\x9f\xdd\x8f\x3b\xef\x34\xfd\x7f\xae\xe9\xd5\xff\x67\xf9\xfc" "\x2d\xe8\xff\x13\xf6\x9c\x0f\x1d\xff\x33\x18\xc6\x76\x68\xb5\x5a\x43\xed" "\xfa\x64\x5c\xfb\x5d\xd9\x2d\x86\xfd\xfa\x0f\x7b\x1b\x72\xd8\xe5\x0f\xfb" "\xf5\xaf\x13\xfb\xff\x8c\xff\x97\x62\xff\x9f\x31\x1e\xfb\xff\x8c\xf1\xd8" "\xff\x67\x8c\xc7\xfe\xb5\x62\x3c\xf6\xff\x19\x5f\xcf\xd8\xff\x67\x8c\x1f" "\x0f\xcb\x8d\xfd\x83\xce\xd6\xc4\xbf\xd2\x8e\xb7\xa6\xba\xc5\x4f\xd4\xcc" "\xff\xd5\x9a\xf8\xc9\x9a\x78\xfc\xff\x16\xe3\x67\x6a\xe2\xa7\x6a\xe2\xa7" "\x6b\xe2\x0f\xd7\xc4\x1f\xad\x89\x9f\xad\x89\x7f\xa3\x26\xfe\x58\x4d\xfc" "\xf1\x9a\xf8\x5c\x4d\x7c\xaf\xfb\x7a\x4e\xc7\xb5\xfd\x30\xce\x62\xbf\x91" "\xbe\xff\x30\x3e\xca\xf1\x9f\x5e\xdf\xff\x99\x9a\x38\x30\xba\x62\xbf\xce" "\xf1\xfb\xfd\xcd\x9a\x38\x30\xba\xca\x79\x1e\xbe\xdf\x30\x86\xaa\xee\x77" "\xec\x88\xfb\xdb\xcb\x7e\xdc\x37\x73\xfa\x4e\x4e\xdf\xcf\xe9\x47\xdb\x56" "\x41\x76\xc2\xb7\x72\xfa\xed\x9c\x7e\x27\xa7\xdf\xcd\xe9\xb9\x9c\xce\xe7" "\x74\x21\xa7\xfa\x86\x1c\x6d\xbf\xf9\xd7\x89\x53\x37\xab\xf5\xf3\xfc\x8e" "\x84\x78\xbf\xe7\x93\xc6\xeb\x01\xe2\x7d\x62\xce\xf7\x59\x9f\x78\x7c\x6e" "\xd0\xf3\x59\x8f\xf7\x59\xce\x76\x95\xbf\xc9\xcb\x41\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\x46\x63\xf5\x71\x71\x71" "\xb6\x4a\xe9\xed\x5b\x6f\x5d\xfc\xcf\xcc\x0f\x7e\xbc\x32\xe5\x74\x3b\xc7" "\x99\xd5\xc7\xc9\x3c\xb6\x94\x52\x6a\xa6\x94\xaa\x3c\x3e\x19\x96\x77\x7d" "\x6a\x2d\xfd\xec\x93\x6b\x97\xba\xa5\x55\xba\xb0\xfa\x58\xc6\xd3\xb3\x77" "\xdb\xf3\x1e\x5a\x99\x3f\x9d\x49\xb7\xd3\x74\x7a\xee\xe3\xe3\x37\x5f\xfa" "\xe0\x99\xe5\xf7\x8e\xdd\x38\x76\xf1\x8d\xb9\x3b\xdb\xd3\x7a\x00\x00\x00" "\x18\x0f\x5f\x04\x00\x00\xff\xff\x53\x40\xe5\x8f", 3504); syz_mount_image(/*fs=*/0x20000dc0, /*dir=*/0x20000400, /*flags=MS_SYNCHRONOUS|MS_DIRSYNC*/ 0x90, /*opts=*/0x20000200, /*chdir=*/1, /*size=*/0xdb0, /*img=*/0x20000e00); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 00} (length 0x2) // } // flags: open_flags = 0x0 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x20000240, ".\000", 2); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000240ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[0] = res; // ioctl$NILFS_IOCTL_CLEAN_SEGMENTS arguments: [ // fd: fd (resource) // cmd: const = 0x40786e88 (4 bytes) // arg: ptr[in, nilfs_ioctl_clean_segments_args] { // nilfs_ioctl_clean_segments_args { // argv0: nilfs_argv_typed[nilfs_vdesc, in, NILFS_VDESC_SIZE] { // v_base: nil // v_nmembs: len = 0x0 (4 bytes) // v_size: const = 0x40 (2 bytes) // v_flags: int16 = 0xd (2 bytes) // v_index: int64 = 0xe2 (8 bytes) // } // argv1: nilfs_argv_typed[nilfs_period, in, NILFS_PERIOD_SIZE] { // v_base: nil // v_nmembs: len = 0x0 (4 bytes) // v_size: const = 0x10 (2 bytes) // v_flags: int16 = 0x20c (2 bytes) // v_index: int64 = 0xfffffffffffffff8 (8 bytes) // } // argv2: nilfs_argv_typed[int64, in, 8] { // v_base: nil // v_nmembs: len = 0x0 (4 bytes) // v_size: const = 0x8 (2 bytes) // v_flags: int16 = 0x1 (2 bytes) // v_index: int64 = 0x2 (8 bytes) // } // argv3: nilfs_argv_typed[nilfs_bdesc, in, NILFS_BDESC_SIZE] { // v_base: nil // v_nmembs: len = 0x0 (4 bytes) // v_size: const = 0x28 (2 bytes) // v_flags: int16 = 0x0 (2 bytes) // v_index: int64 = 0xffffffffffffff2d (8 bytes) // } // argv4: nilfs_argv_typed[int64, in, 8] { // v_base: nil // v_nmembs: len = 0x0 (4 bytes) // v_size: const = 0x8 (2 bytes) // v_flags: int16 = 0x98f (2 bytes) // v_index: int64 = 0xffff (8 bytes) // } // } // } // ] *(uint64_t*)0x20000640 = 0; *(uint32_t*)0x20000648 = 0; *(uint16_t*)0x2000064c = 0x40; *(uint16_t*)0x2000064e = 0xd; *(uint64_t*)0x20000650 = 0xe2; *(uint64_t*)0x20000658 = 0; *(uint32_t*)0x20000660 = 0; *(uint16_t*)0x20000664 = 0x10; *(uint16_t*)0x20000666 = 0x20c; *(uint64_t*)0x20000668 = 0xfffffffffffffff8; *(uint64_t*)0x20000670 = 0; *(uint32_t*)0x20000678 = 0; *(uint16_t*)0x2000067c = 8; *(uint16_t*)0x2000067e = 1; *(uint64_t*)0x20000680 = 2; *(uint64_t*)0x20000688 = 0; *(uint32_t*)0x20000690 = 0; *(uint16_t*)0x20000694 = 0x28; *(uint16_t*)0x20000696 = 0; *(uint64_t*)0x20000698 = 0xffffffffffffff2d; *(uint64_t*)0x200006a0 = 0; *(uint32_t*)0x200006a8 = 0; *(uint16_t*)0x200006ac = 8; *(uint16_t*)0x200006ae = 0x98f; *(uint64_t*)0x200006b0 = 0xffff; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x40786e88, /*arg=*/0x20000640ul); return 0; }