// https://syzkaller.appspot.com/bug?id=bcea66b7efc68fee34781f448e106622b35bba6e // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #define __syscall syscall uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x1012ul, -1, 0ul); intptr_t res = 0; memcpy((void*)0x20000040, "./file0\000", 8); res = syscall(SYS_open, 0x20000040ul, 0x200ul, 0xa8ul); if (res != -1) r[0] = res; memcpy((void*)0x20000000, "./file0\000", 8); res = syscall(SYS_open, 0x20000000ul, 0xaul, 0ul); if (res != -1) r[1] = res; *(uint64_t*)0x20000340 = 0x20000000; *(uint64_t*)0x20000348 = 0x2cfea; syscall(SYS_writev, r[1], 0x20000340ul, 0x1000000000000013ul); syscall(SYS_mmap, 0x20000000ul, 0x200000ul, 3ul, 0x10ul, r[0], 0ul); memcpy((void*)0x20000100, "/dev/pf\000", 8); res = syscall(SYS_openat, 0xffffffffffffff9cul, 0x20000100ul, 1ul, 0ul); if (res != -1) r[2] = res; *(uint32_t*)0x20000140 = 0; *(uint64_t*)0x20000148 = 0x200003c0; syscall(SYS_ioctl, -1, 0x80104277ul, 0x20000140ul); *(uint32_t*)0x20000140 = 5; *(uint32_t*)0x20000144 = 0x408; *(uint16_t*)0x20000148 = 8; syscall(SYS_ioctl, r[2], 0xc0104451ul, 0x20000140ul); return 0; }