// https://syzkaller.appspot.com/bug?id=de3f8ed467b7ff2e84cb3f1fe82bbf32ec7b687d // 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*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=*/0x1000, /*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 = 0x408e (8 bytes) // opts: ptr[in, fs_options[ext4_options]] { // fs_options[ext4_options] { // elems: array[fs_opt_elem[ext4_options]] { // fs_opt_elem[ext4_options] { // elem: union ext4_options { // debug_want_extra_isize: fs_opt["debug_want_extra_isize", // fmt[hex, int32]] { // name: buffer: {64 65 62 75 67 5f 77 61 6e 74 5f 65 78 74 72 // 61 5f 69 73 69 7a 65} (length 0x16) eq: const = 0x3d (1 // bytes) val: int32 = 0x2e (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // lazytime: buffer: {6c 61 7a 79 74 69 6d 65} (length 0x8) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // jqfmt_vfsv0: buffer: {6a 71 66 6d 74 3d 76 66 73 76 30} // (length 0xb) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // stripe: fs_opt["stripe", fmt[hex, int32]] { // name: buffer: {73 74 72 69 70 65} (length 0x6) // eq: const = 0x3d (1 bytes) // val: int32 = 0x4000 (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // errors_remount: buffer: {65 72 72 6f 72 73 3d 72 65 6d 6f 75 // 6e 74 2d 72 6f} (length 0x11) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // max_batch_time: fs_opt["max_batch_time", fmt[hex, int32]] { // name: buffer: {6d 61 78 5f 62 61 74 63 68 5f 74 69 6d 65} // (length 0xe) eq: const = 0x3d (1 bytes) val: int32 = 0x4 (18 // bytes) // } // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0x3 (1 bytes) // size: len = 0x43a (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x43a) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000040, "ext4\000", 5)); NONFAILING(memcpy((void*)0x200000000200, "./file1\000", 8)); NONFAILING(memcpy((void*)0x200000000240, "debug_want_extra_isize", 22)); NONFAILING(*(uint8_t*)0x200000000256 = 0x3d); NONFAILING(sprintf((char*)0x200000000257, "0x%016llx", (long long)0x2e)); NONFAILING(*(uint8_t*)0x200000000269 = 0x2c); NONFAILING(memcpy((void*)0x20000000026a, "lazytime", 8)); NONFAILING(*(uint8_t*)0x200000000272 = 0x2c); NONFAILING(memcpy((void*)0x200000000273, "jqfmt=vfsv0", 11)); NONFAILING(*(uint8_t*)0x20000000027e = 0x2c); NONFAILING(memcpy((void*)0x20000000027f, "stripe", 6)); NONFAILING(*(uint8_t*)0x200000000285 = 0x3d); NONFAILING(sprintf((char*)0x200000000286, "0x%016llx", (long long)0x4000)); NONFAILING(*(uint8_t*)0x200000000298 = 0x2c); NONFAILING(memcpy((void*)0x200000000299, "errors=remount-ro", 17)); NONFAILING(*(uint8_t*)0x2000000002aa = 0x2c); NONFAILING(memcpy((void*)0x2000000002ab, "max_batch_time", 14)); NONFAILING(*(uint8_t*)0x2000000002b9 = 0x3d); NONFAILING(sprintf((char*)0x2000000002ba, "0x%016llx", (long long)4)); NONFAILING(*(uint8_t*)0x2000000002cc = 0x2c); NONFAILING(*(uint8_t*)0x2000000002cd = 0); NONFAILING(memcpy( (void*)0x200000000340, "\x78\x9c\xec\xdb\xcb\x6f\x1b\x45\x18\x00\xf0\x6f\xd7\x71\x4a\x5f\x24\x94" "\xf2\xe8\x03\x08\x14\x44\xc4\x23\x69\xd2\x02\x3d\x70\x01\x81\xc4\x01\x24" "\x24\x38\x94\x63\x48\xd2\xaa\xd4\x6d\x50\x13\x24\x5a\x55\x10\x10\x2a\x47" "\x54\x89\x3b\xe2\x88\xc4\x5f\xc0\x09\x2e\x08\x38\x21\x71\x85\x3b\xaa\x54" "\xa1\x5c\x5a\x38\x19\xad\xbd\x9b\x38\x8e\x9d\x26\xc1\x8e\x4b\xfd\xfb\x49" "\x9b\xcc\xec\x8e\x33\xf3\x79\x76\xec\xd9\x9d\x6c\x00\x7d\x6b\x24\xfb\x91" "\x44\xec\x89\x88\xdf\x23\x62\xa8\x9e\x5d\x5d\x60\xa4\xfe\xeb\xe6\xd2\xe5" "\xe9\xbf\x97\x2e\x4f\x27\x51\xad\xbe\xf5\x57\x52\x2b\x77\x63\xe9\xf2\x74" "\x51\xb4\x78\xdd\xee\x3c\x33\x9a\x46\xa4\x9f\x25\x71\xa8\x45\xbd\xf3\x17" "\x2f\x9d\x9d\xaa\x54\x66\x2f\xe4\xf9\xf1\x85\x73\xef\x8f\xcf\x5f\xbc\xf4" "\xec\x99\x73\x53\xa7\x67\x4f\xcf\x9e\x9f\x3c\x71\xe2\xf8\xb1\x89\x17\x9e" "\x9f\x7c\xae\x23\x71\x66\x6d\xba\x71\xf0\xa3\xb9\xc3\x07\x5e\x7b\xe7\xea" "\x1b\xd3\x27\xaf\xbe\xfb\xf3\xb7\x49\x11\x7f\x53\x1c\x1d\x32\xb2\xde\xc1" "\x27\xaa\xd5\x0e\x57\xd7\x5b\x7b\x1b\xd2\xc9\x40\x0f\x1b\xc2\xa6\x94\x22" "\x22\xeb\xae\x72\x6d\xfc\x0f\x45\x29\x56\x3a\x6f\x28\x5e\xfd\xb4\xa7\x8d" "\x03\xba\xaa\x5a\xad\x56\x77\xb7\x3f\xbc\x58\x05\xee\x60\x49\x6c\xb4\xe4" "\xd9\xfc\xf3\x02\xb8\x33\x14\x5f\xf4\xd9\xf5\x6f\xb1\x6d\xd3\xd4\xe3\xb6" "\x70\xfd\xa5\xfa\x05\x50\x16\xf7\xcd\x7c\xab\x1f\x19\x88\x34\x2f\x53\x6e" "\xba\xbe\xed\xa4\x91\x88\x38\xb9\xf8\xcf\x57\xd9\x16\xdd\xb9\x0f\x01\x00" "\xb0\xca\xf7\xd9\xfc\xe7\x99\x56\xf3\xbf\x34\xee\x6f\x28\x77\x77\xbe\x36" "\x34\x1c\x11\xf7\x44\xc4\xbe\x88\xb8\x37\x22\xf6\x47\xc4\x7d\x11\xb5\xb2" "\x0f\x44\xc4\x83\x9b\xac\xbf\x79\x91\x64\xed\xfc\x27\xbd\xb6\xa5\xc0\x36" "\x28\x9b\xff\xbd\x98\xaf\x6d\xad\x9e\xff\x15\xb3\xbf\x18\x2e\xe5\xb9\xbd" "\xb5\xf8\xcb\xc9\xa9\x33\x95\xd9\xa3\xf9\x7b\x32\x1a\xe5\x1d\x59\x7e\x62" "\x9d\x3a\x7e\x78\xe5\xb7\x2f\xda\x1d\x6b\x9c\xff\x65\x5b\x56\x7f\x31\x17" "\xcc\xdb\x71\x6d\x60\xc7\xea\xd7\xcc\x4c\x2d\x4c\xfd\x97\x98\x1b\x5d\xff" "\x24\xe2\xe0\x40\xab\xf8\x93\xe5\x95\x80\x24\x22\x0e\x44\xc4\xc1\x2d\xd6" "\x71\xe6\xa9\x6f\x0e\xb7\x3b\xd6\x2e\xfe\xf2\x46\xfe\x70\x07\xd6\x99\xaa" "\x5f\x47\x3c\x59\xef\xff\xc5\x68\x8a\xbf\x90\xac\xbf\x3e\x39\x7e\x57\x54" "\x66\x8f\x8e\x17\x67\xc5\x5a\xbf\xfc\x7a\xe5\xcd\x76\xf5\xdf\xba\xff\xbb" "\x2b\xeb\xff\x5d\x2d\xcf\xff\xe5\xf8\x87\x93\xc6\xf5\xda\xf9\xcd\xd7\x71" "\xe5\x8f\xcf\xdb\x5e\xd3\x6c\xf5\xfc\x1f\x4c\xde\xae\xa5\x07\xf3\x7d\x1f" "\x4e\x2d\x2c\x5c\x98\x88\x18\x4c\x5e\xaf\x37\xba\x71\xff\xe4\xca\x6b\x8b" "\x7c\x51\x3e\x8b\x7f\xf4\x48\xeb\xf1\xbf\x2f\x56\xde\x89\x43\x11\x91\x9d" "\xc4\x0f\x45\xc4\xc3\x11\xf1\x48\xde\xf6\x47\x23\xe2\xb1\x88\x38\xb2\x4e" "\xfc\x3f\xbd\xfc\xf8\x7b\x5b\x8f\xbf\xbb\xb2\xf8\x67\x36\xd5\xff\x2b\x89" "\xc1\x68\xde\xd3\x3a\x51\x3a\xfb\xe3\x77\xab\x2a\x1d\xde\x4c\xfc\x59\xff" "\x1f\xaf\xa5\x46\xf3\x3d\x1b\xf9\xfc\xdb\x48\xbb\xb6\x76\x36\x03\x00\x00" "\xc0\xff\x4f\x1a\x11\x7b\x22\x49\xc7\x96\xd3\x69\x3a\x36\x56\xff\x7f\xf9" "\xfd\xb1\x2b\xad\xcc\xcd\x2f\x3c\x7d\x6a\xee\x83\xf3\x33\xf5\x67\x04\x86" "\xa3\x9c\x16\x77\xba\x86\x1a\xee\x87\x4e\xe4\x97\xf5\x45\x7e\xb2\x29\x7f" "\x2c\xbf\x6f\xfc\x65\x69\x67\x2d\x3f\x36\x3d\x57\x99\xe9\x75\xf0\xd0\xe7" "\x76\xb7\x19\xff\x99\x3f\x4b\xbd\x6e\x1d\xd0\x75\x9e\xd7\x82\xfe\x65\xfc" "\x43\xff\x32\xfe\xa1\x7f\x19\xff\xd0\xbf\x5a\x8c\xff\x9d\xbd\x68\x07\xb0" "\xfd\x5a\x7d\xff\x7f\xdc\x83\x76\x00\xdb\xaf\x69\xfc\x5b\xf6\x83\x3e\xe2" "\xfa\x1f\xfa\x97\xf1\x0f\xfd\xcb\xf8\x87\xbe\x34\xbf\x33\x6e\xfd\x90\xbc" "\x84\xc4\x9a\x44\xa4\xb7\x45\x33\x24\xba\x94\xe8\xf5\x27\x13\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x40\x67\xfc\x1b\x00\x00\xff\xff\xd1\x3d" "\xe3\x43", 1082)); NONFAILING( syz_mount_image(/*fs=*/0x200000000040, /*dir=*/0x200000000200, /*flags=MS_REC|MS_NOSUID|MS_NOEXEC|MS_NODEV|0x80*/ 0x408e, /*opts=*/0x200000000240, /*chdir=*/3, /*size=*/0x43a, /*img=*/0x200000000340)); // quotactl$Q_QUOTAON arguments: [ // cmd: quota_cmd_quota_on = 0xffffffff80000201 (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_GRP*/ 0xffffffff80000201ul, /*special=*/0x200000000180ul, /*id=*/0, /*addr=*/0ul); // mprotect arguments: [ // addr: VMA[0x3000] // len: len = 0x3000 (8 bytes) // prot: mmap_prot = 0x1 (8 bytes) // ] syscall(__NR_mprotect, /*addr=*/0x200000000000ul, /*len=*/0x3000ul, /*prot=PROT_READ*/ 1ul); // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {6d 65 6d 6f 72 79 2e 63 75 72 72 65 6e 74 00} (length 0xf) // } // flags: const = 0x275a (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd NONFAILING(memcpy((void*)0x200000000180, "memory.current\000", 15)); 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 (4 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=*/0xb36000, /*prot=PROT_SEM|PROT_WRITE*/ 0xaul, /*flags=MAP_STACK|MAP_POPULATE|MAP_FIXED|MAP_SHARED*/ 0x28011ul, /*fd=*/r[0], /*offset=*/0ul); // open arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: open_flags = 0x64842 (8 bytes) // mode: open_mode = 0x159 (8 bytes) // ] // returns fd NONFAILING(memcpy((void*)0x200000000300, "./file1\000", 8)); res = syscall( __NR_open, /*file=*/0x200000000300ul, /*flags=O_NONBLOCK|O_NOFOLLOW|O_NOATIME|O_DIRECT|O_CREAT|0x2*/ 0x64842ul, /*mode=S_IXOTH|S_IXGRP|S_IWGRP|S_IXUSR|S_IRUSR*/ 0x159ul); if (res != -1) r[1] = res; // sendmsg$IPSET_CMD_GET_BYINDEX arguments: [ // fd: sock_nl_netfilter (resource) // msg: ptr[in, msghdr_netlink[netlink_msg_netfilter_t[NFNL_SUBSYS_IPSET, // IPSET_CMD_GET_BYINDEX, ip_set_index_policy]]] { // msghdr_netlink[netlink_msg_netfilter_t[NFNL_SUBSYS_IPSET, // IPSET_CMD_GET_BYINDEX, ip_set_index_policy]] { // addr: ptr[in, sockaddr_nl_t[AF_NETLINK, const[0, int32], // flags[netlink_group_bitmap, int32]]] { // sockaddr_nl_t[AF_NETLINK, const[0, int32], // flags[netlink_group_bitmap, int32]] { // nl_family: const = 0x10 (2 bytes) // nl_pad: const = 0x0 (2 bytes) // nl_pid: const = 0x0 (4 bytes) // nl_groups: netlink_group_bitmap = 0x1000000 (4 bytes) // } // } // addrlen: len = 0xc (4 bytes) // pad = 0x0 (4 bytes) // vec: nil // vlen: const = 0x1 (8 bytes) // ctrl: const = 0x0 (8 bytes) // ctrllen: const = 0x0 (8 bytes) // f: send_flags = 0x4000040 (4 bytes) // pad = 0x0 (4 bytes) // } // } // f: send_flags = 0x4044011 (8 bytes) // ] NONFAILING(*(uint64_t*)0x200000000800 = 0x2000000001c0); NONFAILING(*(uint16_t*)0x2000000001c0 = 0x10); NONFAILING(*(uint16_t*)0x2000000001c2 = 0); NONFAILING(*(uint32_t*)0x2000000001c4 = 0); NONFAILING(*(uint32_t*)0x2000000001c8 = 0x1000000); NONFAILING(*(uint32_t*)0x200000000808 = 0xc); NONFAILING(*(uint64_t*)0x200000000810 = 0); NONFAILING(*(uint64_t*)0x200000000818 = 1); NONFAILING(*(uint64_t*)0x200000000820 = 0); NONFAILING(*(uint64_t*)0x200000000828 = 0); NONFAILING(*(uint32_t*)0x200000000830 = 0x4000040); syscall( __NR_sendmsg, /*fd=*/r[1], /*msg=*/0x200000000800ul, /*f=MSG_ZEROCOPY|MSG_BATCH|MSG_PROBE|MSG_OOB|MSG_NOSIGNAL*/ 0x4044011ul); // truncate arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // len: intptr = 0x2fffffd (8 bytes) // ] NONFAILING(memcpy((void*)0x200000000940, "./file1\000", 8)); syscall(__NR_truncate, /*file=*/0x200000000940ul, /*len=*/0x2fffffdul); return 0; }