Skip to content

KVM: nVMX: Add IBPB between L2 and L1 to

Jim Mattson kvm 2 versions – Applied

Status from this message: Merged to kvm/queue, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesApplied
  2. v12 patches 4 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: VMX: Guest usage of IA32_SPEC_CTRL is likelyarch/x86/kvm/vmx/vmx.c+1 -11 reply
2/2KVM: VMX: Execute IBPB on emulated VM-exit when guest has IBRSarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c+15 -21 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchSean Christopherson
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] KVM: nVMX: Add IBPB between L2 and L1 to

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(-)
Signature · 1 line
2.38.0.413.g74048e4d9e-goog