public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: nVMX: Add IBPB between L2 and L1 to
@ 2022-10-19 21:36 Jim Mattson
  2022-10-19 21:36 ` [PATCH v2 1/2] KVM: VMX: Guest usage of IA32_SPEC_CTRL is likely Jim Mattson
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jim Mattson @ 2022-10-19 21:36 UTC (permalink / raw)
  To: kvm, pbonzini, seanjc; +Cc: Jim Mattson

Since L1 and L2 share branch prediction modes (guest {kernel,user}), the
hardware will not protect indirect branches in L1 from steering by a
malicious agent in L2. However, IBRS guarantees this protection. (For
basic IBRS, a value of 1 must be written to IA32_SPEC_CTRL.IBRS after
the transition  from L2 to L1.)

Fix the regression introduced in commit 5c911beff20a ("KVM: nVMX: Skip
IBPB when switching between vmcs01 and vmcs02") by issuing an IBPB when
emulating a VM-exit from L2 to L1.

This is CVE-2022-2196.

v2: Reworded some comments [Sean].

Jim Mattson (2):
  KVM: VMX: Guest usage of IA32_SPEC_CTRL is likely
  KVM: VMX: Execute IBPB on emulated VM-exit when guest has IBRS

 arch/x86/kvm/vmx/nested.c | 11 +++++++++++
 arch/x86/kvm/vmx/vmx.c    | 10 ++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)

-- 
2.38.0.413.g74048e4d9e-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-02 19:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-19 21:36 [PATCH v2 0/2] KVM: nVMX: Add IBPB between L2 and L1 to Jim Mattson
2022-10-19 21:36 ` [PATCH v2 1/2] KVM: VMX: Guest usage of IA32_SPEC_CTRL is likely Jim Mattson
2022-11-01 19:23   ` Sean Christopherson
2022-10-19 21:36 ` [PATCH v2 2/2] KVM: VMX: Execute IBPB on emulated VM-exit when guest has IBRS Jim Mattson
2022-11-01 19:23   ` Sean Christopherson
2022-11-01 18:50 ` [PATCH v2 0/2] KVM: nVMX: Add IBPB between L2 and L1 to Jim Mattson
2022-12-02 19:21 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox