Skip to content

Commit 05f8fd7

Browse files
JasonChenCJlijinxia
authored andcommitted
hypercall: do not allow hypercall from UOS except trusty
only trusty related hypercall will come from UOS, others should come from VM0 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent f505f33 commit 05f8fd7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hypervisor/arch/x86/guest/vmcall.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ int vmcall_vmexit_handler(struct vcpu *vcpu)
5757
return -1;
5858
}
5959

60+
if (!is_vm0(vm) && hypcall_id != HC_WORLD_SWITCH &&
61+
hypcall_id != HC_INITIALIZE_TRUSTY) {
62+
pr_err("hypercall %d is only allowed from VM0!\n", hypcall_id);
63+
return -1;
64+
}
65+
6066
/* Dispatch the hypercall handler */
6167
switch (hypcall_id) {
6268
case HC_GET_API_VERSION:

0 commit comments

Comments
 (0)