Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 126c69a0 authored by Marc Zyngier's avatar Marc Zyngier Committed by Will Deacon
Browse files

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



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.

Cc: <stable@vger.kernel.org>
Reported-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Tested-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent c13dcf9f
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr)
{
	if (!(vcpu->arch.hcr_el2 & HCR_RW))
		inject_abt32(vcpu, false, addr);

	else
		inject_abt64(vcpu, false, addr);
}

@@ -184,7 +184,7 @@ void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr)
{
	if (!(vcpu->arch.hcr_el2 & HCR_RW))
		inject_abt32(vcpu, true, addr);

	else
		inject_abt64(vcpu, true, addr);
}

@@ -198,6 +198,6 @@ void kvm_inject_undefined(struct kvm_vcpu *vcpu)
{
	if (!(vcpu->arch.hcr_el2 & HCR_RW))
		inject_undef32(vcpu);

	else
		inject_undef64(vcpu);
}