// https://syzkaller.appspot.com/bug?id=9355b2f31f8587c175c72a8447ac448f2bd2bb43 // 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_bpf #define __NR_bpf 321 #endif #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; \ }) 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 use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } 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; } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW; retry: while (umount2(dir, umount_flags) == 0) { } dp = opendir(dir); if (dp == NULL) { if (errno == EMFILE) { exit(1); } exit(1); } struct dirent* ep = 0; while ((ep = readdir(dp))) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; char filename[FILENAME_MAX]; snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); while (umount2(filename, umount_flags) == 0) { } struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } int i; for (i = 0;; i++) { if (unlink(filename) == 0) break; if (errno == EPERM) { int fd = open(filename, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno != EBUSY || i > 100) exit(1); if (umount2(filename, umount_flags)) exit(1); } } closedir(dp); for (int i = 0;; i++) { if (rmdir(dir) == 0) break; if (i < 100) { if (errno == EPERM) { int fd = open(dir, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno == EBUSY) { if (umount2(dir, umount_flags)) exit(1); continue; } if (errno == ENOTEMPTY) { if (iter < 100) { iter++; goto retry; } } } exit(1); } } 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"); if (symlink("/dev/binderfs", "./binderfs")) { } } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 5; 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) + (call == 1 ? 500 : 0) + (call == 2 ? 500 : 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++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: // syz_mount_image$nilfs2 arguments: [ // fs: ptr[in, buffer] { // buffer: {6e 69 6c 66 73 32 00} (length 0x7) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // flags: mount_flags = 0x94 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {00 01 de f4 77 47 74 36 6f 0b 8a 20 db 13 db // 64 e8 5f c9 32 2c 3f e0 18 b9 1f f1 29 1b 4f 4c 56 de 7e 45 43 // f4 98 18 e1 30 7d 98 d0 9d aa 1e 2a 7d bf 88 00 3e 94 01 dc 73 // aa d0 b7 db b5 68 55 65 c7 82 5b a8 34 06 21 fa ea e9 2a be d1 // 9c 52 4a b0 6c 43 03 25 8d 25 37 22 e1 59 64 2a f4 47 ae b0 96 // c6 a2 6d 34 5d 82 f2 92 51 63 33 1b 0e 91 57 44 1a 9c 61 dd 10 // 51 d3 b9 70 f9 ac 12 f5 97 5c f1 ad 4e 45 ac ef 1a 54 92 1c 49 // 2a 77 bc b1 85 8b 68 75 8e d3 39 60 8b 8e 43 c7 33 21 9f 1f 9e // 0b 86 78 40 f8 21 e0 3b c0 e8 a4 97 c4 d5 dd e4 36 00 00 90 a3 // 97 63 7d ed b2 f3} (length 0xbd) // } // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0xd99 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0xd99) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000dc0, "nilfs2\000", 7)); NONFAILING(memcpy((void*)0x200000000400, "./file0\000", 8)); NONFAILING(memcpy( (void*)0x200000003280, "\x00\x01\xde\xf4\x77\x47\x74\x36\x6f\x0b\x8a\x20\xdb\x13\xdb\x64\xe8" "\x5f\xc9\x32\x2c\x3f\xe0\x18\xb9\x1f\xf1\x29\x1b\x4f\x4c\x56\xde\x7e" "\x45\x43\xf4\x98\x18\xe1\x30\x7d\x98\xd0\x9d\xaa\x1e\x2a\x7d\xbf\x88" "\x00\x3e\x94\x01\xdc\x73\xaa\xd0\xb7\xdb\xb5\x68\x55\x65\xc7\x82\x5b" "\xa8\x34\x06\x21\xfa\xea\xe9\x2a\xbe\xd1\x9c\x52\x4a\xb0\x6c\x43\x03" "\x25\x8d\x25\x37\x22\xe1\x59\x64\x2a\xf4\x47\xae\xb0\x96\xc6\xa2\x6d" "\x34\x5d\x82\xf2\x92\x51\x63\x33\x1b\x0e\x91\x57\x44\x1a\x9c\x61\xdd" "\x10\x51\xd3\xb9\x70\xf9\xac\x12\xf5\x97\x5c\xf1\xad\x4e\x45\xac\xef" "\x1a\x54\x92\x1c\x49\x2a\x77\xbc\xb1\x85\x8b\x68\x75\x8e\xd3\x39\x60" "\x8b\x8e\x43\xc7\x33\x21\x9f\x1f\x9e\x0b\x86\x78\x40\xf8\x21\xe0\x3b" "\xc0\xe8\xa4\x97\xc4\xd5\xdd\xe4\x36\x00\x00\x90\xa3\x97\x63\x7d\xed" "\xb2\xf3", 189)); NONFAILING(memcpy( (void*)0x200000006900, "\x78\x9c\xec\xdd\x4b\x6f\x5c\xd5\x1d\x00\xf0\x73\xc7\x9e\x38\x2f\x1a" "\x87\x98\xc6\x4d\xd3\xd8\x25\xa5\xb8\x8f\xd8\x24\x58\xa5\xbb\x1a\x29" "\x5d\xa0\x4a\xa8\x12\x9f\x00\xa5\x81\x86\x1a\xfa\x08\x5d\x80\x82\x94" "\xb0\xe8\xb6\x91\x10\x1f\xa0\x88\x7d\x17\x7d\x66\x81\x14\xb1\x4a\xc5" "\xa6\x55\xbf\x00\x62\xd5\x4d\x8a\x90\x68\x1b\x55\x02\x23\xdb\xe7\x8c" "\xc7\xff\xcc\xe8\xce\x38\xb6\xc7\xe3\xf9\xfd\xa4\x3b\x67\xee\xfd\x9f" "\x7b\xcf\x39\xf3\xb8\x73\xe7\xbe\x4e\x02\x46\x56\x63\xed\x71\x71\x71" "\xba\x4a\xe9\xed\x5b\x6f\x5d\xbc\x37\x33\xfe\xbf\xd5\x29\x33\xad\x1c" "\xb3\x6b\x8f\xe3\x79\x6c\x29\xa5\xd4\x6c\xcd\x97\xd2\x64\x58\xde\xd2" "\xc4\x7a\xfa\xd9\x27\xd7\x2e\xb5\xa7\x9f\xe7\xb4\x4a\x17\x52\x95\xaa" "\xd6\xf4\xf4\xec\xdd\xd6\xbc\x47\x52\x4a\xd7\xd3\x6c\xba\x9d\x26\xd3" "\x73\x1f\x9f\xbc\xf9\xd2\x07\xcf\x2c\xbf\x77\xe2\xc6\x89\x8b\x6f\xcc" "\xdd\xd9\x99\xd6\x03\x00\xc0\x68\xb9\xf7\xa3\x77\x7f\xf9\xb7\xc7\x7f" "\x78\xed\xf8\xff\x7f\x7f\x66\x29\x4d\xb4\xa6\x97\xed\xf3\xa5\x3c\x7e" "\x34\x6f\xf7\x2f\x55\xeb\xe3\x39\x69\xfd\x0f\xa8\xda\xd2\xaa\x6d\xbc" "\x38\x10\xf2\x8d\xe7\xa1\x11\xf2\x8d\x75\xc8\xd7\x5e\x4e\x33\xe4\x1b" "\xef\x52\xfe\x81\xb0\xdc\x66\x97\x7c\x13\x35\xe5\x8f\xb5\x4d\xeb\xd4" "\x6e\x18\x66\x1b\xff\xe3\xab\xc6\xfc\xa6\xf1\x46\x63\x7e\x7e\xfd\x3f" "\xf9\xaa\x0f\xc7\x0e\x54\xf3\xaf\x5c\x59\x7e\xe1\xea\x80\x2a\x0a\x6c" "\xbb\x4f\x67\xf2\x2e\x3e\x83\xc1\x30\x72\xc3\xca\xb1\x41\xaf\x81\x00" "\xd6\xc5\xe3\x86\xf7\xb9\x1e\xf7\x2c\x3c\x98\xd6\xd2\xc6\x7b\x2b\xff" "\xee\xd3\x8d\xce\xf3\xc3\x36\xd8\xed\xcf\xbf\xf2\x87\xab\xfc\x77\x6f" "\x58\xe3\xb0\x7d\xf6\xeb\xa7\xa9\xb4\xab\x7c\x8f\x8e\xe6\xf1\x78\x1c" "\x61\x3c\xcc\xd7\xef\xf7\xbf\x2c\x2f\x1e\x8f\x68\xf6\x58\xcf\x6e\xc7" "\x11\x86\xe5\xf8\x42\xb7\x7a\x8e\xed\x72\x3d\xb6\xaa\x5b\xfd\xe3\xe7" "\x62\xbf\xfa\x5a\x4e\xcb\xeb\x70\x26\xc4\xdb\xbf\x3f\xf1\x3d\x1d\x96" "\xf7\x18\xe8\xec\x9e\xfd\xff\x06\xc3\xc8\x0e\x2b\x83\x5e\x01\x01\x7b" "\x56\x3c\x6f\x6e\x25\x2b\xf1\x78\x5e\x5f\x8c\x4f\xd4\xc4\x0f\xd6\xc4" "\x0f\xd5\xc4\x0f\xd7\xc4\x8f\xd4\xc4\x61\x94\xfd\xe1\xd5\xdf\xa6\x9b" "\xd5\xc6\xff\xfc\xf8\x9f\xbe\xdf\xfd\x61\x65\x3f\xdb\x43\x39\xfd\x52" "\x9f\xf5\x89\xfb\x23\xfb\x2d\x3f\x9e\xf7\xdb\xaf\x07\x2d\x3f\x9e\x4f" "\x0c\x7b\xda\xdc\x7f\x4f\x7f\xfa\xeb\xdb\x7f\x8f\xe7\xff\x7f\x1e\xce" "\xff\x3f\x9b\x7f\x4b\x27\xf3\x0a\xa2\xec\x2f\x8c\xfb\xd5\x5b\xe7\xfe" "\x87\x0b\x83\x1b\x5d\xf2\x3d\x1c\xaa\xf3\x50\x87\xfc\x6b\xcf\xa7\x36" "\xe7\xab\xa6\x36\x96\x93\xda\xd6\x33\xf7\xd5\x63\x7a\xf3\x7c\xc7\xba" "\xe5\x3b\xbd\x39\xdf\x64\xc8\x77\x38\x6f\x8b\x1c\x0c\xf5\x8d\xdb\x27" "\x87\xc3\x7c\x65\xfb\xa3\xac\x57\xcb\xeb\x35\x1e\xda\xdb\x0c\xed\x38" "\x10\xea\x51\xde\x99\xe3\x39\x3d\x18\xda\x73\xbc\x5b\xbb\xc2\x8e\xec" "\x03\x21\x5f\x33\x0f\x27\x42\xbb\xa6\x42\xbb\x1e\x09\xf3\x7d\x39\xb4" "\xab\x9a\xde\xdc\xae\xb8\xff\xbc\xd4\xe7\x64\x98\x1e\x8f\x93\x94\x7c" "\xe1\x6d\xbb\xef\x77\x29\xbe\x17\xf1\xba\x8c\x47\x73\xfa\x66\x4e\xdf" "\xc9\xe9\xfb\x39\xfd\xa8\x43\xb9\xa3\xa8\x7c\x1e\xbb\x9d\xff\x5f\x3e" "\x9f\xd3\xa9\x59\xbd\x70\x65\xf9\xf2\x13\x79\xbc\x7c\x4e\xef\x8c\x35" "\x27\x56\xa7\x9f\xdf\xe5\x7a\x03\x0f\xae\xd7\xeb\x7f\xa6\xd3\xe6\xeb" "\x7f\x8e\xb6\xa6\x37\x1b\xed\xeb\x85\x63\x1b\xd3\xab\xf6\xf5\xc2\x64" "\x98\x7e\xa1\xcb\xf4\x27\xf3\x78\xf9\x3d\xfb\xe9\xd8\xa1\xb5\xe9\xf3" "\x97\x7e\xbe\xfc\x93\xed\x6e\x3c\x8c\xb8\xab\xaf\xbd\xfe\xb3\xe7\x97" "\x97\x2f\xff\xca\x13\x4f\x3c\xf1\xa4\xf5\x64\xd0\x6b\x26\x60\xa7\x2d" "\xbc\xfa\xf2\x2f\x16\xae\xbe\xf6\xfa\xb9\x2b\x2f\x3f\xff\xe2\xe5\x17" "\x2f\xbf\x72\xfe\x89\xef\x7f\xef\xc9\xa7\x9e\x5a\x5c\x58\xdb\xaa\x5f" "\x68\xdf\xb6\x07\xf6\x97\x8d\x1f\xfd\x41\xd7\x04\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\xe8\x59\x75\xa8\xf3\xe4\x9c\xd6\xdd\xdf\xb6\x5c\x4f" "\x5e\xae\x4f\x8f\xd7\xc7\x33\x1c\xca\xfb\x56\x3e\x0d\xe5\x3e\x06\xe5" "\xfa\xcf\x6e\xf7\x75\x29\xd7\x6f\x1e\xdf\x85\x3a\xb2\xfd\x76\xe3\x72" "\xa2\x41\xb7\x11\xe8\xec\xdf\xee\xff\x6b\x30\x8c\xec\xb0\xb2\xe2\x2e" "\xfe\xc0\xde\x30\xe8\xfe\xff\xca\x7d\x0f\x4b\x7a\xf4\xdc\x3f\x8f\xaf" "\x0e\x25\xdb\xdd\xa7\x37\xaf\x2f\xe3\xfd\x0b\xe1\x41\xec\xf5\xfe\xe7" "\x94\xbf\xbf\xfa\xff\x6b\xf5\x7f\xd5\xf3\xfa\x2f\xf4\x98\x35\xb9\xb5" "\x72\xff\x78\xef\xd0\x3f\xda\x8a\x4d\xa7\x7a\x2d\x3f\xb6\xbf\xdc\x07" "\x76\xaa\xbf\xf2\xff\x94\xcb\x2f\xad\x79\x2c\xf5\x56\xfe\xca\xef\x42" "\xf9\xf1\x46\xa5\x3d\xfa\x73\x28\xff\x70\x8f\xe5\xdf\xd7\xfe\xd3\x5b" "\x2b\xff\x2f\xb9\xfc\xf2\xb2\xcd\x9d\xed\xb5\xfc\xf5\x1a\x57\x8d\xcd" "\xf5\x88\xfb\x8d\xcb\x7d\x00\xe3\x7e\xe3\xe2\xaf\xa1\xfd\xe5\xde\x7e" "\x7d\xb7\x7f\x8b\x1d\xb5\xdd\xca\xe5\xc3\x28\x1b\x96\x7e\x26\xfb\x35" "\x2c\xfd\x7f\x76\x53\x96\x5b\xd6\x83\x79\xf5\xdc\x3a\x4e\x57\xee\xbf" "\x1d\xfb\x3b\xe8\xb7\xfe\xe5\xbe\xdf\xe5\x77\xe0\x91\xb0\xfc\xaa\xe6" "\xf7\x4d\xff\x9f\xc3\xad\xae\xff\xcf\xf2\xf9\x5b\xd0\xff\x27\xec\x3b" "\x1f\x3a\xfe\x67\x30\x8c\xec\xb0\xb2\xb2\x32\xd0\xae\x4f\x46\xb5\xdf" "\x95\xbd\x62\xd0\xaf\xff\xa0\xb7\x21\x07\x5d\xfe\xa0\x5f\xff\x3a\xb1" "\xff\xcf\xf8\x7f\x29\xf6\xff\x19\xe3\xb1\xff\xcf\x18\x8f\xfd\x7f\xc6" "\x78\xec\x5f\x2b\xc6\x63\xff\x9f\xf1\xf5\x8c\xfd\x7f\xc6\xf8\xc9\xb0" "\xdc\xd8\x3f\xe8\x74\x4d\xfc\x2b\x35\xf1\x53\x35\xf1\xaf\xd6\xc4\x4f" "\xd7\xc4\xe3\xff\xb7\x18\x9f\xad\x89\x9f\xa9\x89\xcf\xd4\xc4\x1f\xae" "\x89\x3f\x5a\x13\x3f\x5b\x13\xff\x46\x4d\xfc\xb1\x9a\xf8\xe3\x35\xf1" "\xb9\x9a\xf8\x7e\xf7\xf5\x9c\x8e\x6a\xfb\x61\x94\xc5\x7e\x23\x7d\xff" "\x61\x74\x94\xe3\x3f\xdd\xbe\xff\x53\x35\x71\x60\x78\xc5\x7e\x9d\xe3" "\xf7\xfb\x9b\x35\x71\x60\x78\x95\xf3\x3c\x7c\xbf\x61\x04\x55\x9d\xef" "\xd8\x11\xf7\xb7\x97\xfd\xb8\x6f\xe6\xf4\x9d\x9c\xbe\x9f\xd3\x8f\x76" "\xac\x82\xec\x86\x6f\xe5\xf4\xdb\x39\xfd\x4e\x4e\xbf\x9b\xd3\x73\x39" "\x9d\xcf\xe9\x42\x4e\xf5\x0d\x39\xdc\x7e\xf3\xaf\x53\x67\x6e\x56\x1b" "\xe7\xf9\x1d\x0b\xf1\x5e\xcf\x27\x8d\xd7\x03\xc4\xfb\xc4\x9c\xef\xb1" "\x3e\xf1\xf8\x5c\xbf\xe7\xb3\x9e\xec\xb1\x9c\x9d\x2a\x7f\x8b\x97\x83" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x0c\x8d\xc6\xda\xe3\xe2\xe2\x74\x95\xd2\xdb" "\xb7\xde\xba\xf8\x9f\xa9\x1f\xfc\x78\x75\xca\x4c\x2b\xc7\xec\xda\xe3" "\x78\x1e\x5b\x4a\x29\x35\x53\x4a\x55\x1e\x1f\x0f\xcb\xbb\x3e\xb1\x9e" "\x7e\xf6\xc9\xb5\x4b\x9d\xd2\x2a\x5d\x58\x7b\x2c\xe3\xe9\xd9\xbb\xad" "\x79\x8f\xac\xce\x9f\x66\xd3\xed\x34\x99\x9e\xfb\xf8\xe4\xcd\x97\x3e" "\x78\x66\xf9\xbd\x13\x37\x4e\x5c\x7c\x63\xee\xce\xce\xb4\x1e\x00\x00" "\x00\x46\xc3\x17\x01\x00\x00\xff\xff\x31\xa9\xe5\xc1", 3481)); NONFAILING( syz_mount_image(/*fs=*/0x200000000dc0, /*dir=*/0x200000000400, /*flags=MS_SYNCHRONOUS|MS_NODEV|MS_DIRSYNC*/ 0x94, /*opts=*/0x200000003280, /*chdir=*/1, /*size=*/0xd99, /*img=*/0x200000006900)); break; case 1: // bpf$BPF_PROG_RAW_TRACEPOINT_LOAD arguments: [ // cmd: const = 0x5 (8 bytes) // arg: ptr[in, bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], // const[0, int32], const[0, int32], const[0, int32]]] { // bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], const[0, // int32], const[0, int32], const[0, int32]] { // type: bpf_raw_tracepoint_prog_types = 0x18 (4 bytes) // ninsn: bytesize8 = 0x5 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {18 01 00 00 21 00 00 00 00 00 00 00 3b 81 // 00 00 85 00 00 00 6d 00 00 00 07 00 00 00 00 00 00 00 95} // (length 0x21) // } // } // } // license: ptr[in, buffer] { // buffer: {73 79 7a 6b 61 6c 6c 65 72 00} (length 0xa) // } // loglev: int32 = 0x0 (4 bytes) // logsize: len = 0x0 (4 bytes) // log: nil // kern_version: bpf_kern_version = 0x0 (4 bytes) // flags: bpf_prog_load_flags = 0x0 (4 bytes) // prog_name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00} (length 0x10) prog_ifindex: ifindex (resource) // expected_attach_type: const = 0x2 (4 bytes) // btf_fd: fd_btf (resource) // func_info_rec_size: const = 0x8 (4 bytes) // func_info: nil // func_info_cnt: len = 0x0 (4 bytes) // line_info_rec_size: const = 0x10 (4 bytes) // line_info: nil // line_info_cnt: len = 0x0 (4 bytes) // attach_btf_id: const = 0x0 (4 bytes) // attach_prog_fd: const = 0x0 (4 bytes) // core_relo_cnt: len = 0x0 (4 bytes) // fd_array: nil // core_relos: nil // core_relo_rec_size: const = 0x10 (4 bytes) // log_true_size: int32 = 0x0 (4 bytes) // prog_token_fd: union // _bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], const[0, // int32], const[0, int32], const[0, int32]]_prog_token_fd_wrapper { // void: buffer: {} (length 0x0) // } // pad: union _bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, // int32], const[0, int32], const[0, int32], const[0, // int32]]_pad_wrapper { // value: const = 0x0 (4 bytes) // } // } // } // size: len = 0x80 (8 bytes) // ] // returns fd_bpf_prog_raw_tracepoint NONFAILING(*(uint32_t*)0x200000000180 = 0x18); NONFAILING(*(uint32_t*)0x200000000184 = 5); NONFAILING(*(uint64_t*)0x200000000188 = 0x200000000280); NONFAILING(memcpy( (void*)0x200000000280, "\x18\x01\x00\x00\x21\x00\x00\x00\x00\x00\x00\x00\x3b\x81\x00\x00\x85" "\x00\x00\x00\x6d\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x95", 33)); NONFAILING(*(uint64_t*)0x200000000190 = 0x200000000040); NONFAILING(memcpy((void*)0x200000000040, "syzkaller\000", 10)); NONFAILING(*(uint32_t*)0x200000000198 = 0); NONFAILING(*(uint32_t*)0x20000000019c = 0); NONFAILING(*(uint64_t*)0x2000000001a0 = 0); NONFAILING(*(uint32_t*)0x2000000001a8 = 0); NONFAILING(*(uint32_t*)0x2000000001ac = 0); NONFAILING(memset((void*)0x2000000001b0, 0, 16)); NONFAILING(*(uint32_t*)0x2000000001c0 = 0); NONFAILING(*(uint32_t*)0x2000000001c4 = 2); NONFAILING(*(uint32_t*)0x2000000001c8 = -1); NONFAILING(*(uint32_t*)0x2000000001cc = 8); NONFAILING(*(uint64_t*)0x2000000001d0 = 0); NONFAILING(*(uint32_t*)0x2000000001d8 = 0); NONFAILING(*(uint32_t*)0x2000000001dc = 0x10); NONFAILING(*(uint64_t*)0x2000000001e0 = 0); NONFAILING(*(uint32_t*)0x2000000001e8 = 0); NONFAILING(*(uint32_t*)0x2000000001ec = 0); NONFAILING(*(uint32_t*)0x2000000001f0 = 0); NONFAILING(*(uint32_t*)0x2000000001f4 = 0); NONFAILING(*(uint64_t*)0x2000000001f8 = 0); NONFAILING(*(uint64_t*)0x200000000200 = 0); NONFAILING(*(uint32_t*)0x200000000208 = 0x10); NONFAILING(*(uint32_t*)0x20000000020c = 0); NONFAILING(*(uint32_t*)0x200000000210 = 0); res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000180ul, /*size=*/0x80ul); if (res != -1) r[0] = res; break; case 2: // bpf$BPF_RAW_TRACEPOINT_OPEN arguments: [ // cmd: const = 0x11 (8 bytes) // arg: ptr[in, bpf_raw_tracepoint] { // bpf_raw_tracepoint { // name: ptr[in, buffer] { // buffer: {6e 69 6c 66 73 32 5f 74 72 61 6e 73 61 63 74 69 6f 6e // 5f 74 72 61 6e 73 69 74 69 6f 6e 00} (length 0x1e) // } // prog_fd: fd_bpf_prog_raw_tracepoint (resource) // pad: const = 0x0 (4 bytes) // cookie: int64 = 0xc0b (8 bytes) // } // } // size: len = 0x18 (8 bytes) // ] // returns fd_perf_base NONFAILING(*(uint64_t*)0x200000000240 = 0x200000000080); NONFAILING( memcpy((void*)0x200000000080, "nilfs2_transaction_transition\000", 30)); NONFAILING(*(uint32_t*)0x200000000248 = r[0]); NONFAILING(*(uint32_t*)0x20000000024c = 0); NONFAILING(*(uint64_t*)0x200000000250 = 0xc0b); syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x200000000240ul, /*size=*/0x18ul); break; case 3: // rename arguments: [ // old: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // new: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 2f 66 69 6c 65 30 00} (length 0xe) // } // ] NONFAILING(memcpy((void*)0x200000000040, "./file1\000", 8)); NONFAILING(memcpy((void*)0x200000000180, "./file0/file0\000", 14)); syscall(__NR_rename, /*old=*/0x200000000040ul, /*new=*/0x200000000180ul); break; case 4: // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {63 70 75 2e 73 74 61 74 00} (length 0x9) // } // flags: const = 0x275a (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd NONFAILING(memcpy((void*)0x200000000040, "cpu.stat\000", 9)); syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000040ul, /*flags=*/0x275a, /*mode=*/0); 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); const char* reason; (void)reason; install_segv_handler(); for (procid = 0; procid < 5; procid++) { if (fork() == 0) { use_temporary_dir(); loop(); } } sleep(1000000); return 0; }