Skip to content

Commit

Permalink
KVM: nVMX: unconditionally cancel preemption timer in free_nested (CV…
Browse files Browse the repository at this point in the history
…E-2019-7221)

Bugzilla: 1671904

There are multiple code paths where an hrtimer may have been started to
emulate an L1 VMX preemption timer that can result in a call to free_nested
without an intervening L2 exit where the hrtimer is normally
cancelled. Unconditionally cancel in free_nested to cover all cases.

Embargoed until Feb 7th 2019.

Signed-off-by: Peter Shier <[email protected]>
Reported-by: Jim Mattson <[email protected]>
Reviewed-by: Jim Mattson <[email protected]>
Reported-by: Felix Wilhelm <[email protected]>
Cc: [email protected]
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
Peter Shier authored and bonzini committed Feb 7, 2019
1 parent 353c095 commit ecec768
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kvm/vmx/nested.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ static void free_nested(struct kvm_vcpu *vcpu)
if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon)
return;

hrtimer_cancel(&vmx->nested.preemption_timer);
vmx->nested.vmxon = false;
vmx->nested.smm.vmxon = false;
free_vpid(vmx->nested.vpid02);
Expand Down

0 comments on commit ecec768

Please sign in to comment.