// https://syzkaller.appspot.com/bug?id=0b310bb35cd33dfdcc40ac061430b9bfb8630bf1 // 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 #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 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 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; } #define MAX_FDS 30 //% 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"); } 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_gadgetfs(); static void setup_binderfs(); static void setup_fusectl(); static void sandbox_common_mount_tmpfs(void) { write_file("/proc/sys/fs/mount-max", "100000"); if (mkdir("./syz-tmp", 0777)) exit(1); if (mount("", "./syz-tmp", "tmpfs", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot", 0777)) exit(1); if (mkdir("./syz-tmp/newroot/dev", 0700)) exit(1); unsigned bind_mount_flags = MS_BIND | MS_REC | MS_PRIVATE; if (mount("/dev", "./syz-tmp/newroot/dev", NULL, bind_mount_flags, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/proc", 0700)) exit(1); if (mount("syz-proc", "./syz-tmp/newroot/proc", "proc", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/selinux", 0700)) exit(1); const char* selinux_path = "./syz-tmp/newroot/selinux"; if (mount("/selinux", selinux_path, NULL, bind_mount_flags, NULL)) { if (errno != ENOENT) exit(1); if (mount("/sys/fs/selinux", selinux_path, NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); } if (mkdir("./syz-tmp/newroot/sys", 0700)) exit(1); if (mount("/sys", "./syz-tmp/newroot/sys", 0, bind_mount_flags, NULL)) exit(1); if (mount("/sys/kernel/debug", "./syz-tmp/newroot/sys/kernel/debug", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/sys/fs/smackfs", "./syz-tmp/newroot/sys/fs/smackfs", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/proc/sys/fs/binfmt_misc", "./syz-tmp/newroot/proc/sys/fs/binfmt_misc", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mkdir("./syz-tmp/newroot/syz-inputs", 0700)) exit(1); if (mount("/syz-inputs", "./syz-tmp/newroot/syz-inputs", NULL, bind_mount_flags | MS_RDONLY, NULL) && errno != ENOENT) exit(1); if (mkdir("./syz-tmp/pivot", 0777)) exit(1); if (syscall(SYS_pivot_root, "./syz-tmp", "./syz-tmp/pivot")) { if (chdir("./syz-tmp")) exit(1); } else { if (chdir("/")) exit(1); if (umount2("./pivot", MNT_DETACH)) exit(1); } if (chroot("./newroot")) exit(1); if (chdir("/")) exit(1); setup_gadgetfs(); setup_binderfs(); setup_fusectl(); } static void setup_gadgetfs() { if (mkdir("/dev/gadgetfs", 0777)) { } if (mount("gadgetfs", "/dev/gadgetfs", "gadgetfs", 0, NULL)) { } } static void setup_fusectl() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void setup_binderfs() { if (mkdir("/dev/binderfs", 0777)) { } if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); if (getppid() == 1) exit(1); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = (200 << 20); setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 136 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 128 << 20; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); if (unshare(CLONE_NEWNS)) { } if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } typedef struct { const char* name; const char* value; } sysctl_t; static const sysctl_t sysctls[] = { {"/proc/sys/kernel/shmmax", "16777216"}, {"/proc/sys/kernel/shmall", "536870912"}, {"/proc/sys/kernel/shmmni", "1024"}, {"/proc/sys/kernel/msgmax", "8192"}, {"/proc/sys/kernel/msgmni", "1024"}, {"/proc/sys/kernel/msgmnb", "1024"}, {"/proc/sys/kernel/sem", "1024 1048576 500 1024"}, }; unsigned i; for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++) write_file(sysctls[i].name, sysctls[i].value); } static int wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, __WALL) != pid) { } return WEXITSTATUS(status); } static void drop_caps(void) { struct __user_cap_header_struct cap_hdr = {}; struct __user_cap_data_struct cap_data[2] = {}; cap_hdr.version = _LINUX_CAPABILITY_VERSION_3; cap_hdr.pid = getpid(); if (syscall(SYS_capget, &cap_hdr, &cap_data)) exit(1); const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE); cap_data[0].effective &= ~drop; cap_data[0].permitted &= ~drop; cap_data[0].inheritable &= ~drop; if (syscall(SYS_capset, &cap_hdr, &cap_data)) exit(1); } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid != 0) return wait_for_loop(pid); sandbox_common(); drop_caps(); if (unshare(CLONE_NEWNET)) { } write_file("/proc/sys/net/ipv4/ping_group_range", "0 65535"); sandbox_common_mount_tmpfs(); loop(); exit(1); } #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")) { } } static void close_fds() { for (int fd = 3; fd < MAX_FDS; fd++) close(fd); } 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(); close_fds(); 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_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x200000000180, "nilfs2\000", 7); memcpy((void*)0x200000000e00, "./file0\000", 8); memcpy((void*)0x200000000100, "errors=continue", 15); *(uint8_t*)0x20000000010f = 0x2c; memcpy((void*)0x200000000110, "nodiscard", 9); *(uint8_t*)0x200000000119 = 0x2c; memcpy((void*)0x20000000011a, "errors=continue", 15); *(uint8_t*)0x200000000129 = 0x2c; memcpy((void*)0x20000000012a, "order=relaxed", 13); *(uint8_t*)0x200000000137 = 0x2c; memcpy((void*)0x200000000138, "order=relaxed", 13); *(uint8_t*)0x200000000145 = 0x2c; memcpy((void*)0x200000000146, "order=relaxed", 13); *(uint8_t*)0x200000000153 = 0x2c; memcpy((void*)0x200000000154, "discard", 7); *(uint8_t*)0x20000000015b = 0x2c; memcpy((void*)0x20000000015c, "norecovery", 10); *(uint8_t*)0x200000000166 = 0x2c; memcpy((void*)0x200000000167, "nobarrier", 9); *(uint8_t*)0x200000000170 = 0x2c; *(uint8_t*)0x200000000171 = 0; memcpy( (void*)0x200000000e80, "\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); syz_mount_image(/*fs=*/0x200000000180, /*dir=*/0x200000000e00, /*flags=*/0, /*opts=*/0x200000000100, /*chdir=*/1, /*size=*/0xd99, /*img=*/0x200000000e80); memcpy((void*)0x200000000180, "./bus\000", 6); syscall(__NR_open, /*file=*/0x200000000180ul, /*flags=O_TRUNC|O_SYNC|O_NOCTTY|O_NOATIME|O_LARGEFILE|O_CREAT|0x3e*/ 0x14937eul, /*mode=S_IXOTH|S_IWGRP|S_IRUSR*/ 0x111ul); memcpy((void*)0x200000000280, "/dev/loop", 9); *(uint8_t*)0x200000000289 = 0x30; *(uint8_t*)0x20000000028a = 0; memcpy((void*)0x200000000140, "./bus\000", 6); syscall(__NR_mount, /*src=*/0x200000000280ul, /*dst=*/0x200000000140ul, /*type=*/0ul, /*flags=MS_REC|MS_BIND*/ 0x5000ul, /*data=*/0ul); memcpy((void*)0x200000000000, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x200000000000ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[0] = res; *(uint64_t*)0x200000000540 = 0; *(uint64_t*)0x200000000548 = 0; *(uint64_t*)0x200000000550 = 0; *(uint64_t*)0x200000000558 = 0; *(uint64_t*)0x200000000560 = 0x8005; *(uint32_t*)0x200000000568 = 0; *(uint32_t*)0x20000000056c = 0; *(uint32_t*)0x200000000570 = 0x15; *(uint32_t*)0x200000000574 = 0; memcpy((void*)0x200000000578, "\xef\x35\x9f\x41\x3b\xb9\x38\x52\xf7\xd6\xa4\xae\x6d\xdd\xfb\xd1\xce" "\x5d\x29\xc2\xee\x5e\x5c\xa9\x00\x0f\xf8\xee\x09\xe7\x37\xff\x0e\xdf" "\x11\x0f\xf4\x11\x76\x39\xc2\xeb\x4b\x78\xc6\x60\xe6\x77\xdf\x70\x19" "\x05\xb9\xaa\xfa\xb4\xaf\xaa\xf7\x55\xa3\xf6\xa0\x04", 64); memcpy((void*)0x2000000005b8, "\x03\x6c\x47\xc6\x78\x08\x20\xd1\xcb\xf7\x96\x6d\x61\xfd\xcf\x33\x52" "\x63\xbd\x9b\xff\xbc\xc2\x54\x2d\xed\x71\x03\x82\x59\xca\x17\x1c\xe1" "\xa3\x11\xef\x54\xec\x32\xd7\x1e\x14\xef\x3d\xc1\x77\xe9\xb4\x8b\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 64); memcpy((void*)0x2000000005f8, "\xf2\x83\x59\x73\x8e\x22\x9a\x4c\x66\x81\x00\x00\x00\x00\x00\xd3\x00" "\xe6\xd6\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", 32); *(uint64_t*)0x200000000618 = 0x200; *(uint64_t*)0x200000000620 = 0; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x4c04, /*arg=*/0x200000000540ul); } 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; use_temporary_dir(); do_sandbox_none(); return 0; }