| // WARNING in kvm_set_tsc_khz |
| // https://syzkaller.appspot.com/bug?id=0b7ea1ad0e2fa94a69f950c44da50bfe99298d1d |
| // status:fixed |
| // autogenerated by syzkaller (https://github.com/google/syzkaller) |
| |
| #define _GNU_SOURCE |
| |
| #include <endian.h> |
| #include <stdint.h> |
| #include <stdio.h> |
| #include <stdlib.h> |
| #include <string.h> |
| #include <sys/syscall.h> |
| #include <sys/types.h> |
| #include <unistd.h> |
| |
| uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; |
| |
| int main() |
| { |
| syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); |
| long res = 0; |
| memcpy((void*)0x200016c0, "/dev/kvm", 9); |
| res = syscall(__NR_openat, 0xffffffffffffff9c, 0x200016c0, 0, 0); |
| if (res != -1) |
| r[0] = res; |
| res = syscall(__NR_ioctl, r[0], 0xae01, 0); |
| if (res != -1) |
| r[1] = res; |
| res = syscall(__NR_ioctl, r[1], 0xae41, 0); |
| if (res != -1) |
| r[2] = res; |
| *(uint32_t*)0x20000000 = 2; |
| *(uint32_t*)0x20000004 = 0; |
| *(uint32_t*)0x20000008 = 7; |
| *(uint32_t*)0x2000000c = 0; |
| *(uint32_t*)0x20000010 = 0; |
| *(uint32_t*)0x20000014 = 4; |
| *(uint32_t*)0x20000018 = 0; |
| *(uint32_t*)0x2000001c = 0; |
| *(uint32_t*)0x20000020 = 1; |
| *(uint32_t*)0x20000024 = 0; |
| *(uint32_t*)0x20000028 = 0; |
| *(uint32_t*)0x2000002c = 0xe5; |
| *(uint32_t*)0x20000030 = 0; |
| *(uint32_t*)0x20000034 = 0; |
| syscall(__NR_ioctl, r[2], 0xc080aebe, 0x20000000); |
| return 0; |
| } |