mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-22 03:11:47 +00:00
hv: add check to invalid CR8 writting from guest
According to SDM, inject #GP(0) if guest tries to write reserved bit of CR8. Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
13a50c929d
commit
dec24a9f9f
@ -281,6 +281,15 @@ int cr_access_vmexit_handler(struct vcpu *vcpu)
|
|||||||
break;
|
break;
|
||||||
case 0x08U:
|
case 0x08U:
|
||||||
/* mov to cr8 */
|
/* mov to cr8 */
|
||||||
|
/* According to SDM 6.15 "Exception and interrupt Reference":
|
||||||
|
*
|
||||||
|
* set reserved bit in CR8 causes GP to guest
|
||||||
|
*/
|
||||||
|
if (*regptr & ~0xFUL) {
|
||||||
|
pr_dbg("Invalid cr8 write operation from guest");
|
||||||
|
vcpu_inject_gp(vcpu, 0U);
|
||||||
|
break;
|
||||||
|
}
|
||||||
vlapic_set_cr8(vcpu->arch_vcpu.vlapic, *regptr);
|
vlapic_set_cr8(vcpu->arch_vcpu.vlapic, *regptr);
|
||||||
break;
|
break;
|
||||||
case 0x18U:
|
case 0x18U:
|
||||||
|
Loading…
Reference in New Issue
Block a user