linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] Nested SVM fixes, cleanups, and hardening
@ 2025-11-04 19:59 Yosry Ahmed
  2025-11-04 19:59 ` [PATCH 01/11] KVM: nSVM: Fix consistency checks for NP_ENABLE Yosry Ahmed
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Yosry Ahmed @ 2025-11-04 19:59 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: Paolo Bonzini, Jim Mattson, kvm, linux-kernel, Yosry Ahmed

A group of semi-related fixes, cleanups, and hardening patches for nSVM.

Patches 1-3 fix or add missing consistency checks.

Patches 4-5 are renames to clarify some VMCB fields.

Patches 6-10 add hardening to reading the VMCB12, caching all used
fields in the save area to prevent theoritical TOC-TOU bugs, sanitizing
used fields in the control area, and restricting accesses to the VMCB12
through guest memory.

Patch 11 further restricts fields copied from VMCB01 to VMCB12.

Yosry Ahmed (11):
  KVM: nSVM: Fix consistency checks for NP_ENABLE
  KVM: nSVM: Add missing consistency check for EFER, CR0, CR4, and CS
  KVM: nSVM: Add missing consistency check for event_inj
  KVM: SVM: Rename vmcb->nested_ctl to vmcb->misc_ctl
  KVM: SVM: Rename vmcb->virt_ext to vmcb->misc_ctl2
  KVM: SVM: switch svm_copy_lbrs() to a macro
  KVM: nSVM: Cache all used fields from VMCB12
  KVM: nSVM: Restrict mapping VMCB12 on nested VMRUN
  KVM: nSVM: Simplify nested_svm_vmrun()
  KVM: nSVM: Sanitize control fields copied from VMCB12
  KVM: nSVM: Only copy NP_ENABLE from VMCB01's nested_ctl

 arch/x86/include/asm/svm.h                    |  31 +-
 arch/x86/kvm/svm/nested.c                     | 335 +++++++++++-------
 arch/x86/kvm/svm/sev.c                        |   4 +-
 arch/x86/kvm/svm/svm.c                        |  51 ++-
 arch/x86/kvm/svm/svm.h                        |  46 ++-
 tools/testing/selftests/kvm/include/x86/svm.h |  14 +-
 6 files changed, 302 insertions(+), 179 deletions(-)

-- 
2.51.2.1026.g39e6a42477-goog


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

end of thread, other threads:[~2025-11-08  2:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-04 19:59 [PATCH 00/11] Nested SVM fixes, cleanups, and hardening Yosry Ahmed
2025-11-04 19:59 ` [PATCH 01/11] KVM: nSVM: Fix consistency checks for NP_ENABLE Yosry Ahmed
2025-11-05 18:52   ` Yosry Ahmed
2025-11-04 19:59 ` [PATCH 02/11] KVM: nSVM: Add missing consistency check for EFER, CR0, CR4, and CS Yosry Ahmed
2025-11-04 19:59 ` [PATCH 03/11] KVM: nSVM: Add missing consistency check for event_inj Yosry Ahmed
2025-11-05 18:48   ` Sean Christopherson
2025-11-05 19:29     ` Yosry Ahmed
2025-11-06  1:17       ` Sean Christopherson
2025-11-08  2:29         ` Yosry Ahmed
2025-11-04 19:59 ` [PATCH 04/11] KVM: SVM: Rename vmcb->nested_ctl to vmcb->misc_ctl Yosry Ahmed
2025-11-04 19:59 ` [PATCH 05/11] KVM: SVM: Rename vmcb->virt_ext to vmcb->misc_ctl2 Yosry Ahmed
2025-11-04 19:59 ` [PATCH 06/11] KVM: SVM: switch svm_copy_lbrs() to a macro Yosry Ahmed
2025-11-04 19:59 ` [PATCH 07/11] KVM: nSVM: Cache all used fields from VMCB12 Yosry Ahmed
2025-11-04 19:59 ` [PATCH 08/11] KVM: nSVM: Restrict mapping VMCB12 on nested VMRUN Yosry Ahmed
2025-11-04 19:59 ` [PATCH 09/11] KVM: nSVM: Simplify nested_svm_vmrun() Yosry Ahmed
2025-11-04 19:59 ` [PATCH 10/11] KVM: nSVM: Sanitize control fields copied from VMCB12 Yosry Ahmed
2025-11-04 19:59 ` [PATCH 11/11] KVM: nSVM: Only copy NP_ENABLE from VMCB01's nested_ctl Yosry Ahmed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).