// https://syzkaller.appspot.com/bug?id=da7fcbd38e8a38be1f09949ab54ba23e1249dd8a // 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 #include #include #include #include #include #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; for (;;) { uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts); if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) return 1; now = current_time_ms(); if (now - start > timeout) return 0; } } static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } //% 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; } static void setup_sysctl() { int cad_pid = fork(); if (cad_pid < 0) exit(1); if (cad_pid == 0) { for (;;) sleep(100); } char tmppid[32]; snprintf(tmppid, sizeof(tmppid), "%d", cad_pid); struct { const char* name; const char* data; } files[] = { {"/sys/kernel/debug/x86/nmi_longest_ns", "10000000000"}, {"/proc/sys/kernel/hung_task_check_interval_secs", "20"}, {"/proc/sys/net/core/bpf_jit_kallsyms", "1"}, {"/proc/sys/net/core/bpf_jit_harden", "0"}, {"/proc/sys/kernel/kptr_restrict", "0"}, {"/proc/sys/kernel/softlockup_all_cpu_backtrace", "1"}, {"/proc/sys/fs/mount-max", "100"}, {"/proc/sys/vm/oom_dump_tasks", "0"}, {"/proc/sys/debug/exception-trace", "0"}, {"/proc/sys/kernel/printk", "7 4 1 3"}, {"/proc/sys/kernel/keys/gc_delay", "1"}, {"/proc/sys/vm/oom_kill_allocating_task", "1"}, {"/proc/sys/kernel/ctrl-alt-del", "0"}, {"/proc/sys/kernel/cad_pid", tmppid}, }; for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); i++) { if (!write_file(files[i].name, files[i].data)) { } } kill(cad_pid, SIGKILL); while (waitpid(cad_pid, NULL, 0) != cad_pid) ; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void loop(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 6; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); if (call == 4) break; event_timedwait(&th->done, 50 + (call == 0 ? 4000 : 0)); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: // 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 32 00} (length 0x8) // } // flags: mount_flags = 0x2000410 (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 { // bsdgroups: buffer: {62 73 64 67 72 6f 75 70 73} (length 0x9) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // jqfmt_vfsv1: buffer: {6a 71 66 6d 74 3d 76 66 73 76 31} // (length 0xb) // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0xc1 (1 bytes) // size: len = 0x7ea (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x7ea) // } // ] // returns fd_dir memcpy((void*)0x200000000780, "ext4\000", 5); memcpy((void*)0x200000000240, "./file2\000", 8); memcpy((void*)0x200000000040, "bsdgroups", 9); *(uint8_t*)0x200000000049 = 0x2c; memcpy((void*)0x20000000004a, "jqfmt=vfsv1", 11); *(uint8_t*)0x200000000055 = 0x2c; *(uint8_t*)0x200000000056 = 0; memcpy( (void*)0x2000000007c0, "\x78\x9c\xec\xdd\xdd\x6b\x1c\x5d\x1d\x00\xe0\xdf\x6c\x3e\x36\x49\xab" "\x89\x20\xe8\xfb\x5e\x05\x04\x0d\xbc\xbc\x1b\x53\x63\xab\xe0\x45\xc5" "\x0b\x11\x2c\x14\xf4\xda\x36\x6c\xb6\xa1\x66\x93\x2d\xd9\x4d\x69\x42" "\xa0\xe9\x85\xe0\x8d\xa0\xe2\x85\xa0\x37\xbd\xf6\xa3\x5e\x08\xde\xfa" "\x71\xab\xff\x84\x78\x21\x2d\x45\xd3\x60\xbd\x92\x95\x99\x9d\xcd\xc7" "\x66\x37\x1f\x4d\x36\x49\xc9\xf3\xc0\xec\x9c\x33\x73\x66\xce\x39\x3b" "\x67\x66\xce\xee\x1c\x76\x03\xb8\xb2\x26\xd3\x97\x42\xc4\x07\x11\xf1" "\xe3\x24\x62\x3c\x5f\x9e\x44\xc4\x50\x16\x1a\x8c\xb8\xdd\x4a\xf7\x76" "\x6b\xa3\x9c\x4e\x49\x34\x9b\xdf\xf9\x57\x92\xa5\xf9\xfd\xb5\xdd\x7d" "\x25\xf9\xfc\x5a\x1e\xf9\x6c\x44\xfc\xf9\x07\x11\x1f\x15\x3a\x73\x1d" "\xcd\xe7\xd5\xca\x4a\x1e\x9a\x6e\x2c\x3d\x9a\xae\xaf\xad\x7f\xfc\x70" "\x69\x6e\xa1\xb2\x50\x59\xbe\x39\x33\x3b\x7b\xe3\xd6\x97\x6f\xdd\x3c" "\xb8\xd5\xbb\xfa\xcf\xdf\xd6\xaf\xbf\xfa\xc9\x37\xbf\xf0\xdb\xdb\x83" "\xf1\x99\x17\x3f\xfa\x4b\x12\xb7\xe3\x7a\xbe\x6e\x7b\x6b\xa3\x7c\xca" "\xdd\x1f\x30\x19\x93\xf9\x7b\x32\x94\xbe\x85\xfb\x7c\xe3\xac\x33\xbb" "\x60\xc9\x45\x17\x80\x77\x92\x9e\x9a\x03\xad\xb3\x3c\x3e\x88\xf1\x18" "\xc8\x42\x3d\x9c\xf6\x04\x04\x00\x2e\x85\xa7\x11\xd1\x04\x00\xae\x98" "\xc4\xfd\x1f\x00\xae\x98\xf6\xf7\x00\xdb\x5b\x1b\xe5\xf6\x74\xb1\xdf" "\x48\x9c\xaf\xd7\x5f\x8f\x88\x91\x56\xfd\xdb\xcf\x37\x5b\x6b\x06\xf3" "\x67\x76\x23\xd9\x73\xd0\xb1\xed\x64\xdf\x93\x91\x24\x22\x26\xce\x20" "\xff\xc9\x88\xf8\xe5\x1f\xbe\xf7\xeb\x74\x8a\x3e\x3d\x87\x04\xe8\x66" "\xf3\x59\x44\xdc\x9f\x98\xdc\xde\x2a\x76\x5c\xff\x93\xf4\xfa\x37\x7c" "\xf4\x1e\x8a\x3d\xd7\x7c\xf1\xb0\xcd\x9a\xad\xed\x26\x3b\x16\xb7\xf2" "\x6f\x36\x9b\x4f\x8f\xca\xd7\xc3\x68\x38\xad\x3f\xa6\xfd\x9f\xaf\x1c" "\xec\xff\x7d\xb8\x33\xa0\x67\x24\x7b\xed\xe8\xff\x8c\x14\xbb\x9c\xbb" "\xef\xa2\xfb\xf9\xbf\x57\xe1\x65\x8f\x4d\x8f\x71\x6d\x3a\x5a\xda\xff" "\xfb\xda\x9e\xb1\x6d\xbb\xfd\xbf\x9d\x41\x6b\x13\x03\x79\xec\x13\x59" "\x9f\x6f\x28\x79\xf0\xb0\x5a\x49\xaf\x6d\x9f\x8c\x88\xa9\x18\x2a\xa6" "\xf1\x99\x2c\x69\xf7\x51\x50\x53\x6f\xfe\xf7\xa6\x57\xfe\x7b\xfb\x7f" "\xff\xfe\xe9\xf7\x7f\x95\xe6\x9f\xce\x77\x53\x14\x5e\x0e\x16\xa3\x39" "\xbe\x67\x9b\xf9\xb9\xc6\xdc\x19\x54\x3d\xf3\xfa\x59\xc4\x87\x83\xdd" "\xea\x9f\xec\xf4\x7f\x93\x1e\xfd\xdf\xbb\x3d\xf7\xba\xff\xd0\x7c\xeb" "\xab\x3f\xfc\x45\xaf\x94\x69\xfd\xd3\xfa\xb6\xa7\x83\xf5\xef\xaf\xe6" "\xf3\x88\xcf\x77\x3d\xfe\xbb\xc7\x32\xc9\xc6\x27\x0e\xe4\xb1\xce\xf1" "\x89\xd3\x59\x73\x98\x6e\x37\x8a\x2e\x7e\xf7\x8f\x9f\x8f\xf5\xca\x7f" "\xf7\xf8\x17\xb3\x79\x9a\x7f\xfb\xb3\xc0\x79\x48\x8f\xff\xd8\xe1\xf5" "\x9f\x48\x43\xf5\xb5\xf5\xc5\xb9\x6a\xb5\xb2\x52\x3f\x79\x1e\x7f\x7d" "\x3e\xfe\xa7\x5e\xeb\xf6\xb6\xff\xee\xf5\xcf\xda\xff\x3e\x69\xfb\x1f" "\x4e\xbe\x9b\x85\xdb\x2d\xed\xc9\x5c\xa3\xb1\x32\x13\x31\x9c\x7c\xfb" "\xe0\xf2\x1b\xbb\xdb\xb6\xe3\xed\xf4\x69\xfd\xa7\x3e\xd7\xfd\xfc\xef" "\xd5\xfe\x0b\xf9\xd8\xd8\xfb\x3b\xb1\xc3\x0d\xbe\x1a\xfe\x4d\xbe\xab" "\xae\xf5\xcf\x6c\xf6\xaa\x7f\x7f\xa5\xf5\x9f\x3f\xd1\xf1\x3f\x24\xd0" "\xcc\xb7\xe9\x58\xf5\xe2\xed\xe2\x40\xaf\xfc\x8f\x77\xfc\x67\xb3\xd0" "\x54\xbe\xe4\x38\xd7\xbf\x23\x4a\x7a\x8a\xd6\x0c\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x27\x57\x88" "\x88\xeb\x91\x14\x4a\x3b\xe1\x42\xa1\x54\x6a\xfd\x87\xf7\xa7\x63\xac" "\x50\xad\xd5\x1b\x1f\x3d\xa8\xad\x2e\xcf\x47\xf6\x5f\xd9\x13\x31\x54" "\x68\xff\xd4\xe5\xf8\x9e\xdf\x43\x9d\xc9\x7f\x0f\xbf\x1d\xbf\xd1\x11" "\xff\x52\x44\x7c\x2a\x22\x7e\x56\x1c\xcd\xe2\xa5\x72\xad\x3a\x7f\xd1" "\x95\x07\x00\x00\x00\x00\x00\x00\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\xdc" "\xb5\xfd\xff\xff\xff\x34\x9d\x95\x4a\xad\x75\xff\x2c\x5e\x74\xe9\x00" "\x80\xbe\x19\xb9\xe8\x02\x00\x00\xe7\xce\xfd\x1f\x00\xae\x9e\x93\xdd" "\xff\x47\xfb\x56\x0e\x00\xe0\xfc\x9c\xf8\xf3\x7f\x33\xe9\x4f\x41\x00" "\x80\x73\x73\xec\xfb\xff\xfd\xfe\x96\x03\x00\x38\x3f\x9e\xff\x03\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\x67" "\x77\xef\xdc\x49\xa7\xe6\x7f\xb7\x36\xca\x69\x7c\xfe\xf1\xda\xea\x62" "\xed\xf1\xc7\xf3\x95\xfa\x62\x69\x69\xb5\x5c\x2a\xd7\x56\x1e\x95\x16" "\x6a\xb5\x85\x6a\xa5\x54\xae\x2d\xf5\xdc\xd1\x66\x6b\x56\xad\xd5\x1e" "\xcd\xc6\xf2\xea\x93\xe9\x46\xa5\xde\x98\xae\xaf\xad\xdf\x5b\xaa\xad" "\x2e\x37\xee\x3d\x5c\x9a\x5b\xa8\xdc\xab\x0c\x9d\x5b\xcd\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xf8\xea\x6b\xeb\x8b" "\x73\xd5\x6a\x65\x45\xe0\x90\xc0\x68\x65\xf4\x32\x14\xe3\x12\x05\x06" "\xe3\x52\x14\xe3\x40\x60\xf3\xef\x43\x59\xbb\x3e\x34\x71\x4c\xbc\x37" "\x8d\x7f\xf8\x90\x34\xc9\x59\xe6\x35\xda\xb9\x64\xef\x55\x62\xf4\x42" "\xae\x4d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xef\x83\xff\x07\x00\x00\xff\xff\x60" "\x4c\x18\xc7", 2026); syz_mount_image(/*fs=*/0x200000000780, /*dir=*/0x200000000240, /*flags=MS_LAZYTIME|MS_SYNCHRONOUS|MS_NOATIME*/ 0x2000410, /*opts=*/0x200000000040, /*chdir=*/0xc1, /*size=*/0x7ea, /*img=*/0x2000000007c0); break; case 1: // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {62 6c 6b 69 6f 2e 62 66 71 2e 74 69 6d 65 5f 72 65 63 75 72 // 73 69 76 65 00} (length 0x19) // } // flags: const = 0x275a (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x200000000100, "blkio.bfq.time_recursive\000", 25); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000100ul, /*flags=*/0x275a, /*mode=*/0); if (res != -1) r[0] = res; break; case 2: // write$binfmt_script arguments: [ // fd: fd_binfmt (resource) // data: ptr[in, binfmt_script] { // binfmt_script { // hdr: buffer: {23 21 20} (length 0x3) // bin: buffer: {} (length 0x0) // args: array[binfmt_script_arg] { // } // nl: const = 0xa (1 bytes) // data: buffer: {} (length 0x0) // } // } // len: bytesize = 0x4 (8 bytes) // ] memcpy((void*)0x200000000140, "#! ", 3); *(uint8_t*)0x200000000143 = 0xa; syscall(__NR_write, /*fd=*/r[0], /*data=*/0x200000000140ul, /*len=*/4ul); break; case 3: // 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); break; case 4: // write$binfmt_script arguments: [ // fd: fd_binfmt (resource) // data: ptr[in, binfmt_script] { // binfmt_script { // hdr: buffer: {23 21 20} (length 0x3) // bin: buffer: {} (length 0x0) // args: array[binfmt_script_arg] { // } // nl: const = 0xa (1 bytes) // data: buffer: {} (length 0x0) // } // } // len: bytesize = 0x4 (8 bytes) // ] memcpy((void*)0x200000000140, "#! ", 3); *(uint8_t*)0x200000000143 = 0xa; syscall(__NR_write, /*fd=*/r[0], /*data=*/0x200000000140ul, /*len=*/4ul); break; case 5: // ioctl$FIBMAP arguments: [ // fd: fd (resource) // cmd: const = 0x1 (4 bytes) // arg: ptr[in, int32] { // int32 = 0x10001 (4 bytes) // } // ] *(uint32_t*)0x200000000080 = 0x10001; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/1, /*arg=*/0x200000000080ul); break; } } 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); setup_sysctl(); const char* reason; (void)reason; loop(); return 0; }