Skip to contentSkip to conversation

Patch "arm64: KVM: Fix host crash when injecting a fault into a 32bit guest" has been added to the 4.1-stable tree

PATCH [email protected] 1 participant 1 message Sep 11, 2015

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

arm64: KVM: Fix host crash when injecting a fault into a 32bit guest

to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
arm64-kvm-fix-host-crash-when-injecting-a-fault-into-a-32bit-guest.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 126c69a0bd0e441bf6766a5d9bf20de011be9f68 Mon Sep 17 00:00:00 2001

From: Marc Zyngier <[email protected]>
Date: Thu, 27 Aug 2015 16:10:01 +0100
Subject: arm64: KVM: Fix host crash when injecting a fault into a 32bit guest

From: Marc Zyngier <[email protected]>

commit 126c69a0bd0e441bf6766a5d9bf20de011be9f68 upstream.

When injecting a fault into a misbehaving 32bit guest, it seems rather idiotic to also inject a 64bit fault that is only going to corrupt the guest state. This leads to a situation where we perform an illegal exception return at EL2 causing the host to crash instead of killing the guest.

Just fix the stupid bug that has been there from day 1.

---
 arch/arm64/kvm/inject_fault.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm64/kvm/inject_fault.c +6 -6
@@ -168,8 +168,8 @@ void kvm_inject_dabt(struct kvm_vcpu *vc
 {
 	if (!(vcpu->arch.hcr_el2 & HCR_RW))
 		inject_abt32(vcpu, false, addr);
-
-	inject_abt64(vcpu, false, addr);
+	else
+		inject_abt64(vcpu, false, addr);
 }
 
 /**
@@ -184,8 +184,8 @@ void kvm_inject_pabt(struct kvm_vcpu *vc
 {
 	if (!(vcpu->arch.hcr_el2 & HCR_RW))
 		inject_abt32(vcpu, true, addr);
-
-	inject_abt64(vcpu, true, addr);
+	else
+		inject_abt64(vcpu, true, addr);
 }
 
 /**
@@ -198,6 +198,6 @@ void kvm_inject_undefined(struct kvm_vcp
 {
 	if (!(vcpu->arch.hcr_el2 & HCR_RW))
 		inject_undef32(vcpu);
-
-	inject_undef64(vcpu);
+	else
+		inject_undef64(vcpu);
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.1/irqchip-crossbar-restore-the-mask-on-suspend-behaviour.patch queue-4.1/genirq-don-t-return-enosys-in-irq_chip_retrigger_hierarchy.patch queue-4.1/irqchip-crossbar-restore-set_wake-functionality.patch queue-4.1/arm64-kvm-fix-host-crash-when-injecting-a-fault-into-a-32bit-guest.patch queue-4.1/irqchip-crossbar-restore-the-irq_set_type-mechanism.patch queue-4.1/genirq-introduce-irq_chip_set_type_parent-helper.patch queue-4.1/arm-omap-wakeupgen-restore-the-irq_set_type-mechanism.patch