public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/7] SVM guest shadow stack support
@ 2022-10-12 20:39 John Allen
  2022-10-12 20:39 ` [RFC PATCH 1/7] KVM: x86: Move shared CET routine to common x86 kvm code John Allen
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: John Allen @ 2022-10-12 20:39 UTC (permalink / raw)
  To: kvm
  Cc: linux-kernel, pbonzini, weijiang.yang, rick.p.edgecombe, seanjc,
	x86, thomas.lendacky, John Allen

AMD Zen3 and newer processors support shadow stack, a feature designed to
protect against ROP (return-oriented programming) attacks in which an attacker
manipulates return addresses on the call stack in order to execute arbitrary
code. To prevent this, shadow stacks can be allocated that are only used by
control transfer and return instructions. When a CALL instruction is issued, it
writes the return address to both the program stack and the shadow stack. When
the subsequent RET instruction is issued, it pops the return address from both
stacks and compares them. If the addresses don't match, a control-protection
exception is raised.

Shadow stack and a related feature, Indirect Branch Tracking (IBT), are
collectively referred to as Control-flow Enforcement Technology (CET). However,
current AMD processors only support shadow stack and not IBT.

This series adds support for shadow stack in SVM guests and builds upon the
support added in the CET guest support patch series [1] and the CET kernel
patch series [2]. Additional patches are required to support shadow stack
enabled guests in qemu [3] and glibc [4].

[1]: CET guest support patches
https://lore.kernel.org/all/20220616084643.19564-1-weijiang.yang@intel.com/

[2]: Latest CET kernel patches
https://lore.kernel.org/all/20220929222936.14584-1-rick.p.edgecombe@intel.com/

[3]: CET qemu patches
https://patchwork.ozlabs.org/project/qemu-devel/patch/20201013051935.6052-2-weijiang.yang@intel.com/

[4]: glibc tree containing necessary updates
https://gitlab.com/x86-glibc/glibc/-/tree/users/hjl/cet/master/

John Allen (7):
  KVM: x86: Move shared CET routine to common x86 kvm code
  KVM: x86: SVM: Emulate reads and writes to shadow stack MSRs
  KVM: x86: SVM: Update dump_vmcb with shadow stack save area additions
  KVM: x86: SVM: Pass through shadow stack MSRs
  KVM: SVM: Save shadow stack host state on VMRUN
  KVM: SVM: Add MSR_IA32_XSS to the GHCB for hypervisor kernel
  KVM: SVM: Add CET features to supported_xss

 arch/x86/include/asm/svm.h |  1 +
 arch/x86/kvm/svm/sev.c     | 25 ++++++++++-
 arch/x86/kvm/svm/svm.c     | 85 ++++++++++++++++++++++++++++++++++++++
 arch/x86/kvm/svm/svm.h     |  2 +-
 arch/x86/kvm/vmx/vmx.c     | 32 ++------------
 arch/x86/kvm/x86.c         | 26 ++++++++++++
 arch/x86/kvm/x86.h         |  2 +
 7 files changed, 141 insertions(+), 32 deletions(-)

-- 
2.34.3


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

end of thread, other threads:[~2023-03-31  6:39 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-12 20:39 [RFC PATCH 0/7] SVM guest shadow stack support John Allen
2022-10-12 20:39 ` [RFC PATCH 1/7] KVM: x86: Move shared CET routine to common x86 kvm code John Allen
2022-10-12 20:39 ` [RFC PATCH 2/7] KVM: x86: SVM: Emulate reads and writes to shadow stack MSRs John Allen
2022-10-12 20:39 ` [RFC PATCH 3/7] KVM: x86: SVM: Update dump_vmcb with shadow stack save area additions John Allen
2022-10-12 20:39 ` [RFC PATCH 4/7] KVM: x86: SVM: Pass through shadow stack MSRs John Allen
2022-10-12 20:39 ` [RFC PATCH 5/7] KVM: SVM: Save shadow stack host state on VMRUN John Allen
2022-10-12 20:39 ` [RFC PATCH 6/7] KVM: SVM: Add MSR_IA32_XSS to the GHCB for hypervisor kernel John Allen
2022-10-12 20:39 ` [RFC PATCH 7/7] KVM: SVM: Add CET features to supported_xss John Allen
2023-01-25  0:51   ` Sean Christopherson
2023-01-25  0:55 ` [RFC PATCH 0/7] SVM guest shadow stack support Sean Christopherson
2023-01-25  1:11   ` Edgecombe, Rick P
2023-03-28 17:51     ` John Allen
2023-03-29  0:16       ` Yang, Weijiang
2023-03-30  5:37         ` Yang, Weijiang
2023-03-30 19:47           ` John Allen
2023-03-30 20:05             ` Sean Christopherson
2023-03-31  6:39               ` Yang, Weijiang
2023-01-25 17:07   ` John Allen

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