// https://syzkaller.appspot.com/bug?id=2b6a5e7ed9c189aadc974fc5ff168b131c005947 // autogenerated by syzkaller (http://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 #include #include #include #include #include #include #include #include #include #include #include #include #include __attribute__((noreturn)) static void doexit(int status) { volatile unsigned i; syscall(__NR_exit_group, status); for (i = 0;; i++) { } } #include #include const int kFailStatus = 67; const int kRetryStatus = 69; static void fail(const char* msg, ...) { int e = errno; va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); fprintf(stderr, " (errno %d)\n", e); doexit((e == ENOMEM || e == EAGAIN) ? kRetryStatus : kFailStatus); } #define BITMASK_LEN(type, bf_len) (type)((1ull << (bf_len)) - 1) #define BITMASK_LEN_OFF(type, bf_off, bf_len) \ (type)(BITMASK_LEN(type, (bf_len)) << (bf_off)) #define STORE_BY_BITMASK(type, addr, val, bf_off, bf_len) \ if ((bf_off) == 0 && (bf_len) == 0) { \ *(type*)(addr) = (type)(val); \ } else { \ type new_val = *(type*)(addr); \ new_val &= ~BITMASK_LEN_OFF(type, (bf_off), (bf_len)); \ new_val |= ((type)(val)&BITMASK_LEN(type, (bf_len))) << (bf_off); \ *(type*)(addr) = new_val; \ } struct csum_inet { uint32_t acc; }; static void csum_inet_init(struct csum_inet* csum) { csum->acc = 0; } static void csum_inet_update(struct csum_inet* csum, const uint8_t* data, size_t length) { if (length == 0) return; size_t i; for (i = 0; i < length - 1; i += 2) csum->acc += *(uint16_t*)&data[i]; if (length & 1) csum->acc += (uint16_t)data[length - 1]; while (csum->acc > 0xffff) csum->acc = (csum->acc & 0xffff) + (csum->acc >> 16); } static uint16_t csum_inet_digest(struct csum_inet* csum) { return ~csum->acc; } static void vsnprintf_check(char* str, size_t size, const char* format, va_list args) { int rv; rv = vsnprintf(str, size, format, args); if (rv < 0) fail("tun: snprintf failed"); if ((size_t)rv >= size) fail("tun: string '%s...' doesn't fit into buffer", str); } static void snprintf_check(char* str, size_t size, const char* format, ...) { va_list args; va_start(args, format); vsnprintf_check(str, size, format, args); va_end(args); } #define COMMAND_MAX_LEN 128 #define PATH_PREFIX \ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin " #define PATH_PREFIX_LEN (sizeof(PATH_PREFIX) - 1) static void execute_command(const char* format, ...) { va_list args; char command[PATH_PREFIX_LEN + COMMAND_MAX_LEN]; int rv; va_start(args, format); memcpy(command, PATH_PREFIX, PATH_PREFIX_LEN); vsnprintf_check(command + PATH_PREFIX_LEN, COMMAND_MAX_LEN, format, args); rv = system(command); if (rv != 0) fail("tun: command \"%s\" failed with code %d", &command[0], rv); va_end(args); } static int tunfd = -1; static int tun_frags_enabled; #define SYZ_TUN_MAX_PACKET_SIZE 1000 #define MAX_PIDS 32 #define ADDR_MAX_LEN 32 #define LOCAL_MAC "aa:aa:aa:aa:aa:%02hx" #define REMOTE_MAC "bb:bb:bb:bb:bb:%02hx" #define LOCAL_IPV4 "172.20.%d.170" #define REMOTE_IPV4 "172.20.%d.187" #define LOCAL_IPV6 "fe80::%02hxaa" #define REMOTE_IPV6 "fe80::%02hxbb" #define IFF_NAPI 0x0010 #define IFF_NAPI_FRAGS 0x0020 static void initialize_tun(uint64_t pid) { if (pid >= MAX_PIDS) fail("tun: no more than %d executors", MAX_PIDS); int id = pid; tunfd = open("/dev/net/tun", O_RDWR | O_NONBLOCK); if (tunfd == -1) { printf( "tun: can't open /dev/net/tun: please enable CONFIG_TUN=y\n"); printf("otherwise fuzzing or reproducing might not work as " "intended\n"); return; } char iface[IFNAMSIZ]; snprintf_check(iface, sizeof(iface), "syz%d", id); struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, iface, IFNAMSIZ); ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_NAPI | IFF_NAPI_FRAGS; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) { ifr.ifr_flags = IFF_TAP | IFF_NO_PI; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) fail("tun: ioctl(TUNSETIFF) failed"); } if (ioctl(tunfd, TUNGETIFF, (void*)&ifr) < 0) fail("tun: ioctl(TUNGETIFF) failed"); tun_frags_enabled = (ifr.ifr_flags & IFF_NAPI_FRAGS) != 0; char local_mac[ADDR_MAX_LEN]; snprintf_check(local_mac, sizeof(local_mac), LOCAL_MAC, id); char remote_mac[ADDR_MAX_LEN]; snprintf_check(remote_mac, sizeof(remote_mac), REMOTE_MAC, id); char local_ipv4[ADDR_MAX_LEN]; snprintf_check(local_ipv4, sizeof(local_ipv4), LOCAL_IPV4, id); char remote_ipv4[ADDR_MAX_LEN]; snprintf_check(remote_ipv4, sizeof(remote_ipv4), REMOTE_IPV4, id); char local_ipv6[ADDR_MAX_LEN]; snprintf_check(local_ipv6, sizeof(local_ipv6), LOCAL_IPV6, id); char remote_ipv6[ADDR_MAX_LEN]; snprintf_check(remote_ipv6, sizeof(remote_ipv6), REMOTE_IPV6, id); execute_command("sysctl -w net.ipv6.conf.%s.accept_dad=0", iface); execute_command("sysctl -w net.ipv6.conf.%s.router_solicitations=0", iface); execute_command("ip link set dev %s address %s", iface, local_mac); execute_command("ip addr add %s/24 dev %s", local_ipv4, iface); execute_command("ip -6 addr add %s/120 dev %s", local_ipv6, iface); execute_command("ip neigh add %s lladdr %s dev %s nud permanent", remote_ipv4, remote_mac, iface); execute_command("ip -6 neigh add %s lladdr %s dev %s nud permanent", remote_ipv6, remote_mac, iface); execute_command("ip link set dev %s up", iface); } static void setup_tun(uint64_t pid, bool enable_tun) { if (enable_tun) initialize_tun(pid); } #define MAX_FRAGS 4 struct vnet_fragmentation { uint32_t full; uint32_t count; uint32_t frags[MAX_FRAGS]; }; static uintptr_t syz_emit_ethernet(uintptr_t a0, uintptr_t a1, uintptr_t a2) { if (tunfd < 0) return (uintptr_t)-1; uint32_t length = a0; char* data = (char*)a1; struct vnet_fragmentation* frags = (struct vnet_fragmentation*)a2; struct iovec vecs[MAX_FRAGS + 1]; uint32_t nfrags = 0; if (!tun_frags_enabled || frags == NULL) { vecs[nfrags].iov_base = data; vecs[nfrags].iov_len = length; nfrags++; } else { bool full = true; uint32_t i, count = 0; full = frags->full; count = frags->count; if (count > MAX_FRAGS) count = MAX_FRAGS; for (i = 0; i < count && length != 0; i++) { uint32_t size = 0; size = frags->frags[i]; if (size > length) size = length; vecs[nfrags].iov_base = data; vecs[nfrags].iov_len = size; nfrags++; data += size; length -= size; } if (length != 0 && (full || nfrags == 0)) { vecs[nfrags].iov_base = data; vecs[nfrags].iov_len = length; nfrags++; } } return writev(tunfd, vecs, nfrags); } static uintptr_t syz_open_dev(uintptr_t a0, uintptr_t a1, uintptr_t a2) { if (a0 == 0xc || a0 == 0xb) { char buf[128]; sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2); return open(buf, O_RDWR, 0); } else { char buf[1024]; char* hash; strncpy(buf, (char*)a0, sizeof(buf)); buf[sizeof(buf) - 1] = 0; while ((hash = strchr(buf, '#'))) { *hash = '0' + (char)(a1 % 10); a1 /= 10; } return open(buf, a2, 0); } } static uintptr_t syz_kvm_setup_cpu(uintptr_t a0, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7) { return 0; } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); setsid(); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = 128 << 20; setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 8 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 0; setrlimit(RLIMIT_CORE, &rlim); #define CLONE_NEWCGROUP 0x02000000 unshare(CLONE_NEWNS); unshare(CLONE_NEWIPC); unshare(CLONE_NEWCGROUP); unshare(CLONE_NEWNET); unshare(CLONE_NEWUTS); unshare(CLONE_SYSVSEM); } static int do_sandbox_none(int executor_pid, bool enable_tun) { unshare(CLONE_NEWPID); int pid = fork(); if (pid < 0) fail("sandbox fork failed"); if (pid) return pid; sandbox_common(); setup_tun(executor_pid, enable_tun); loop(); doexit(1); } static void test(); void loop() { while (1) { test(); } } #ifndef __NR_ioctl #define __NR_ioctl 54 #endif #ifndef __NR_bpf #define __NR_bpf 357 #endif #ifndef __NR_sendto #define __NR_sendto 369 #endif #ifndef __NR_clock_gettime #define __NR_clock_gettime 265 #endif #ifndef __NR_perf_event_open #define __NR_perf_event_open 336 #endif #ifndef __NR_mmap #define __NR_mmap 192 #endif #ifndef __NR_getsockopt #define __NR_getsockopt 365 #endif #ifndef __NR_openat #define __NR_openat 295 #endif #ifndef __NR_fcntl #define __NR_fcntl 55 #endif #ifndef __NR_renameat2 #define __NR_renameat2 353 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 long r[5]; void test() { memset(r, -1, sizeof(r)); syscall(__NR_mmap, 0x20000000, 0xfff000, 0x3, 0x32, 0xffffffff, 0x0); memcpy((void*)0x20007000, "/dev/binder#", 13); r[0] = syz_open_dev(0x20007000, 0x0, 0x0); *(uint64_t*)0x204ecfd0 = 0x0; *(uint64_t*)0x204ecfd8 = 0x0; *(uint64_t*)0x204ecfe0 = 0x204ec000; *(uint64_t*)0x204ecfe8 = 0x1; *(uint64_t*)0x204ecff0 = 0x0; *(uint64_t*)0x204ecff8 = 0x204ecfff; memcpy((void*)0x204ecfff, "\x12", 1); syscall(__NR_ioctl, r[0], 0xc0306201, 0x204ecfd0); *(uint32_t*)0x208d6ff8 = 0x0; *(uint32_t*)0x208d6ffc = 0xff800000; *(uint32_t*)0x205f1000 = 0x8; syscall(__NR_getsockopt, 0xffffffff, 0x84, 0x66, 0x208d6ff8, 0x205f1000); *(uint32_t*)0x20ba334c = r[0]; *(uint32_t*)0x20ba3350 = 0xffffffff; *(uint32_t*)0x20ba3354 = 0x5; *(uint32_t*)0x20ba3358 = 0x1; *(uint32_t*)0x20ba335c = 0xffffffff; syscall(__NR_bpf, 0x8, 0x20ba334c, 0x14); *(uint16_t*)0x20514ff0 = 0x2; *(uint16_t*)0x20514ff2 = htobe16(0x4e20); *(uint32_t*)0x20514ff4 = htobe32(0x0); *(uint8_t*)0x20514ff8 = 0x0; *(uint8_t*)0x20514ff9 = 0x0; *(uint8_t*)0x20514ffa = 0x0; *(uint8_t*)0x20514ffb = 0x0; *(uint8_t*)0x20514ffc = 0x0; *(uint8_t*)0x20514ffd = 0x0; *(uint8_t*)0x20514ffe = 0x0; *(uint8_t*)0x20514fff = 0x0; syscall(__NR_sendto, 0xffffffff, 0x20dcfffe, 0x0, 0x0, 0x20514ff0, 0x10); memcpy((void*)0x203c4ff7, "/dev/kvm", 9); r[1] = syscall(__NR_openat, 0xffffff9c, 0x203c4ff7, 0x0, 0x0); r[2] = syscall(__NR_ioctl, r[1], 0xae01, 0x0); r[3] = syscall(__NR_ioctl, r[2], 0xae41, 0x0); syscall(__NR_clock_gettime, 0x0, 0x20000000); *(uint32_t*)0x20001000 = 0x10005; *(uint32_t*)0x20001004 = 0x0; *(uint64_t*)0x20001008 = 0x0; *(uint64_t*)0x20001010 = 0x2000; *(uint32_t*)0x20001018 = 0x20000000; syscall(__NR_ioctl, r[2], 0x4020ae46, 0x20001000); syscall(__NR_ioctl, r[3], 0xaeb7); syscall(__NR_ioctl, r[3], 0xae80, 0x0); *(uint32_t*)0x20a05000 = 0x3; *(uint32_t*)0x20a05004 = 0x78; *(uint8_t*)0x20a05008 = 0x1; *(uint8_t*)0x20a05009 = 0x0; *(uint8_t*)0x20a0500a = 0x0; *(uint8_t*)0x20a0500b = 0x0; *(uint32_t*)0x20a0500c = 0x0; *(uint64_t*)0x20a05010 = 0x8; *(uint64_t*)0x20a05018 = 0x0; *(uint64_t*)0x20a05020 = 0xc; *(uint8_t*)0x20a05028 = 0x0; *(uint8_t*)0x20a05029 = 0x81; *(uint8_t*)0x20a0502a = 0x0; *(uint8_t*)0x20a0502b = 0x1; *(uint32_t*)0x20a0502c = 0x0; *(uint32_t*)0x20a05030 = 0x101; *(uint32_t*)0x20a05034 = 0x4; *(uint64_t*)0x20a05038 = 0x6; *(uint64_t*)0x20a05040 = 0x3; *(uint64_t*)0x20a05048 = 0x8; *(uint64_t*)0x20a05050 = 0x3ace0eb5; *(uint64_t*)0x20a05058 = 0xfa9; *(uint32_t*)0x20a05060 = 0x3; *(uint64_t*)0x20a05068 = 0x8000; *(uint32_t*)0x20a05070 = 0x2; *(uint16_t*)0x20a05074 = 0x5; *(uint16_t*)0x20a05076 = 0x0; syscall(__NR_perf_event_open, 0x20a05000, 0x0, 0x3, 0xffffffff, 0x0); syscall(__NR_ioctl, r[3], 0xae80, 0x0); *(uint64_t*)0x202c7000 = 0x0; *(uint32_t*)0x202c7008 = 0x0; *(uint16_t*)0x202c700c = 0x0; *(uint8_t*)0x202c700e = 0x0; *(uint8_t*)0x202c700f = 0x0; *(uint8_t*)0x202c7010 = 0x0; *(uint8_t*)0x202c7011 = 0x0; *(uint8_t*)0x202c7012 = 0x0; *(uint8_t*)0x202c7013 = 0x0; *(uint8_t*)0x202c7014 = 0x0; *(uint8_t*)0x202c7015 = 0x0; *(uint8_t*)0x202c7016 = 0x0; *(uint8_t*)0x202c7017 = 0x0; *(uint64_t*)0x202c7018 = 0x0; *(uint32_t*)0x202c7020 = 0x0; *(uint16_t*)0x202c7024 = 0x0; *(uint8_t*)0x202c7026 = 0x0; *(uint8_t*)0x202c7027 = 0x0; *(uint8_t*)0x202c7028 = 0x0; *(uint8_t*)0x202c7029 = 0x0; *(uint8_t*)0x202c702a = 0x0; *(uint8_t*)0x202c702b = 0x0; *(uint8_t*)0x202c702c = 0x0; *(uint8_t*)0x202c702d = 0x0; *(uint8_t*)0x202c702e = 0x0; *(uint8_t*)0x202c702f = 0x0; *(uint64_t*)0x202c7030 = 0x0; *(uint32_t*)0x202c7038 = 0x0; *(uint16_t*)0x202c703c = 0x0; *(uint8_t*)0x202c703e = 0x0; *(uint8_t*)0x202c703f = 0x0; *(uint8_t*)0x202c7040 = 0x0; *(uint8_t*)0x202c7041 = 0x0; *(uint8_t*)0x202c7042 = 0x0; *(uint8_t*)0x202c7043 = 0x0; *(uint8_t*)0x202c7044 = 0x0; *(uint8_t*)0x202c7045 = 0x0; *(uint8_t*)0x202c7046 = 0x0; *(uint8_t*)0x202c7047 = 0x0; *(uint64_t*)0x202c7048 = 0x0; *(uint32_t*)0x202c7050 = 0x0; *(uint16_t*)0x202c7054 = 0x0; *(uint8_t*)0x202c7056 = 0x0; *(uint8_t*)0x202c7057 = 0x0; *(uint8_t*)0x202c7058 = 0x0; *(uint8_t*)0x202c7059 = 0x0; *(uint8_t*)0x202c705a = 0x0; *(uint8_t*)0x202c705b = 0x0; *(uint8_t*)0x202c705c = 0x0; *(uint8_t*)0x202c705d = 0x0; *(uint8_t*)0x202c705e = 0x0; *(uint8_t*)0x202c705f = 0x0; *(uint64_t*)0x202c7060 = 0x0; *(uint32_t*)0x202c7068 = 0x0; *(uint16_t*)0x202c706c = 0x0; *(uint8_t*)0x202c706e = 0x0; *(uint8_t*)0x202c706f = 0x0; *(uint8_t*)0x202c7070 = 0x0; *(uint8_t*)0x202c7071 = 0x0; *(uint8_t*)0x202c7072 = 0x0; *(uint8_t*)0x202c7073 = 0x0; *(uint8_t*)0x202c7074 = 0x0; *(uint8_t*)0x202c7075 = 0x0; *(uint8_t*)0x202c7076 = 0x0; *(uint8_t*)0x202c7077 = 0x0; *(uint64_t*)0x202c7078 = 0x0; *(uint32_t*)0x202c7080 = 0x0; *(uint16_t*)0x202c7084 = 0x0; *(uint8_t*)0x202c7086 = 0x0; *(uint8_t*)0x202c7087 = 0x0; *(uint8_t*)0x202c7088 = 0x0; *(uint8_t*)0x202c7089 = 0x0; *(uint8_t*)0x202c708a = 0x0; *(uint8_t*)0x202c708b = 0x0; *(uint8_t*)0x202c708c = 0x0; *(uint8_t*)0x202c708d = 0x0; *(uint8_t*)0x202c708e = 0x0; *(uint8_t*)0x202c708f = 0x0; *(uint64_t*)0x202c7090 = 0x0; *(uint32_t*)0x202c7098 = 0x0; *(uint16_t*)0x202c709c = 0x0; *(uint8_t*)0x202c709e = 0x0; *(uint8_t*)0x202c709f = 0x0; *(uint8_t*)0x202c70a0 = 0x0; *(uint8_t*)0x202c70a1 = 0x0; *(uint8_t*)0x202c70a2 = 0x0; *(uint8_t*)0x202c70a3 = 0x0; *(uint8_t*)0x202c70a4 = 0x0; *(uint8_t*)0x202c70a5 = 0x0; *(uint8_t*)0x202c70a6 = 0x0; *(uint8_t*)0x202c70a7 = 0x0; *(uint64_t*)0x202c70a8 = 0x0; *(uint32_t*)0x202c70b0 = 0x0; *(uint16_t*)0x202c70b4 = 0x0; *(uint8_t*)0x202c70b6 = 0x0; *(uint8_t*)0x202c70b7 = 0x0; *(uint8_t*)0x202c70b8 = 0x0; *(uint8_t*)0x202c70b9 = 0x0; *(uint8_t*)0x202c70ba = 0x0; *(uint8_t*)0x202c70bb = 0x0; *(uint8_t*)0x202c70bc = 0x0; *(uint8_t*)0x202c70bd = 0x0; *(uint8_t*)0x202c70be = 0x0; *(uint8_t*)0x202c70bf = 0x0; *(uint64_t*)0x202c70c0 = 0x0; *(uint16_t*)0x202c70c8 = 0x0; *(uint16_t*)0x202c70ca = 0x0; *(uint16_t*)0x202c70cc = 0x0; *(uint16_t*)0x202c70ce = 0x0; *(uint64_t*)0x202c70d0 = 0x0; *(uint16_t*)0x202c70d8 = 0x0; *(uint16_t*)0x202c70da = 0x0; *(uint16_t*)0x202c70dc = 0x0; *(uint16_t*)0x202c70de = 0x0; *(uint64_t*)0x202c70e0 = 0x0; *(uint64_t*)0x202c70e8 = 0x0; *(uint64_t*)0x202c70f0 = 0x0; *(uint64_t*)0x202c70f8 = 0x0; *(uint64_t*)0x202c7100 = 0x0; *(uint64_t*)0x202c7108 = 0x0; *(uint64_t*)0x202c7110 = 0x0; *(uint64_t*)0x202c7118 = 0x0; *(uint64_t*)0x202c7120 = 0x0; *(uint64_t*)0x202c7128 = 0x0; *(uint64_t*)0x202c7130 = 0x0; syscall(__NR_ioctl, r[3], 0x4138ae84, 0x202c7000); syscall(__NR_ioctl, r[3], 0xae80, 0x0); *(uint32_t*)0x20aadff4 = 0x8; *(uint32_t*)0x20aadff8 = 0x20228000; *(uint32_t*)0x20aadffc = 0x38; memcpy((void*)0x20228000, "\x0f\x19\xc5\xf3\x0f\xd6\xd4\x2e\x8a\x45\x2d\x3e\x2e\x0f\x18" "\x8a\x00\x00\x66\xb9\x0e\x08\x00\x00\x66\xb8\xd3\x00\x00\x00" "\x66\xba\x00\x00\x00\x00\x0f\x30\xd9\xea\xf2\xa5\x0f\x01\x9a" "\xa4\x3a\x36\x65\x08\xe0\xb8\x07\x00\x8e\xc8", 56); syz_kvm_setup_cpu(0xffffffff, 0xffffffff, 0x209c1000, 0x20aadff4, 0x1, 0x9, 0x20445000, 0x0); syscall(__NR_fcntl, 0xffffffff, 0x407, 0x5); memcpy((void*)0x20261ff8, "./file0", 8); memcpy((void*)0x203f6000, "./file0", 8); syscall(__NR_renameat2, 0xffffffff, 0x20261ff8, 0xffffffff, 0x203f6000, 0x2); memcpy((void*)0x20000ff5, "/dev/vcsa#", 11); r[4] = syz_open_dev(0x20000ff5, 0xca4, 0x2000); *(uint32_t*)0x20ef0fdc = 0x8; *(uint32_t*)0x20ef0fe0 = 0x7; *(uint32_t*)0x20ef0fe4 = 0x7f; *(uint32_t*)0x20ef0fe8 = 0x8000; *(uint8_t*)0x20ef0fec = 0xfc; *(uint8_t*)0x20ef0fed = 0x81; *(uint8_t*)0x20ef0fee = 0x0; *(uint8_t*)0x20ef0fef = 0x1; *(uint32_t*)0x20ef0ff0 = 0x200; *(uint32_t*)0x20ef0ff4 = 0x8; *(uint32_t*)0x20ef0ff8 = 0x6; *(uint32_t*)0x20ef0ffc = 0x4; syscall(__NR_ioctl, r[4], 0x5402, 0x20ef0fdc); *(uint8_t*)0x20025000 = 0xaa; *(uint8_t*)0x20025001 = 0xaa; *(uint8_t*)0x20025002 = 0xaa; *(uint8_t*)0x20025003 = 0xaa; *(uint8_t*)0x20025004 = 0xaa; *(uint8_t*)0x20025005 = 0x0; *(uint8_t*)0x20025006 = 0xbb; *(uint8_t*)0x20025007 = 0xbb; *(uint8_t*)0x20025008 = 0xbb; *(uint8_t*)0x20025009 = 0xbb; *(uint8_t*)0x2002500a = 0xbb; *(uint8_t*)0x2002500b = 0x0; *(uint16_t*)0x2002500c = htobe16(0x800); STORE_BY_BITMASK(uint8_t, 0x2002500e, 0x6, 0, 4); STORE_BY_BITMASK(uint8_t, 0x2002500e, 0x4, 4, 4); STORE_BY_BITMASK(uint8_t, 0x2002500f, 0x0, 0, 2); STORE_BY_BITMASK(uint8_t, 0x2002500f, 0x0, 2, 6); *(uint16_t*)0x20025010 = htobe16(0x2c); *(uint16_t*)0x20025012 = htobe16(0x64); *(uint16_t*)0x20025014 = htobe16(0x0); *(uint8_t*)0x20025016 = 0x0; *(uint8_t*)0x20025017 = 0x4; *(uint16_t*)0x20025018 = 0x0; *(uint8_t*)0x2002501a = 0xac; *(uint8_t*)0x2002501b = 0x14; *(uint8_t*)0x2002501c = 0x0; *(uint8_t*)0x2002501d = 0xbb; *(uint8_t*)0x2002501e = 0xac; *(uint8_t*)0x2002501f = 0x14; *(uint8_t*)0x20025020 = 0x0; *(uint8_t*)0x20025021 = 0xaa; *(uint8_t*)0x20025022 = 0x0; *(uint8_t*)0x20025023 = 0x2; *(uint16_t*)0x20025026 = htobe16(0x4e20); *(uint16_t*)0x20025028 = htobe16(0x4e20); *(uint32_t*)0x2002502a = 0x42424242; *(uint32_t*)0x2002502e = 0x42424242; STORE_BY_BITMASK(uint8_t, 0x20025032, 0x0, 0, 1); STORE_BY_BITMASK(uint8_t, 0x20025032, 0x0, 1, 3); STORE_BY_BITMASK(uint8_t, 0x20025032, 0x5, 4, 4); *(uint8_t*)0x20025033 = 0x0; *(uint16_t*)0x20025034 = htobe16(0x0); *(uint16_t*)0x20025036 = 0x0; *(uint16_t*)0x20025038 = htobe16(0x0); struct csum_inet csum_1; csum_inet_init(&csum_1); csum_inet_update(&csum_1, (const uint8_t*)0x2002501a, 4); csum_inet_update(&csum_1, (const uint8_t*)0x2002501e, 4); uint16_t csum_1_chunk_2 = 0x600; csum_inet_update(&csum_1, (const uint8_t*)&csum_1_chunk_2, 2); uint16_t csum_1_chunk_3 = 0x1400; csum_inet_update(&csum_1, (const uint8_t*)&csum_1_chunk_3, 2); csum_inet_update(&csum_1, (const uint8_t*)0x20025026, 20); *(uint16_t*)0x20025036 = csum_inet_digest(&csum_1); struct csum_inet csum_2; csum_inet_init(&csum_2); csum_inet_update(&csum_2, (const uint8_t*)0x2002500e, 24); *(uint16_t*)0x20025018 = csum_inet_digest(&csum_2); syz_emit_ethernet(0x3a, 0x20025000, 0x20000000); } int main() { for (;;) { int pid = do_sandbox_none(0, true); int status = 0; while (waitpid(pid, &status, __WALL) != pid) { } } }