hypercall: only allow hypercall from RING-0

only allow hypercall from RING-0

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Jason Chen CJ
2018-05-21 20:13:26 +08:00
committed by lijinxia
parent d2191401c8
commit f505f338bd
2 changed files with 5 additions and 10 deletions

View File

@@ -52,6 +52,11 @@ int vmcall_vmexit_handler(struct vcpu *vcpu)
/* hypercall param4 from guest, reserved*/
/* uint64_t param4 = cur_context->guest_cpu_regs.regs.rcx; */
if (!is_hypercall_from_ring0()) {
pr_err("hypercall is only allowed from RING-0!\n");
return -1;
}
/* Dispatch the hypercall handler */
switch (hypcall_id) {
case HC_GET_API_VERSION: