// https://syzkaller.appspot.com/bug?id=6247ad40f3aa036fa257dc6052f7ca87bd224ae6 // 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 #include #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; static __thread int clone_ongoing; static __thread int skip_segv; static __thread jmp_buf segv_env; static void segv_handler(int sig, siginfo_t* info, void* ctx) { if (__atomic_load_n(&clone_ongoing, __ATOMIC_RELAXED) != 0) { exit(sig); } uintptr_t addr = (uintptr_t)info->si_addr; const uintptr_t prog_start = 1 << 20; const uintptr_t prog_end = 100 << 20; int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0; int valid = addr < prog_start || addr > prog_end; if (skip && valid) { _longjmp(segv_env, 1); } exit(sig); } static void install_segv_handler(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_IGN; syscall(SYS_rt_sigaction, 0x20, &sa, NULL, 8); syscall(SYS_rt_sigaction, 0x21, &sa, NULL, 8); memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = segv_handler; sa.sa_flags = SA_NODEFER | SA_SIGINFO; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGBUS, &sa, NULL); } #define NONFAILING(...) \ ({ \ int ok = 1; \ __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \ if (_setjmp(segv_env) == 0) { \ __VA_ARGS__; \ } else \ ok = 0; \ __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \ ok; \ }) //% 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[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*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=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; install_segv_handler(); intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$ext4 arguments: [ // fs: ptr[in, buffer] { // buffer: {65 78 74 34 00} (length 0x5) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: mount_flags = 0x2004ce (8 bytes) // opts: ptr[in, fs_options[ext4_options]] { // fs_options[ext4_options] { // elems: array[fs_opt_elem[ext4_options]] { // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0x3 (1 bytes) // size: len = 0x451 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x451) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000000, "ext4\000", 5)); NONFAILING(memcpy((void*)0x200000000180, "./file1\000", 8)); NONFAILING(*(uint8_t*)0x2000000001c0 = 0); NONFAILING(memcpy( (void*)0x200000000f80, "\x78\x9c\xec\xdc\xcd\x8f\x53\x55\x1b\x00\xf0\xe7\xde\x4e\x87\x97\x17\x70" "\x46\xc4\x0f\x3e\xd4\x51\x34\x4e\xfc\x98\x61\x00\x95\x85\x0b\x35\x9a\xb8" "\xc0\xc4\x44\x17\xba\x9c\xcc\x0c\x04\x29\x8c\x61\xc6\x44\x08\x51\x30\x06" "\x57\xc6\x98\xb8\x37\x2e\xfd\x17\x5c\xe9\xc6\x18\x57\x26\x6e\x75\x6f\x48" "\x88\x61\x03\xb8\xaa\xb9\xed\xbd\x4c\x5b\xda\xc2\x74\x5a\xaa\xd3\xdf\x2f" "\xb9\x70\xce\xbd\xe7\x72\xce\xd3\x73\x4f\x7b\xee\x3d\x2d\x01\x8c\xac\xa9" "\xec\x8f\x24\x62\x7b\x44\xfc\x1e\x11\x13\xf5\x6c\x73\x81\xa9\xfa\x5f\xd7" "\xaf\x9e\x5f\xb8\x71\xf5\xfc\x42\x12\xd5\xea\xdb\x7f\x25\xb5\x72\xd7\xae" "\x9e\x5f\x28\x8a\x16\xe7\x6d\xcb\x33\xd3\x69\x44\xfa\x59\x12\x7b\xdb\xd4" "\xbb\x72\xf6\xdc\xc9\xf9\x4a\x65\xe9\x4c\x9e\x9f\x5d\x3d\xf5\xc1\xec\xca" "\xd9\x73\xcf\x9d\x38\x35\x7f\x7c\xe9\xf8\xd2\xe9\x83\x47\x8e\x1c\x3e\x34" "\xf7\xe2\x0b\x07\x9f\xef\x4b\x9c\x59\x9b\xae\xed\xf9\x78\x79\xdf\xee\x37" "\xde\xfb\xea\xcd\xa3\x5f\x34\xc5\xdf\x12\x47\x9f\x4c\x75\x3b\xf8\x64\xb5" "\xda\xe7\xea\x86\x6b\x47\x43\x3a\x19\x1b\x62\x43\x58\x97\x52\x44\x64\xdd" "\x55\xae\x8d\xff\x89\x28\xc5\x5a\xe7\x4d\xc4\xeb\x9f\x0e\xb5\x71\xc0\x40" "\x55\xab\xd5\xea\xb6\xce\x87\x2f\x54\x81\x4d\x2c\x89\xe6\xbc\x21\x0f\xa3" "\xa2\xf8\xa0\xcf\xee\x7f\x8b\xad\x75\x12\xf0\xf2\xe0\xa6\x1f\x43\x77\xe5" "\x95\xfa\x0d\x50\x16\xf7\xf5\x7c\xab\x1f\x19\x8b\x34\x2f\x53\x6e\xb9\xbf" "\xed\xa7\xa9\x88\x78\xf7\xc2\xdf\xdf\x64\x5b\x0c\xe6\x39\x04\x00\x40\x93" "\x1f\xb2\xf9\xcf\xb3\xed\xe6\x7f\x69\x3c\xd0\x50\xee\x9e\x7c\x6d\x68\x32" "\x22\xee\x8d\x88\x9d\x11\x71\x5f\x44\xec\x8a\x88\xfb\x23\x6a\x65\x1f\x8c" "\x88\x87\xd6\x59\x7f\xeb\x22\xc9\xad\xf3\x9f\xf4\x72\x4f\x81\xdd\xa1\x6c" "\xfe\xf7\x52\xbe\xb6\xd5\x3c\xff\x2b\x66\x7f\x31\x59\xca\x73\x3b\x6a\xf1" "\x97\x93\x63\x27\x2a\x4b\x07\xf2\xd7\x64\x3a\xca\x5b\xb2\xfc\x5c\x97\x3a" "\x7e\x7c\xed\xb7\x2f\x3b\x1d\x6b\x9c\xff\x65\x5b\x56\x7f\x31\x17\xcc\xdb" "\x71\x79\x6c\x4b\xf3\x39\x8b\xf3\xab\xf3\x1b\x89\xb9\xd1\x95\x8b\x11\x7b" "\xc6\xda\xc5\x9f\xdc\x5c\x09\x48\x22\x62\x77\x44\xec\xe9\xb1\x8e\x13\x4f" "\x7f\xb7\xaf\xd3\xb1\xdb\xc7\xdf\x45\x1f\xd6\x99\xaa\xdf\x46\x3c\x55\xef" "\xff\x0b\xd1\x12\x7f\x21\xe9\xbe\x3e\x39\xfb\xbf\xa8\x2c\x1d\x98\x2d\xae" "\x8a\x5b\xfd\xf2\xeb\xa5\xb7\x3a\xd5\xbf\xa1\xf8\xfb\x20\xeb\xff\xff\xb7" "\xbd\xfe\x6f\xc6\x3f\x99\x34\xae\xd7\xae\xac\xbf\x8e\x4b\x7f\x7c\xde\xf1" "\x9e\xa6\xd7\xeb\x7f\x3c\x79\xa7\x96\x1e\xcf\xf7\x7d\x34\xbf\xba\x7a\x66" "\x2e\x62\x3c\x39\x5a\x6f\x74\xe3\xfe\x83\x6b\xe7\x16\xf9\xa2\x7c\x16\xff" "\xf4\xfe\xf6\xe3\x7f\x67\xac\xbd\x12\x7b\x23\x22\xbb\x88\x1f\x8e\x88\x47" "\x22\xe2\xd1\xbc\xed\x8f\x45\xc4\xe3\x11\xb1\xbf\x4b\xfc\x3f\xbf\xfa\xc4" "\xfb\xbd\xc7\x3f\x58\x59\xfc\x8b\xeb\xea\xff\xb5\xc4\x78\xb4\xee\x69\x9f" "\x28\x9d\xfc\xe9\xfb\xa6\x4a\x27\x6f\x89\xff\x46\xf7\xfe\x3f\x5c\x4b\x4d" "\xe7\x7b\xee\xe4\xfd\xef\x4e\xda\xd5\xdb\xd5\x0c\x00\x00\x00\xff\x3d\x69" "\x44\x6c\x8f\x24\x9d\xb9\x99\x4e\xd3\x99\x99\xfa\xf7\xe5\x77\x45\xa4\x95" "\xe5\x95\xd5\x67\x8e\x2d\x7f\x78\x7a\xb1\xfe\x1b\x81\xc9\x28\xa7\xc5\x93" "\xae\x89\x86\xe7\xa1\x73\xf9\x6d\x7d\x3d\x7f\x31\x22\xea\x5f\x2d\x28\x8e" "\x1f\xca\x9f\x1b\x7f\x5d\xda\x5a\xcb\xcf\x2c\x2c\x57\x16\x87\x1d\x3c\x8c" "\xb8\x6d\x1d\xc6\x7f\xe6\xcf\xd2\xb0\x5b\x07\x0c\x9c\xdf\x6b\xc1\xe8\x32" "\xfe\x61\x74\x19\xff\x30\xba\x8c\x7f\x18\x5d\x6d\xc6\xff\xd6\x61\xb4\x03" "\xb8\xfb\xda\x7d\xfe\x7f\x32\x84\x76\x00\x77\x5f\xcb\xf8\xb7\xec\x07\x23" "\xc4\xfd\x3f\x8c\xae\x8e\xe3\x7f\x33\xff\xcf\x3f\x40\x8d\xcf\x7f\x18\x49" "\x2b\x5b\xe3\xf6\x3f\x92\xef\x9a\x28\xfe\xa5\x1e\x4f\xdf\xb4\x89\x28\xff" "\x2b\x9a\xb1\xf1\x44\x35\x69\xdb\xb9\x91\x0e\xbb\x61\x12\x83\x4c\x0c\xf7" "\x7d\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x5f\xfe\x09\x00" "\x00\xff\xff\xaa\x61\xe0\x4f", 1105)); NONFAILING(syz_mount_image( /*fs=*/0x200000000000, /*dir=*/0x200000000180, /*flags=MS_RELATIME|MS_NOSUID|MS_NOEXEC|MS_NODEV|0x4c0*/ 0x2004ce, /*opts=*/0x2000000001c0, /*chdir=*/3, /*size=*/0x451, /*img=*/0x200000000f80)); // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // mode: open_mode = 0x0 (8 bytes) // ] NONFAILING(memcpy((void*)0x2000000000c0, "./bus\000", 6)); syscall(__NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x2000000000c0ul, /*mode=*/0ul); // chdir arguments: [ // dir: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // ] NONFAILING(memcpy((void*)0x200000000180, "./bus\000", 6)); syscall(__NR_chdir, /*dir=*/0x200000000180ul); // quotactl$Q_QUOTAON arguments: [ // cmd: quota_cmd_quota_on = 0xffffffff80000202 (8 bytes) // special: ptr[in, blockdev_filename] { // union blockdev_filename { // loop: loop_filename { // prefix: buffer: {2f 64 65 76 2f 6c 6f 6f 70} (length 0x9) // id: proc = 0x0 (1 bytes) // z: const = 0x0 (1 bytes) // } // } // } // id: uid (resource) // addr: nil // ] NONFAILING(memcpy((void*)0x200000000180, "/dev/loop", 9)); NONFAILING(*(uint8_t*)0x200000000189 = 0x30); NONFAILING(*(uint8_t*)0x20000000018a = 0); syscall(__NR_quotactl, /*cmd=Q_QUOTAON_PRJ*/ 0xffffffff80000202ul, /*special=*/0x200000000180ul, /*id=*/(intptr_t)-1, /*addr=*/0ul); // mprotect arguments: [ // addr: VMA[0x3000] // len: len = 0x3000 (8 bytes) // prot: mmap_prot = 0x9 (8 bytes) // ] syscall(__NR_mprotect, /*addr=*/0x200000000000ul, /*len=*/0x3000ul, /*prot=PROT_SEM|PROT_READ*/ 9ul); // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {68 75 67 65 74 6c 62 2e 31 47 42 2e 75 73 61 67 65 5f 69 6e // 5f 62 79 74 65 73 00} (length 0x1b) // } // flags: const = 0x275a (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd NONFAILING( memcpy((void*)0x200000000180, "hugetlb.1GB.usage_in_bytes\000", 27)); res = syscall(__NR_openat, /*fd=*/(intptr_t)-1, /*file=*/0x200000000180ul, /*flags=*/0x275a, /*mode=*/0); if (res != -1) r[0] = res; // mmap arguments: [ // addr: VMA[0xb36000] // len: len = 0xb36000 (8 bytes) // prot: mmap_prot = 0xa (8 bytes) // flags: mmap_flags = 0x28011 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0xb36000ul, /*prot=PROT_SEM|PROT_WRITE*/ 0xaul, /*flags=MAP_STACK|MAP_POPULATE|MAP_FIXED|MAP_SHARED*/ 0x28011ul, /*fd=*/r[0], /*offset=*/0ul); // write$FUSE_INIT arguments: [ // fd: fd_fuse (resource) // arg: ptr[in, fuse_out_t[fuse_unique, fuse_init_out]] { // fuse_out_t[fuse_unique, fuse_init_out] { // len: len = 0x50 (4 bytes) // err: fuse_errors = 0x0 (4 bytes) // unique: fuse_unique (resource) // payload: fuse_init_out { // major: const = 0x7 (4 bytes) // minor: const = 0x29 (4 bytes) // max_readahead: int32 = 0x0 (4 bytes) // flags: fuse_init_flags = 0x51500430 (4 bytes) // max_background: int16 = 0x0 (2 bytes) // congestion_threshold: int16 = 0x2 (2 bytes) // max_write: int32 = 0xfffffffd (4 bytes) // time_gran: int32 = 0x2 (4 bytes) // max_pages: const = 0x0 (2 bytes) // map_alignment: const = 0x0 (2 bytes) // flags2: fuse_init_flags2 = 0x4 (4 bytes) // max_stack_depth: int32 = 0x8 (4 bytes) // unused: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00} (length 0x18) // } // } // } // len: bytesize = 0x50 (8 bytes) // ] NONFAILING(*(uint32_t*)0x200000000440 = 0x50); NONFAILING(*(uint32_t*)0x200000000444 = 0); NONFAILING(*(uint64_t*)0x200000000448 = 0); NONFAILING(*(uint32_t*)0x200000000450 = 7); NONFAILING(*(uint32_t*)0x200000000454 = 0x29); NONFAILING(*(uint32_t*)0x200000000458 = 0); NONFAILING(*(uint32_t*)0x20000000045c = 0x51500430); NONFAILING(*(uint16_t*)0x200000000460 = 0); NONFAILING(*(uint16_t*)0x200000000462 = 2); NONFAILING(*(uint32_t*)0x200000000464 = 0xfffffffd); NONFAILING(*(uint32_t*)0x200000000468 = 2); NONFAILING(*(uint16_t*)0x20000000046c = 0); NONFAILING(*(uint16_t*)0x20000000046e = 0); NONFAILING(*(uint32_t*)0x200000000470 = 4); NONFAILING(*(uint32_t*)0x200000000474 = 8); NONFAILING(memset((void*)0x200000000478, 0, 24)); syscall(__NR_write, /*fd=*/(intptr_t)-1, /*arg=*/0x200000000440ul, /*len=*/0x50ul); // open arguments: [ // file: ptr[in, buffer] { // buffer: {2e 00} (length 0x2) // } // flags: open_flags = 0x0 (8 bytes) // mode: open_mode = 0x0 (8 bytes) // ] // returns fd NONFAILING(memcpy((void*)0x200000001b80, ".\000", 2)); res = syscall(__NR_open, /*file=*/0x200000001b80ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[1] = res; // ioctl$FS_IOC_SETFLAGS arguments: [ // fd: fd (resource) // cmd: const = 0x40086602 (4 bytes) // arg: ptr[in, fs_flags] { // fs_flags = 0x40000000 (4 bytes) // } // ] NONFAILING(*(uint32_t*)0x2000000001c0 = 0x40000000); syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x40086602, /*arg=*/0x2000000001c0ul); // open arguments: [ // file: ptr[in, buffer] { // buffer: {2e 00} (length 0x2) // } // flags: open_flags = 0x0 (8 bytes) // mode: open_mode = 0x0 (8 bytes) // ] // returns fd NONFAILING(memcpy((void*)0x200000000300, ".\000", 2)); res = syscall(__NR_open, /*file=*/0x200000000300ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[2] = res; // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {13 13 77 c5 fc 35 d4 14 54 d5 d4 1d 29 ad 1a 60 29 59 81 46 // e6 be 16 6e 41 ad 0d bd 40 54 03 3c 9f 33 bb da 82 24 a2 f3 d7 72 e7 // 63 6e 48 b3 3c bf 70 83 72 e8 f1 b9 93 3e c5 12 77 43 be 22 06 20 9e // f0 2d f9 cb f2 f6 e8 80 d3 38 2f 00} (length 0x4e) // } // mode: open_mode = 0x0 (8 bytes) // ] NONFAILING( memcpy((void*)0x200000000340, "\023\023w\305\3745\324\024T\325\324\035)\255\032`)" "Y\201F\346\276\026nA\255\r\275@T\003<\2373\273\332\202$" "\242\363\327r\347cnH\263<\277p\203r\350\361\271\223>" "\305\022wC\276\"\006 \236\360-\371\313\362\366\350\200\3238/\000", 78)); syscall(__NR_mkdirat, /*fd=*/r[2], /*path=*/0x200000000340ul, /*mode=*/0ul); return 0; }