// https://syzkaller.appspot.com/bug?id=2eb39f9063a72cd5eed7331fd431b561f4e2fb1b // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include static uintptr_t syz_open_procfs(uintptr_t a0, uintptr_t a1) { char buf[128]; memset(buf, 0, sizeof(buf)); if (a0 == 0) { snprintf(buf, sizeof(buf), "/proc/self/%s", (char*)a1); } else if (a0 == (uintptr_t)-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; } #ifndef __NR_timer_create #define __NR_timer_create 259 #endif #ifndef __NR_preadv #define __NR_preadv 333 #endif #ifndef __NR_mmap #define __NR_mmap 192 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 long r[34]; void loop() { memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfff000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); memcpy((void*)0x20337ff2, "\x74\x69\x6d\x65\x72\x73\x00", 7); r[2] = syz_open_procfs(0x0ul, 0x20337ff2ul); *(uint32_t*)0x20f6afa0 = (uint32_t)0x0; *(uint32_t*)0x20f6afa4 = (uint32_t)0x36; *(uint32_t*)0x20f6afa8 = (uint32_t)0x3; *(uint32_t*)0x20f6afac = (uint32_t)0x20af2000; *(uint32_t*)0x20f6afb0 = (uint32_t)0x20f85000; *(uint64_t*)0x20f6afb8 = (uint64_t)0x0; *(uint64_t*)0x20f6afc0 = (uint64_t)0x0; *(uint64_t*)0x20f6afc8 = (uint64_t)0x0; *(uint64_t*)0x20f6afd0 = (uint64_t)0x0; *(uint64_t*)0x20f6afd8 = (uint64_t)0x0; *(uint64_t*)0x20f6afe0 = (uint64_t)0x0; *(uint64_t*)0x20f6afe8 = (uint64_t)0x0; *(uint64_t*)0x20f6aff0 = (uint64_t)0x0; r[16] = syscall(__NR_timer_create, 0x0ul, 0x20f6afa0ul, 0x20ebe000ul); *(uint32_t*)0x20508000 = (uint32_t)0x201c3f98; *(uint32_t*)0x20508004 = (uint32_t)0x0; *(uint32_t*)0x20508008 = (uint32_t)0x20634f0f; *(uint32_t*)0x2050800c = (uint32_t)0x0; *(uint32_t*)0x20508010 = (uint32_t)0x2076df17; *(uint32_t*)0x20508014 = (uint32_t)0x0; *(uint32_t*)0x20508018 = (uint32_t)0x20cbb000; *(uint32_t*)0x2050801c = (uint32_t)0x0; *(uint32_t*)0x20508020 = (uint32_t)0x20958f8e; *(uint32_t*)0x20508024 = (uint32_t)0x0; *(uint32_t*)0x20508028 = (uint32_t)0x20569f23; *(uint32_t*)0x2050802c = (uint32_t)0x0; *(uint32_t*)0x20508030 = (uint32_t)0x204b4f71; *(uint32_t*)0x20508034 = (uint32_t)0x0; *(uint32_t*)0x20508038 = (uint32_t)0x2034a000; *(uint32_t*)0x2050803c = (uint32_t)0x1000; r[33] = syscall(__NR_preadv, r[2], 0x20508000ul, 0x8ul, 0x0ul); } int main() { loop(); return 0; }