From bbd4840872f70e3342308c6965ab196ed2606af1 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 8 Jan 2017 17:20:32 +0100 Subject: sys: extend kvm support Add new pseudo syscall syz_kvm_setup_cpu that setups VCPU into interesting states for execution. KVM is too difficult to setup otherwise. Lots of improvements possible, but this is a starting point. --- executor/common.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'executor/common.h') diff --git a/executor/common.h b/executor/common.h index 3b6b27297..ba0303752 100644 --- a/executor/common.h +++ b/executor/common.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -367,6 +368,10 @@ static uintptr_t syz_fuseblk_mount(uintptr_t a0, uintptr_t a1, uintptr_t a2, uin } #endif +#ifdef __NR_syz_kvm_setup_cpu +#include "common_kvm.h" +#endif // #ifdef __NR_syz_kvm_setup_cpu + static uintptr_t execute_syscall(int nr, uintptr_t a0, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8) { switch (nr) { @@ -395,6 +400,10 @@ static uintptr_t execute_syscall(int nr, uintptr_t a0, uintptr_t a1, uintptr_t a #ifdef __NR_syz_emit_ethernet case __NR_syz_emit_ethernet: return syz_emit_ethernet(a0, a1); +#endif +#ifdef __NR_syz_kvm_setup_cpu + case __NR_syz_kvm_setup_cpu: + return syz_kvm_setup_cpu(a0, a1, a2, a3, a4, a5, a6, a7); #endif } } -- cgit mrf-deployment