From 339ad2c681cd10df1476b581118a1ff9b644f53e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 2 Jun 2015 16:27:15 +0900 Subject: [PATCH] 3.10-stable patches added patches: kvm-mmu-fix-cr4.smep-1-cr0.wp-0-with-shadow-pages.patch --- ...r4.smep-1-cr0.wp-0-with-shadow-pages.patch | 32 +++++++++++++++++++ queue-3.10/series | 1 + 2 files changed, 33 insertions(+) create mode 100644 queue-3.10/kvm-mmu-fix-cr4.smep-1-cr0.wp-0-with-shadow-pages.patch diff --git a/queue-3.10/kvm-mmu-fix-cr4.smep-1-cr0.wp-0-with-shadow-pages.patch b/queue-3.10/kvm-mmu-fix-cr4.smep-1-cr0.wp-0-with-shadow-pages.patch new file mode 100644 index 00000000000..a94dad39061 --- /dev/null +++ b/queue-3.10/kvm-mmu-fix-cr4.smep-1-cr0.wp-0-with-shadow-pages.patch @@ -0,0 +1,32 @@ +From 898761158be7682082955e3efa4ad24725305fc7 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Thu, 2 Apr 2015 11:04:05 +0200 +Subject: KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages + +From: Paolo Bonzini + +commit 898761158be7682082955e3efa4ad24725305fc7 upstream. + +smep_andnot_wp is initialized in kvm_init_shadow_mmu and shadow pages +should not be reused for different values of it. Thus, it has to be +added to the mask in kvm_mmu_pte_write. + +Reviewed-by: Xiao Guangrong +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/mmu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kvm/mmu.c ++++ b/arch/x86/kvm/mmu.c +@@ -3975,7 +3975,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu * + ++vcpu->kvm->stat.mmu_pte_write; + kvm_mmu_audit(vcpu, AUDIT_PRE_PTE_WRITE); + +- mask.cr0_wp = mask.cr4_pae = mask.nxe = 1; ++ mask.cr0_wp = mask.cr4_pae = mask.nxe = mask.smep_andnot_wp = 1; + for_each_gfn_indirect_valid_sp(vcpu->kvm, sp, gfn) { + if (detect_write_misaligned(sp, gpa, bytes) || + detect_write_flooding(sp)) { diff --git a/queue-3.10/series b/queue-3.10/series index 04badf4c4d2..dd92501deb3 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -5,3 +5,4 @@ staging-rtl8712-rtl8712-avoid-lots-of-build-warnings.patch staging-rtl8192e-llvmlinux-remove-unused-inline-prototype.patch kernel-use-the-gnu89-standard-explicitly.patch net-socket-fix-the-wrong-returns-for-recvmsg-and-sendmsg.patch +kvm-mmu-fix-cr4.smep-1-cr0.wp-0-with-shadow-pages.patch -- 2.47.3