// https://syzkaller.appspot.com/bug?id=ad0c621d6fe5e9f9572a250d2c01744dbc727efb // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_ioctl #define __NR_ioctl 54 #endif #ifndef __NR_mmap #define __NR_mmap 192 #endif #ifndef __NR_openat #define __NR_openat 295 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x1ffff000, 0x1000, 0, 0x32, -1, 0); syscall(__NR_mmap, 0x20000000, 0x1000000, 7, 0x32, -1, 0); syscall(__NR_mmap, 0x21000000, 0x1000, 0, 0x32, -1, 0); intptr_t res = 0; memcpy((void*)0x20000040, "/dev/loop-control\000", 18); res = syscall(__NR_openat, 0xffffff9c, 0x20000040, 0, 0); if (res != -1) r[0] = res; syscall(__NR_ioctl, (intptr_t)r[0], 0x4c80, 0x200000); return 0; }