// https://syzkaller.appspot.com/bug?id=a1954eed3adfde914df9a0a2d0b7d1ecb876072f // 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 #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; } static long syz_open_procfs(volatile long a0, volatile long a1) { char buf[128]; memset(buf, 0, sizeof(buf)); if (a0 == 0) { snprintf(buf, sizeof(buf), "/proc/self/%s", (char*)a1); } else if (a0 == -1) { snprintf(buf, sizeof(buf), "/proc/thread-self/%s", (char*)a1); } else { snprintf(buf, sizeof(buf), "/proc/self/task/%d/%s", (int)a0, (char*)a1); } int fd = open(buf, O_RDWR); if (fd == -1) fd = open(buf, O_RDONLY); return fd; } 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 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(); 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[8] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } memcpy((void*)0x200000000640, "\x17\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\xff", 13); res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200000000640ul, /*size=*/0x48ul); if (res != -1) r[0] = res; *(uint32_t*)0x200000000a40 = 3; *(uint32_t*)0x200000000a44 = 0xc; *(uint64_t*)0x200000000a48 = 0x200000000440; memcpy((void*)0x200000000440, "\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18" "\x11\x00\x00", 20); *(uint32_t*)0x200000000454 = r[0]; memcpy((void*)0x200000000458, "\x00\x00\x00\x00\x00\x00\x00\x00\xb7\x08\x00\x00\x00\x00\x00\x00\x7b" "\x8a\xf8\xff\x00\x00\x00\x00\xbf\xa2\x00\x00\x00\x00\x00\x00\x07\x02" "\x00\x00\xf8\xff\xff\xff\xb7\x03\x00\x00\x08\x00\x00\x00\xb7\x04\x00" "\x00\x00\x00\x00\x00\x85\x00\x00\x00\x59\x00\x00\x00\x95", 65); *(uint64_t*)0x200000000a50 = 0; *(uint32_t*)0x200000000a58 = 0; *(uint32_t*)0x200000000a5c = 0; *(uint64_t*)0x200000000a60 = 0; *(uint32_t*)0x200000000a68 = 0; *(uint32_t*)0x200000000a6c = 0; memset((void*)0x200000000a70, 0, 16); *(uint32_t*)0x200000000a80 = 0; *(uint32_t*)0x200000000a84 = 0x25; *(uint32_t*)0x200000000a88 = -1; *(uint32_t*)0x200000000a8c = 8; *(uint64_t*)0x200000000a90 = 0; *(uint32_t*)0x200000000a98 = 0; *(uint32_t*)0x200000000a9c = 0x10; *(uint64_t*)0x200000000aa0 = 0; *(uint32_t*)0x200000000aa8 = 0; *(uint32_t*)0x200000000aac = 0; *(uint32_t*)0x200000000ab0 = 0; *(uint32_t*)0x200000000ab4 = 0; *(uint64_t*)0x200000000ab8 = 0; *(uint64_t*)0x200000000ac0 = 0; *(uint32_t*)0x200000000ac8 = 0x10; *(uint32_t*)0x200000000acc = 0; *(uint32_t*)0x200000000ad0 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000a40ul, /*size=*/0x90ul); *(uint32_t*)0x2000000009c0 = 0xe; *(uint32_t*)0x2000000009c4 = 4; *(uint32_t*)0x2000000009c8 = 8; *(uint32_t*)0x2000000009cc = 8; *(uint32_t*)0x2000000009d0 = 0; *(uint32_t*)0x2000000009d4 = -1; *(uint32_t*)0x2000000009d8 = 0; memset((void*)0x2000000009dc, 0, 16); *(uint32_t*)0x2000000009ec = 0; *(uint32_t*)0x2000000009f0 = -1; *(uint32_t*)0x2000000009f4 = 0; *(uint32_t*)0x2000000009f8 = 0; *(uint32_t*)0x2000000009fc = 0; *(uint64_t*)0x200000000a00 = 0; *(uint32_t*)0x200000000a08 = 0; *(uint32_t*)0x200000000a0c = 0; syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x2000000009c0ul, /*size=*/0x48ul); *(uint32_t*)0x2000000000c0 = 0x1b; *(uint32_t*)0x2000000000c4 = 0; *(uint32_t*)0x2000000000c8 = 0; *(uint32_t*)0x2000000000cc = 0x8000; *(uint32_t*)0x2000000000d0 = 0; *(uint32_t*)0x2000000000d4 = -1; *(uint32_t*)0x2000000000d8 = 0; memset((void*)0x2000000000dc, 0, 16); *(uint32_t*)0x2000000000ec = 0; *(uint32_t*)0x2000000000f0 = -1; *(uint32_t*)0x2000000000f4 = 0; *(uint32_t*)0x2000000000f8 = 0; *(uint32_t*)0x2000000000fc = 0; *(uint64_t*)0x200000000100 = 0; *(uint32_t*)0x200000000108 = 0; *(uint32_t*)0x20000000010c = 0; res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x2000000000c0ul, /*size=*/0x48ul); if (res != -1) r[1] = res; *(uint32_t*)0x2000000000c0 = 0; *(uint32_t*)0x2000000000c4 = 0xc; *(uint64_t*)0x2000000000c8 = 0x200000000440; memcpy((void*)0x200000000440, "\x18\x01\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18" "\x12\x00\x00", 20); *(uint32_t*)0x200000000454 = r[1]; memcpy((void*)0x200000000458, "\x00\x00\x00\x00\x00\x00\x00\x00\xb7\x08\x00\x00\x00\x00\x00\x00\x7b" "\x8a\xf8\xff\x00\x00\x00\x00\xbf\xa2\x00\x00\x00\x00\x00\x00\x07\x02" "\x00\x00\xf8\xff\xff\xff\xb7\x03\x00\x00\x08\x00\x00\x00\xb7\x04\x00" "\x00\xf6\x00\x00\x00\x85\x00\x00\x00\x43\x00\x00\x00\x95", 65); *(uint64_t*)0x2000000000d0 = 0; *(uint32_t*)0x2000000000d8 = 0; *(uint32_t*)0x2000000000dc = 0; *(uint64_t*)0x2000000000e0 = 0; *(uint32_t*)0x2000000000e8 = 0; *(uint32_t*)0x2000000000ec = 0; memset((void*)0x2000000000f0, 0, 16); *(uint32_t*)0x200000000100 = 0; *(uint32_t*)0x200000000104 = 0; *(uint32_t*)0x200000000108 = -1; *(uint32_t*)0x20000000010c = 0; *(uint64_t*)0x200000000110 = 0; *(uint32_t*)0x200000000118 = 0; *(uint32_t*)0x20000000011c = 0; *(uint64_t*)0x200000000120 = 0; *(uint32_t*)0x200000000128 = 0; *(uint32_t*)0x20000000012c = 0; *(uint32_t*)0x200000000130 = 0; *(uint32_t*)0x200000000134 = 0x24; *(uint64_t*)0x200000000138 = 0; *(uint64_t*)0x200000000140 = 0; *(uint32_t*)0x200000000148 = 0; *(uint32_t*)0x20000000014c = 0; *(uint32_t*)0x200000000150 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x2000000000c0ul, /*size=*/0x90ul); *(uint32_t*)0x200000000600 = 0; *(uint32_t*)0x200000000604 = 4; *(uint64_t*)0x200000000608 = 0x200000000480; memcpy((void*)0x200000000480, "\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x85" "\x00\x00\x00\x6d", 21); *(uint64_t*)0x200000000610 = 0; *(uint32_t*)0x200000000618 = 0; *(uint32_t*)0x20000000061c = 0; *(uint64_t*)0x200000000620 = 0; *(uint32_t*)0x200000000628 = 0; *(uint32_t*)0x20000000062c = 0; memset((void*)0x200000000630, 0, 16); *(uint32_t*)0x200000000640 = 0; *(uint32_t*)0x200000000644 = 0; *(uint32_t*)0x200000000648 = -1; *(uint32_t*)0x20000000064c = 0; *(uint64_t*)0x200000000650 = 0; *(uint32_t*)0x200000000658 = 0; *(uint32_t*)0x20000000065c = 0; *(uint64_t*)0x200000000660 = 0; *(uint32_t*)0x200000000668 = 0; *(uint32_t*)0x20000000066c = 0; *(uint32_t*)0x200000000670 = -1; *(uint32_t*)0x200000000674 = 0; *(uint64_t*)0x200000000678 = 0; *(uint64_t*)0x200000000680 = 0; *(uint32_t*)0x200000000688 = 0; *(uint32_t*)0x20000000068c = 0; *(uint32_t*)0x200000000690 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000600ul, /*size=*/0x94ul); *(uint32_t*)0x200000000240 = 0x11; *(uint32_t*)0x200000000244 = 0xc; *(uint64_t*)0x200000000248 = 0x200000000440; *(uint64_t*)0x200000000250 = 0x200000000180; memcpy((void*)0x200000000180, "GPL\000", 4); *(uint32_t*)0x200000000258 = 0; *(uint32_t*)0x20000000025c = 0; *(uint64_t*)0x200000000260 = 0; *(uint32_t*)0x200000000268 = 0x41000; *(uint32_t*)0x20000000026c = 0; memset((void*)0x200000000270, 0, 16); *(uint32_t*)0x200000000280 = 0; *(uint32_t*)0x200000000284 = 0; *(uint32_t*)0x200000000288 = -1; *(uint32_t*)0x20000000028c = 0; *(uint64_t*)0x200000000290 = 0; *(uint32_t*)0x200000000298 = 0; *(uint32_t*)0x20000000029c = 0; *(uint64_t*)0x2000000002a0 = 0; *(uint32_t*)0x2000000002a8 = 0; *(uint32_t*)0x2000000002ac = 0; *(uint32_t*)0x2000000002b0 = 0; *(uint32_t*)0x2000000002b4 = 0; *(uint64_t*)0x2000000002b8 = 0; *(uint64_t*)0x2000000002c0 = 0; *(uint32_t*)0x2000000002c8 = 0; *(uint32_t*)0x2000000002cc = 0; *(uint32_t*)0x2000000002d0 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000240ul, /*size=*/0x94ul); if (res != -1) r[2] = res; *(uint64_t*)0x2000000005c0 = 0x200000000300; memcpy((void*)0x200000000300, "sys_enter\000", 10); *(uint32_t*)0x2000000005c8 = r[2]; *(uint32_t*)0x2000000005cc = 0; *(uint64_t*)0x2000000005d0 = 0; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x2000000005c0ul, /*size=*/0x10ul); syscall(__NR_bpf, /*cmd=*/0xeul, /*arg=*/0ul, /*size=*/0ul); *(uint64_t*)0x200000000000 = 0x200000000040; memcpy((void*)0x200000000040, "kmem_cache_free\000", 16); *(uint32_t*)0x200000000008 = -1; *(uint32_t*)0x20000000000c = 0; *(uint64_t*)0x200000000010 = 0; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x200000000000ul, /*size=*/0x10ul); memcpy((void*)0x200000000040, "/dev/net/tun\000", 13); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000040ul, /*flags=O_SYNC|O_NOCTTY|O_NOATIME|O_CREAT|O_WRONLY*/ 0x141141, /*mode=*/0); if (res != -1) r[3] = res; memcpy((void*)0x2000000000c0, "syzkaller0\000\000\000\000\000\000", 16); *(uint16_t*)0x2000000000d0 = 0xb7f2; syscall(__NR_ioctl, /*fd=*/r[3], /*cmd=*/0x400454ca, /*arg=*/0x2000000000c0ul); memcpy((void*)0x200000000080, "/dev/net/tun\000", 13); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000080ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[4] = res; syscall(__NR_close, /*fd=*/r[4]); memcpy((void*)0x200000000200, "/dev/ppp\000", 9); syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000200ul, /*flags=O_NOATIME|O_WRONLY*/ 0x40001, /*mode=*/0); *(uint32_t*)0x200000000080 = -1; *(uint32_t*)0x200000000084 = 0x2a0; *(uint32_t*)0x200000000088 = 0xd; *(uint32_t*)0x20000000008c = 0; *(uint64_t*)0x200000000090 = 0x200000000100; memcpy((void*)0x200000000100, "\xb9\xff\x03\x07\x60\x44\x23\x8c\xb8\x9e\x14\xf0\x08", 13); *(uint64_t*)0x200000000098 = 0; *(uint32_t*)0x2000000000a0 = 0xfe; *(uint32_t*)0x2000000000a4 = 0x60000000; *(uint32_t*)0x2000000000a8 = 0; *(uint32_t*)0x2000000000ac = 0; *(uint64_t*)0x2000000000b0 = 0; *(uint64_t*)0x2000000000b8 = 0; *(uint32_t*)0x2000000000c0 = 0; *(uint32_t*)0x2000000000c4 = 3; *(uint32_t*)0x2000000000c8 = 0; syscall(__NR_bpf, /*cmd=*/0xaul, /*arg=*/0x200000000080ul, /*size=*/0x50ul); syscall(__NR_socketpair, /*domain=*/1ul, /*type=SOCK_SEQPACKET*/ 5ul, /*proto=*/0, /*fds=*/0x2000000029c0ul); memcpy((void*)0x200000002280, "syzkaller0\000\000\000\000\000\000", 16); *(uint8_t*)0x200000002290 = 1; *(uint8_t*)0x200000002291 = 0x80; *(uint8_t*)0x200000002292 = 0xc2; *(uint8_t*)0x200000002293 = 0; *(uint8_t*)0x200000002294 = 0; *(uint8_t*)0x200000002295 = 0; syscall(__NR_ioctl, /*fd=*/r[4], /*cmd=*/0x8914, /*arg=*/0x200000002280ul); syscall(__NR_write, /*fd=*/r[3], /*buf=*/0x200000000100ul, /*len=*/0xfdeful); *(uint32_t*)0x200000000080 = r[0]; *(uint64_t*)0x200000000088 = 0; *(uint64_t*)0x200000000090 = 0x2000000002c0; *(uint32_t*)0x2000000002c0 = -1; *(uint64_t*)0x200000000098 = 0; res = syscall(__NR_bpf, /*cmd=*/2ul, /*arg=*/0x200000000080ul, /*size=*/0x20ul); if (res != -1) r[5] = *(uint32_t*)0x200000000080; *(uint32_t*)0x200000000000 = 0; *(uint32_t*)0x200000000004 = r[5]; syscall(__NR_bpf, /*cmd=*/0x24ul, /*arg=*/0x200000000000ul, /*size=*/8ul); *(uint32_t*)0x2000000000c0 = 0x11; *(uint32_t*)0x2000000000c4 = 0xc; *(uint64_t*)0x2000000000c8 = 0x200000000040; sprintf((char*)0x200000000040, "%023llo", (long long)r[5]); *(uint64_t*)0x2000000000d0 = 0x2000000001c0; memcpy((void*)0x2000000001c0, "GPL\000", 4); *(uint32_t*)0x2000000000d8 = 0; *(uint32_t*)0x2000000000dc = 0; *(uint64_t*)0x2000000000e0 = 0; *(uint32_t*)0x2000000000e8 = 0; *(uint32_t*)0x2000000000ec = 0; memset((void*)0x2000000000f0, 0, 16); *(uint32_t*)0x200000000100 = 0; *(uint32_t*)0x200000000104 = 0; *(uint32_t*)0x200000000108 = -1; *(uint32_t*)0x20000000010c = 0; *(uint64_t*)0x200000000110 = 0; *(uint32_t*)0x200000000118 = 0; *(uint32_t*)0x20000000011c = 0; *(uint64_t*)0x200000000120 = 0; *(uint32_t*)0x200000000128 = 0; *(uint32_t*)0x20000000012c = 0; *(uint32_t*)0x200000000130 = -1; *(uint32_t*)0x200000000134 = 0; *(uint64_t*)0x200000000138 = 0; *(uint64_t*)0x200000000140 = 0; *(uint32_t*)0x200000000148 = 0; *(uint32_t*)0x20000000014c = 0; *(uint32_t*)0x200000000150 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x2000000000c0ul, /*size=*/0x94ul); if (res != -1) r[6] = res; *(uint32_t*)0x2000000006c0 = 0; *(uint32_t*)0x2000000006c4 = 0x80; *(uint8_t*)0x2000000006c8 = 9; *(uint8_t*)0x2000000006c9 = 3; *(uint8_t*)0x2000000006ca = 0x16; *(uint8_t*)0x2000000006cb = 4; *(uint32_t*)0x2000000006cc = 0; *(uint64_t*)0x2000000006d0 = 5; *(uint64_t*)0x2000000006d8 = 0x94ba0; *(uint64_t*)0x2000000006e0 = 0x48cf3dc79f55ac95; STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 0, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 1, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 2, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 3, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 4, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 5, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 6, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 7, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 8, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 9, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 10, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 11, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 12, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 13, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 14, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 15, 2); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 17, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 18, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 19, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 20, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 21, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 22, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 23, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 24, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 25, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 26, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 27, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 28, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 29, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 30, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 31, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 32, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 33, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 34, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 35, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 1, 36, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 37, 1); STORE_BY_BITMASK(uint64_t, , 0x2000000006e8, 0, 38, 26); *(uint32_t*)0x2000000006f0 = 1; *(uint32_t*)0x2000000006f4 = 2; *(uint64_t*)0x2000000006f8 = 0; *(uint64_t*)0x200000000700 = 6; *(uint64_t*)0x200000000708 = 0x100000; *(uint64_t*)0x200000000710 = 0; *(uint32_t*)0x200000000718 = 2; *(uint32_t*)0x20000000071c = 8; *(uint64_t*)0x200000000720 = 0xfffffffffffffffe; *(uint32_t*)0x200000000728 = 0; *(uint16_t*)0x20000000072c = 0xc; *(uint16_t*)0x20000000072e = 0; *(uint32_t*)0x200000000730 = 0xc7a8; *(uint32_t*)0x200000000734 = 0; *(uint64_t*)0x200000000738 = 4; syscall(__NR_perf_event_open, /*attr=*/0x2000000006c0ul, /*pid=*/0, /*cpu=*/1ul, /*group=*/(intptr_t)-1, /*flags=PERF_FLAG_FD_OUTPUT*/ 2ul); *(uint32_t*)0x200000000800 = 2; *(uint32_t*)0x200000000804 = 0x80; *(uint8_t*)0x200000000808 = 0xcb; *(uint8_t*)0x200000000809 = 0; *(uint8_t*)0x20000000080a = 0; *(uint8_t*)0x20000000080b = 0; *(uint32_t*)0x20000000080c = 0; *(uint64_t*)0x200000000810 = 0; *(uint64_t*)0x200000000818 = 0; *(uint64_t*)0x200000000820 = 0; STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 0, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 1, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 2, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 3, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 4, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 5, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 6, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 7, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 8, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 9, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 10, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 11, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 12, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 13, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 14, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 15, 2); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 17, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 18, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 19, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 20, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 21, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 22, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 23, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 24, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 25, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 26, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 27, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 28, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 29, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 30, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 31, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 32, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 33, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 34, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 35, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 36, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 37, 1); STORE_BY_BITMASK(uint64_t, , 0x200000000828, 0, 38, 26); *(uint32_t*)0x200000000830 = 0; *(uint32_t*)0x200000000834 = 0; *(uint64_t*)0x200000000838 = 0; *(uint64_t*)0x200000000840 = 0; *(uint64_t*)0x200000000848 = 0; *(uint64_t*)0x200000000850 = 0; *(uint32_t*)0x200000000858 = 0; *(uint32_t*)0x20000000085c = 0; *(uint64_t*)0x200000000860 = 0; *(uint32_t*)0x200000000868 = 0; *(uint16_t*)0x20000000086c = 0; *(uint16_t*)0x20000000086e = 0; *(uint32_t*)0x200000000870 = 0; *(uint32_t*)0x200000000874 = 0; *(uint64_t*)0x200000000878 = 0; syscall(__NR_perf_event_open, /*attr=*/0x200000000800ul, /*pid=*/0, /*cpu=*/0ul, /*group=*/(intptr_t)-1, /*flags=*/0ul); sprintf((char*)0x200000000380, "0x%016llx", (long long)0); syscall(__NR_write, /*fd=*/(intptr_t)-1, /*buf=*/0x200000000380ul, /*len=*/0x12ul); *(uint64_t*)0x2000000002c0 = 0x200000000700; memcpy((void*)0x200000000700, "signal_deliver\000", 15); *(uint32_t*)0x2000000002c8 = r[6]; *(uint32_t*)0x2000000002cc = 0; *(uint64_t*)0x2000000002d0 = 0; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x2000000002c0ul, /*size=*/0x10ul); *(uint32_t*)0x200000000540 = 0x11; *(uint32_t*)0x200000000544 = 0xc; *(uint64_t*)0x200000000548 = 0x200000000440; *(uint64_t*)0x200000000550 = 0x2000000001c0; memcpy((void*)0x2000000001c0, "GPL\000", 4); *(uint32_t*)0x200000000558 = 0; *(uint32_t*)0x20000000055c = 0; *(uint64_t*)0x200000000560 = 0; *(uint32_t*)0x200000000568 = 0; *(uint32_t*)0x20000000056c = 0; memset((void*)0x200000000570, 0, 16); *(uint32_t*)0x200000000580 = 0; *(uint32_t*)0x200000000584 = 0; *(uint32_t*)0x200000000588 = -1; *(uint32_t*)0x20000000058c = 0; *(uint64_t*)0x200000000590 = 0; *(uint32_t*)0x200000000598 = 0; *(uint32_t*)0x20000000059c = 0; *(uint64_t*)0x2000000005a0 = 0; *(uint32_t*)0x2000000005a8 = 0; *(uint32_t*)0x2000000005ac = 0; *(uint32_t*)0x2000000005b0 = 0; *(uint32_t*)0x2000000005b4 = 0; *(uint64_t*)0x2000000005b8 = 0; *(uint64_t*)0x2000000005c0 = 0; *(uint32_t*)0x2000000005c8 = 0; *(uint32_t*)0x2000000005cc = 0; *(uint32_t*)0x2000000005d0 = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000540ul, /*size=*/0x90ul); if (res != -1) r[7] = res; *(uint64_t*)0x2000000002c0 = 0x200000000700; memcpy((void*)0x200000000700, "signal_deliver\000", 15); *(uint32_t*)0x2000000002c8 = r[7]; *(uint32_t*)0x2000000002cc = 0; *(uint64_t*)0x2000000002d0 = 0; syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x2000000002c0ul, /*size=*/0x10ul); syz_open_procfs(/*pid=*/0, /*file=*/0x9999999999999999); } 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; loop(); return 0; }