// https://syzkaller.appspot.com/bug?id=fba3951b5d7fbc3a12d2bd1143275cf47578a850 // 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 #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, 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 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, loopfd = -1, 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) { memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } errno = err; return res; } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void reset_loop() { char buf[64]; snprintf(buf, sizeof(buf), "/dev/loop%llu", procid); int loopfd = open(buf, O_RDWR); if (loopfd != -1) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } static void setup_sysctl() { char mypid[32]; snprintf(mypid, sizeof(mypid), "%d", getpid()); 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", mypid}, }; for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); i++) { if (!write_file(files[i].name, files[i].data)) printf("write to %s failed: %s\n", files[i].name, strerror(errno)); } } 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 execute_one(void) { int i, call, thread; for (call = 0; call < 4; 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); 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); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x20000600, "hfsplus\000", 8); memcpy((void*)0x20000140, "./file0\000", 8); memcpy( (void*)0x20000d00, "\x66\x6f\x72\x63\x65\x00\x00\x69\x61\xe3\x8c\x80\x00\x00\x00\x00\x00" "\x16\x00\x30\x30\x30\x30\x30\x30\x07\x3f\x41\x10\x1b\xb0\x30\x31\x39" "\x2c\x63\x72\x65\x61\x36\xd9\xbb\x3d\x25\xf4\xea\x83\x66\xa8\x71\x6c" "\xc2\x4c\xf9\x13\x02\x00\x5e\x72\x71\x24\x02\xbd\xc8\x02\x3a\x1c\xeb" "\x6c\xff\x75\x72\x4a\xcd\xc6\xbf\x74\x17\x01\x00\x53\x45\xd3\x7e\xc3" "\x7f\xb7\x82\x97\x50\x34\x06\x44\x60\x8b\xa8\x72\x92\xd3\xe1\x82\x1a" "\x70\x36\x46\x58\x4f\xb9\x46\xcf\x3b\x27\x7b\x74\xf3\xd9\x4d\x7f\x3f" "\x3b\x27\xb1\xb9\x53\xc9\x28\xa6\x3d\x77\x86\xe2\x3b\x2d\xcf\x98\xf4" "\xbb\xb4\x90\x3a\x06\xab\x8c\x62\x7b\x7b\xf4\xb1\xca\x08\xac\x07\xbc" "\x4a\xb9\x32\x8b\x87\x3f\xd8\xae\xba\xbb\x35\x96\x5f\x99\x7a\x19\x39" "\xb2\x3c\x87\x01\x48\x66\x7f\x5d\x6b\xeb\x1a\xca\x91\xb0\xae\xb7\x9f" "\x37\xab\x02\x81\x05\xde\x52\xe8\x43\xd1\xe3\xa0\x66\xb8\xf2\x50\x09" "\xb6\x91\xec\xa2\x0d\xbc\xe0\x03\x90\x10\xc8\x37\x91\xd1\xd7\x84\x7f" "\x51\x16\xb5\x44\xb9\xf3\x72\x66\x39\x13\xff\xa7\x89\xb2\x10\x26\x0b" "\xe4\x78\x0c\xa1\x1f\xdf\xed\x19\x1d\xf0\x7d\x52\xd6\x8d\xb9\x29\x63" "\xef\x8f\xbe\x85\x11\xae\x0c\xe4\xab\xce\x6a\xc1\x75\xd4\xb6\x51\x63" "\x98\x73\x78\x78\x83\xad\x79\x74\x47\x00\xe9\xeb\xbe\x4a\x0f\x56\x46" "\x75\xca\x9e\x56\xf4\xcc\xcc\xb9\xc7\x8f\x7c\xa8\x03\xd7\xc0\xf2\x66" "\xc3\xb5\xcb\x9b\x12\x0d\xd6\xe9\x26\xc5\xb8\x88\x08\xcc\x43\x53\x31" "\xa9\xa7\x5b\xb9\xf9\xca\x0f\x4d\x00\x56\xa1\x14\xda\xeb\x4c\x5e\x31" "\x71\xde\x79\xf9\x04\xf8\x5d\x1f\x7d\x0e\x91\x07\x00\xfd\xd8\x30\x51" "\xdb\xb6\xfc\xb2\x5b\x8d\x09\x96\x72\x93\x85\x5e\x13\xc0\xd4\xbb\x8e" "\xec\x9b\xf8\x1b\x53\x75\xdb\xe9\xec\xed\x05\xb5\xb6\x0c\xb8\xc9\xf1" "\x58\xf1\x8d\xed\xe7\x22\x46\x55\xe9\x01\x0c\x60\x31\x5b\x96\x45\xa7" "\x87\x67\xa5\xca\x8e\xbf\xd7\xd2\xd4\xe6\xae\x97\x06\x0a\xe9\xd5\x97" "\xe9\x5a\x5e\x62\x89\x7e\x9a\x38\x9d\x91\x43\xe6\xeb\x06\x9e\x03\x7c" "\x29\xb9\x75\x68\xc5\x90\x65\xc2\x93\xa5\x13\xbc\xd7\xfe\x78\x80\xf6" "\x67\x54\x64\xcb\xaa\x3b\x7d\x66\x0c\xe2\xe9\x76\x85\xd4\x11\x12\x8b" "\x72\xb6\xfa\x75\x0f\x3c\xec\xbb\x71\xd8\x62\x15\xb2\x6e\x66\xf6\x15" "\x51\x06\x9b\x4b\x16\xdf\xdc\x1f\x6e\x72\x5b\xd7\x5a\xa1\x87\x2c\xf6" "\xde\x46\x8d\xf0\x0b\xbc\x8b\xa4\xcc\x76\xd9\x71\xc6\xf1\xec\x9a\x1f" "\xbb\xa7\xb1\x1c\xbe\x38\x58\x59\x97\x2f\x41\xba\x4c\x2d\xd6\x30\x3f" "\xdb\x36\xd9\x82\x9c\x00\x7c\xba\x31\xa1\x50\xc2\xf0\x5d\x0a\xa8\x3f" "\xaf\x53\x36\xe0\x0b\x76\x9a\x5e\x41\x59\xa2\x2e\x38\x5e\x5f\x99\x12" "\xfa\x11\x39\x4a\x7d\x34\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x51\x5a\x1d\xf4\xbd\xe3\x7c\x43\xc5\x2c\xc1\xc1\xfd\x9d\x56\xb4" "\x6c\x3a\xd2\x40\xa7\x1f\x84\xc6\x42\x59\xfb\x0a\xdf\xd1\x24\x8f\xb8" "\xb8\x0d\xdc\x8b\x64\x1b\xdb\x68\x44\xee\xbe\x0d\xe4\x0e\xe1\x42\x0a" "\xc4\x20\xe0\xb1\xbc\x14\x4a\x36\xa8\x30\xf4\xa9\x15\xda\x40\x5e\x82" "\x9e\x12\x5e\x37\x2a\x05\x4c\x04\xf9\x5a\x30\x8f\x6a\x3a\xc1\x17\xf9" "\xc0\x0c\x08\x60\xf2\xb5\x14\x39\x1f\x69\x0e\xcd\x13\x82\x5d\xf0\x82" "\xa2\xfe\x91\x1f\xb2\x13\xbf\x01\xd4\x8f\xf7\xde\x7c\x76\xe4\x8a\x57" "\x5e\xda\x7d\x9b\x45\x92\xbe\xa4\xdc\x35\x64\x37\xfd\x36\xac\x83\x10" "\xb2\x6f\x6a\xeb\xae\x7c\x49\x72\x10\xbe\x33\xa4\x8c\xad\x1d\x55\x04" "\x92\x1a\xa0\x27\x4e\x19\x0d\x7a\xce\x37\x24\x32\x06\x9e\xb8\x06\x2a" "\x8e\xd7\x16\x57\x36\xd6\xde\x67\xc4\x3f\xd9\xa4\x28\xf1\xc1\x78\xf2" "\x89\x94\x9d\x93\xb8\x02\xac\x18\x76\x7b\x0d\xd3\x7f\x6b\x34\x96\x8e" "\xd6\x13\x3b\x50\x23\xd5\x45\x32\x51\x7d\x3b\x33\x01\x6b\x5e\xf7\xe8" "\xa0\x2e\xd6\x10\xb0\x47\x0a\x1b\xc4\x1c\x6c\x0b\xec\x66\xfe\x0a\xed" "\x6f\xdb\x25\x6e\x30\xa0\x7d\xe6\x6a\x57\x3d\x8b\x6d\xb3\x6f\xa7\xd3" "\x33\xca\xb7\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00", 863); memcpy( (void*)0x20000640, "\x78\x9c\xec\xdd\xbf\x6f\x1b\xe7\x19\x07\xf0\xef\xd1\x94\x6c\xba\x80" "\xa3\x24\x76\x62\x14\x01\x2a\xc4\x40\x5a\x54\xa8\x2d\x89\x50\x5a\x75" "\xa9\x5b\x14\x85\x86\xa0\x08\xd2\xa1\xb3\x60\xd3\x31\x61\x5a\x09\x24" "\xa6\x50\x82\xa2\x70\x7f\xaf\x1d\xf2\x07\xa4\x83\xb6\x4e\x05\xba\x1b" "\x48\xe7\x76\xcb\xaa\x31\x40\x81\x2e\x99\xb4\xb9\xb8\xe3\x51\x62\x2c" "\x59\xa1\x1c\xdb\xa4\xea\xcf\xc7\x78\xf9\xbe\x2f\xdf\xbb\xf7\x9e\x7b" "\x78\x77\xe4\x51\x30\x18\xe0\xb9\xb5\xb6\x90\xe6\xfd\x14\x59\x5b\x78" "\x6b\xbb\xec\xef\xee\xb4\x7b\xbb\x3b\xed\xb3\xf5\x70\x2f\x49\xd9\x6e" "\x24\xcd\x41\x95\x62\x23\x29\x3e\x4d\xae\x67\x50\x32\x33\x32\x5d\xf1" "\xa8\xed\x7c\xdc\x5d\x7d\xe7\xb3\x2f\x76\x3f\x1f\xf4\x9a\x75\xa9\x96" "\x6f\x1c\xb7\xde\x78\xee\xd5\x25\xf3\x49\xce\xd4\xf5\x61\x33\x8f\x35" "\xdf\x8d\x47\xce\x37\xae\x62\x7f\x0f\xcb\x84\x5d\x19\x26\x0e\x26\xed" "\xc1\x21\xf7\x4e\xb2\xfa\xd7\x3c\x6f\x81\x69\x50\x0c\xde\x37\x0f\x99" "\x4b\xce\x27\x39\x57\x7f\x0e\x48\x7d\x75\x68\x3c\xdb\xe8\x9e\xbc\x13" "\x5d\xe5\x00\x00\x00\xe0\x94\x7a\x61\x2f\x7b\xd9\xce\x85\x49\xc7\x01" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa7\x49\xfd\xfb\xff\x45\x5d" "\x1a\xc3\xf6\x7c\x8a\xe1\xef\xff\xcf\xd6\xcf\xa5\x6e\x9f\x6a\xf7\x27" "\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x01\xdf\xda\xcb\x5e\xb6\x73" "\x61\xd8\x7f\x50\x54\x7f\xf3\x7f\xbd\xea\x5c\xac\x1e\xbf\x91\x0f\xb2" "\x95\x4e\x36\x73\x35\xdb\x59\x4f\x3f\xfd\x6c\x66\x29\xc9\xdc\xc8\x44" "\xb3\xdb\xeb\xfd\xfe\xe6\xd2\x18\x6b\x2e\x1f\xb9\xe6\xf2\xb3\xd9\x5f" "\x00\x00\x00\x00\x00\x00\x00\xf8\x3f\xf5\xbb\xac\x1d\xfc\xfd\x1f\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x41\x91\x9c\x19" "\x54\x55\xb9\x38\x6c\xcf\xa5\xd1\x4c\x72\x2e\xc9\x6c\xb9\xdc\xbd\xe4" "\xdf\xc3\xf6\x69\x76\x7f\xd2\x01\x00\x00\x00\xc0\x33\xf0\xc2\x5e\xf6" "\xb2\x9d\x0b\xc3\xfe\x83\xa2\xba\xe7\x7f\xa5\xba\xef\x3f\x97\x0f\xb2" "\x91\x7e\xba\xe9\xa7\x97\x4e\x6e\x56\xdf\x05\x0c\xee\xfa\x1b\xbb\x3b" "\xed\xde\xee\x4e\xfb\x6e\x59\x0e\xcf\xfb\xe3\xff\x9e\x28\x8c\x6a\xc6" "\x0c\xbe\x7b\x38\x7a\xcb\x97\xab\x25\x5a\xb9\x95\x6e\xf5\xcc\xd5\xdc" "\xc8\x7b\xe9\xe5\x66\x1a\xd5\x9a\xa5\xcb\xc3\x78\x8e\x8e\xeb\xb7\x65" "\x4c\xc5\x8f\x6a\x63\x46\x76\xb3\xae\xcb\x3d\xff\x4b\x5d\x4f\x87\xb9" "\x2a\x23\x33\xfb\x19\x59\xac\x63\x2b\xb3\xf1\xe2\xf1\x99\x38\xe1\xab" "\xf3\xf0\x96\x96\xd2\xd8\xff\xe6\xe7\xe2\x53\xc8\xf9\xf9\xba\x2e\xf7" "\xe7\x4f\x53\x9d\xf3\xe5\x91\xa3\xef\x95\xe3\x33\x91\x7c\xfb\x1f\x7f" "\xfb\xe5\xed\xde\xc6\x9d\xdb\xb7\xb6\x16\xa6\x67\x97\x1e\xd3\xc3\x99" "\x68\x8f\x64\xe2\xd5\xe7\x2a\x13\x8b\x55\x26\x2e\xed\xf7\xd7\xf2\xb3" "\xfc\x22\x0b\x99\xcf\xdb\xd9\x4c\x37\xbf\xca\x7a\xfa\xe9\x64\x3e\x3f" "\xad\x5a\xeb\xf5\xf1\x5c\x3e\xce\x1d\x9f\xa9\xeb\x5f\xea\xbd\xfd\x55" "\x91\xcc\xd6\xaf\xcb\xe0\x2a\x7a\xb2\x98\x5e\xaf\xd6\xbd\x90\x6e\x7e" "\x9e\xf7\x72\x33\x9d\xbc\x59\xfd\x5b\xce\x52\xbe\x9f\x95\xac\x64\x75" "\xe4\x15\xbe\x34\xc6\x59\xdf\x38\xd9\x59\x7f\xe5\x3b\x75\xa3\x95\xe4" "\xcf\x75\x3d\x1d\xca\xbc\xbe\x38\x92\xd7\xd1\x6b\xee\x5c\x35\x36\xfa" "\xcc\x41\x96\x5e\x7a\x74\x96\x8a\xc7\xbc\x36\x36\xbf\x59\x37\xca\x6d" "\xfc\xbe\xae\xa7\xc3\xc3\x99\x58\x1a\xc9\xc4\xcb\xc7\x1f\x2f\x7f\x7d" "\x50\x3e\x6e\xf5\x36\xee\x6c\xde\x5e\x7f\x7f\xcc\xed\xbd\x51\xd7\x65" "\x2a\xff\x38\x55\xef\x12\xe5\xf1\xf2\x52\xf9\x62\x55\xbd\x2f\x1f\x1d" "\xe5\xd8\xcb\x47\x8e\x2d\x55\x63\x17\xf7\xc7\x1a\x87\xc6\x2e\xed\x8f" "\x7d\xd5\x99\x3a\x5b\x7f\x86\x3b\x3c\xd3\x72\x35\xf6\xea\x91\x63\xed" "\x6a\xec\xf2\xc8\xd8\x51\x9f\xb7\x00\x98\x7a\xe7\xbf\x7b\x7e\xb6\xf5" "\x9f\xd6\xbf\x5a\x9f\xb4\xfe\xd0\xba\xdd\x7a\xeb\xdc\x4f\xce\xfe\xe0" "\xec\x6b\xb3\x99\xf9\xe7\xcc\x0f\x9b\x8b\x67\xde\x68\xbc\x56\xfc\x3d" "\x9f\xe4\x37\x07\xf7\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xe3\xdb\xfa\xf0" "\xa3\x3b\xeb\xbd\x5e\x67\x73\xc2\x8d\xa2\xfe\x21\x9f\x69\x89\x47\x43" "\xe3\xf9\x6e\x4c\xfa\xca\x04\x3c\x6d\xd7\xfa\x77\xdf\xbf\xb6\xf5\xe1" "\x47\xdf\xeb\xde\x5d\x7f\xb7\xf3\x6e\x67\x63\x66\x65\x65\x75\x71\x75" "\xe5\xcd\xf6\xb5\x5b\xdd\x5e\x67\x71\xf0\x38\xe9\x28\x81\xa7\xe1\xe0" "\x4d\x7f\xd2\x91\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe3\x7a\x16" "\xff\x9d\x60\xd2\xfb\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\x6e\x6b\x0b\x69" "\xde\x4f\x91\xa5\xc5\xab\x8b\x65\x7f\x77\xa7\xdd\x2b\xcb\xb0\x7d\xb0" "\x64\x33\x49\x23\x49\xf1\xeb\xa4\xf8\x34\xb9\x9e\x41\xc9\xdc\xc8\x74" "\xc5\xa3\xb6\xf3\x71\x77\xf5\x9d\xcf\xbe\xd8\xfd\xfc\x60\xae\xe6\x70" "\xf9\xc6\x71\xeb\x8d\xe7\x5e\x5d\x32\x9f\xe4\x4c\x5d\x3f\xa9\xf9\x6e" "\x7c\xed\xf9\x8a\xfd\x3d\x2c\x13\x76\x65\x98\x38\x98\xb4\xff\x05\x00" "\x00\xff\xff\x13\xed\x09\xe0", 1503); syz_mount_image(0x20000600, 0x20000140, 0x2a00010, 0x20000d00, 3, 0x5df, 0x20000640); break; case 1: memcpy((void*)0x200001c0, "cgroup.controllers\000", 19); res = syscall(__NR_openat, 0xffffff9c, 0x200001c0ul, 0x275aul, 0ul); if (res != -1) r[0] = res; break; case 2: syscall(__NR_write, r[0], 0x20001980ul, 0x208e280ul); break; case 3: memcpy((void*)0x200001c0, "cgroup.controllers\000", 19); syscall(__NR_openat, 0xffffff9c, 0x200001c0ul, 0x275aul, 0ul); break; } } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); setup_sysctl(); for (procid = 0; procid < 6; procid++) { if (fork() == 0) { loop(); } } sleep(1000000); return 0; }