// https://syzkaller.appspot.com/bug?id=fa3539b02d4ae06b7f5a7d5d715e919d6b454744 // 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 #ifndef __NR_bpf #define __NR_bpf 321 #endif 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; } #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off)) #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \ *(type*)(addr) = \ htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \ (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len)))) 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 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/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_binderfs(); setup_fusectl(); } 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)) { } if (symlink("/dev/binderfs", "./binderfs")) { } } 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); } 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 setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } 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++) { int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { 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; } } } uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0ul, /*flags=*/0, /*mode=*/0); syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0ul, /*size=*/0x48ul); *(uint32_t*)0x20000240 = 2; *(uint32_t*)0x20000244 = 4; *(uint32_t*)0x20000248 = 8; *(uint32_t*)0x2000024c = 1; *(uint32_t*)0x20000250 = 0x80; *(uint32_t*)0x20000254 = 0; *(uint32_t*)0x20000258 = 0; memset((void*)0x2000025c, 0, 16); *(uint32_t*)0x2000026c = 0; *(uint32_t*)0x20000270 = 0; *(uint32_t*)0x20000274 = 0; *(uint32_t*)0x20000278 = 0; *(uint32_t*)0x2000027c = 0; *(uint64_t*)0x20000280 = 0; *(uint32_t*)0x20000288 = 0; *(uint32_t*)0x2000028c = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x20000240ul, /*size=*/0x48ul); if (res != -1) r[0] = res; syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0xc); *(uint64_t*)0x20000140 = 8; *(uint64_t*)0x20000148 = 0x93; syscall(__NR_prlimit64, /*pid=*/0, /*res=RLIMIT_RTPRIO*/ 0xeul, /*new=*/0x20000140ul, /*old=*/0ul); *(uint32_t*)0x20000080 = 6; syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_RR*/ 2ul, /*prio=*/0x20000080ul); syscall(__NR_prctl, /*option=*/0x3eul, /*cmd=*/1ul, /*pid=*/0, /*type=*/0ul, /*uaddr=*/0ul); syscall(__NR_socketpair, /*domain=*/1ul, /*type=SOCK_DGRAM*/ 2ul, /*proto=*/0, /*fds=*/0ul); syscall(__NR_sendmmsg, /*fd=*/-1, /*mmsg=*/0x20000000ul, /*vlen=*/0x651ul, /*f=*/0ul); syscall(__NR_fcntl, /*fd=*/-1, /*cmd=*/8ul, /*pid=*/0); *(uint32_t*)0x200007c0 = 0x1b; *(uint32_t*)0x200007c4 = 0; *(uint32_t*)0x200007c8 = 0; *(uint32_t*)0x200007cc = 0x40000; *(uint32_t*)0x200007d0 = 0; *(uint32_t*)0x200007d4 = 0; *(uint32_t*)0x200007d8 = 0; memset((void*)0x200007dc, 0, 16); *(uint32_t*)0x200007ec = 0; *(uint32_t*)0x200007f0 = 0; *(uint32_t*)0x200007f4 = 0; *(uint32_t*)0x200007f8 = 0; *(uint32_t*)0x200007fc = 0; *(uint64_t*)0x20000800 = 0; *(uint32_t*)0x20000808 = 0; *(uint32_t*)0x2000080c = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200007c0ul, /*size=*/0x48ul); if (res != -1) r[1] = res; *(uint32_t*)0x20000840 = 8; *(uint32_t*)0x20000844 = 0x1c; *(uint64_t*)0x20000848 = 0x20000d80; *(uint8_t*)0x20000d80 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000d81, 8, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000d81, 0, 4, 4); *(uint16_t*)0x20000d82 = 0; *(uint32_t*)0x20000d84 = 0; *(uint8_t*)0x20000d88 = 0; *(uint8_t*)0x20000d89 = 0; *(uint16_t*)0x20000d8a = 0; *(uint32_t*)0x20000d8c = 0; *(uint8_t*)0x20000d90 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000d91, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000d91, 1, 4, 4); *(uint16_t*)0x20000d92 = 0; *(uint32_t*)0x20000d94 = r[1]; *(uint8_t*)0x20000d98 = 0; *(uint8_t*)0x20000d99 = 0; *(uint16_t*)0x20000d9a = 0; *(uint32_t*)0x20000d9c = 0; STORE_BY_BITMASK(uint8_t, , 0x20000da0, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000da0, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000da0, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000da1, 6, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000da1, 0, 4, 4); *(uint16_t*)0x20000da2 = 0; *(uint32_t*)0x20000da4 = 0x14; STORE_BY_BITMASK(uint8_t, , 0x20000da8, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000da8, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000da8, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000da9, 3, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000da9, 0, 4, 4); *(uint16_t*)0x20000daa = 0; *(uint32_t*)0x20000dac = 0; *(uint8_t*)0x20000db0 = 0x85; *(uint8_t*)0x20000db1 = 0; *(uint16_t*)0x20000db2 = 0; *(uint32_t*)0x20000db4 = 5; STORE_BY_BITMASK(uint8_t, , 0x20000db8, 4, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000db8, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000db8, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000db9, 9, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000db9, 0, 4, 4); *(uint16_t*)0x20000dba = 0; *(uint32_t*)0x20000dbc = 0; STORE_BY_BITMASK(uint8_t, , 0x20000dc0, 5, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000dc0, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000dc0, 3, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000dc1, 9, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000dc1, 0, 4, 4); *(uint16_t*)0x20000dc2 = 1; *(uint32_t*)0x20000dc4 = 0; *(uint8_t*)0x20000dc8 = 0x95; *(uint8_t*)0x20000dc9 = 0; *(uint16_t*)0x20000dca = 0; *(uint32_t*)0x20000dcc = 4; STORE_BY_BITMASK(uint8_t, , 0x20000dd0, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000dd0, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000dd0, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000dd1, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000dd1, 0, 4, 4); *(uint16_t*)0x20000dd2 = 0; *(uint32_t*)0x20000dd4 = 0; STORE_BY_BITMASK(uint8_t, , 0x20000dd8, 3, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000dd8, 3, 3, 2); STORE_BY_BITMASK(uint8_t, , 0x20000dd8, 3, 5, 3); STORE_BY_BITMASK(uint8_t, , 0x20000dd9, 0xa, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000dd9, 6, 4, 4); *(uint16_t*)0x20000dda = 0xfff8; *(uint32_t*)0x20000ddc = 0; STORE_BY_BITMASK(uint8_t, , 0x20000de0, 5, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000de0, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000de0, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000de1, 9, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000de1, 0, 4, 4); *(uint16_t*)0x20000de2 = 4; *(uint32_t*)0x20000de4 = 0; STORE_BY_BITMASK(uint8_t, , 0x20000de8, 3, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000de8, 3, 3, 2); STORE_BY_BITMASK(uint8_t, , 0x20000de8, 3, 5, 3); STORE_BY_BITMASK(uint8_t, , 0x20000de9, 0xa, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000de9, 0xa, 4, 4); *(uint16_t*)0x20000dea = 0xfff0; *(uint32_t*)0x20000dec = 0; STORE_BY_BITMASK(uint8_t, , 0x20000df0, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000df0, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000df0, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000df1, 9, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000df1, 0xa, 4, 4); *(uint16_t*)0x20000df2 = 0; *(uint32_t*)0x20000df4 = 0; STORE_BY_BITMASK(uint8_t, , 0x20000df8, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000df8, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000df8, 0, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000df9, 8, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000df9, 0, 4, 4); *(uint16_t*)0x20000dfa = 0; *(uint32_t*)0x20000dfc = 0xfffffff8; STORE_BY_BITMASK(uint8_t, , 0x20000e00, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000e00, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000e00, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e01, 4, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e01, 6, 4, 4); *(uint16_t*)0x20000e02 = 0; *(uint32_t*)0x20000e04 = 0; STORE_BY_BITMASK(uint8_t, , 0x20000e08, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000e08, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000e08, 0, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e09, 4, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e09, 0, 4, 4); *(uint16_t*)0x20000e0a = 0; *(uint32_t*)0x20000e0c = 0xfffffff0; STORE_BY_BITMASK(uint8_t, , 0x20000e10, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000e10, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000e10, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e11, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e11, 0, 4, 4); *(uint16_t*)0x20000e12 = 0; *(uint32_t*)0x20000e14 = 8; *(uint8_t*)0x20000e18 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000e19, 6, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e19, 2, 4, 4); *(uint16_t*)0x20000e1a = 0; *(uint32_t*)0x20000e1c = r[0]; *(uint8_t*)0x20000e20 = 0; *(uint8_t*)0x20000e21 = 0; *(uint16_t*)0x20000e22 = 0; *(uint32_t*)0x20000e24 = 0; STORE_BY_BITMASK(uint8_t, , 0x20000e28, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000e28, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000e28, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e29, 5, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e29, 0, 4, 4); *(uint16_t*)0x20000e2a = 0; *(uint32_t*)0x20000e2c = 8; *(uint8_t*)0x20000e30 = 0x46; *(uint8_t*)0x20000e31 = 8; *(uint16_t*)0x20000e32 = 0xfff0; *(uint32_t*)0x20000e34 = 0x76; STORE_BY_BITMASK(uint8_t, , 0x20000e38, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000e38, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000e38, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e39, 8, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e39, 9, 4, 4); *(uint16_t*)0x20000e3a = 0; *(uint32_t*)0x20000e3c = 0; STORE_BY_BITMASK(uint8_t, , 0x20000e40, 6, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000e40, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000e40, 5, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e41, 8, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e41, 0, 4, 4); *(uint16_t*)0x20000e42 = 0; *(uint32_t*)0x20000e44 = 0; *(uint8_t*)0x20000e48 = 0x85; *(uint8_t*)0x20000e49 = 0; *(uint16_t*)0x20000e4a = 0; *(uint32_t*)0x20000e4c = 7; STORE_BY_BITMASK(uint8_t, , 0x20000e50, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000e50, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000e50, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e51, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000e51, 0, 4, 4); *(uint16_t*)0x20000e52 = 0; *(uint32_t*)0x20000e54 = 0; *(uint8_t*)0x20000e58 = 0x95; *(uint8_t*)0x20000e59 = 0; *(uint16_t*)0x20000e5a = 0; *(uint32_t*)0x20000e5c = 0; *(uint64_t*)0x20000850 = 0x20000980; memcpy((void*)0x20000980, "GPL\000", 4); *(uint32_t*)0x20000858 = 0; *(uint32_t*)0x2000085c = 0; *(uint64_t*)0x20000860 = 0; *(uint32_t*)0x20000868 = 0; *(uint32_t*)0x2000086c = 0; memset((void*)0x20000870, 0, 16); *(uint32_t*)0x20000880 = 0; *(uint32_t*)0x20000884 = 0; *(uint32_t*)0x20000888 = 0; *(uint32_t*)0x2000088c = 0; *(uint64_t*)0x20000890 = 0; *(uint32_t*)0x20000898 = 0; *(uint32_t*)0x2000089c = 0; *(uint64_t*)0x200008a0 = 0; *(uint32_t*)0x200008a8 = 0; *(uint32_t*)0x200008ac = 0; *(uint32_t*)0x200008b0 = 0; *(uint32_t*)0x200008b4 = 0; *(uint64_t*)0x200008b8 = 0; *(uint64_t*)0x200008c0 = 0; *(uint32_t*)0x200008c8 = 0; *(uint32_t*)0x200008cc = 0; *(uint32_t*)0x200008d0 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x20000840ul, /*size=*/0x90ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; do_sandbox_none(); return 0; }