Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1238302
| From | Jiri Slaby <jslaby@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.12 10/84] arm64: KVM: Fix host crash when injecting a fault into a 32bit guest |
| Date | 2015-10-02 16:00 +0200 |
| Message-ID | <qf92t-5aj-67@gated-at.bofh.it> (permalink) |
| References | <qf8zn-4Bq-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Marc Zyngier <marc.zyngier@arm.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
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.
Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/arm64/kvm/inject_fault.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/kvm/inject_fault.c b/arch/arm64/kvm/inject_fault.c
index 81a02a8762b0..86825f8883de 100644
--- a/arch/arm64/kvm/inject_fault.c
+++ b/arch/arm64/kvm/inject_fault.c
@@ -168,8 +168,8 @@ void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr)
{
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 *vcpu, unsigned long addr)
{
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_vcpu *vcpu)
{
if (!(vcpu->arch.hcr_el2 & HCR_RW))
inject_undef32(vcpu);
-
- inject_undef64(vcpu);
+ else
+ inject_undef64(vcpu);
}
--
2.6.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 3.12 00/84] 3.12.49-stable review Jiri Slaby <jslaby@suse.cz> - 2015-10-02 16:00 +0200
[PATCH 3.12 01/84] PCI: Add dev_flags bit to access VPD through function 0 Jiri Slaby <jslaby@suse.cz> - 2015-10-02 16:00 +0200
[PATCH 3.12 09/84] crypto: caam - fix memory corruption in ahash_final_ctx Jiri Slaby <jslaby@suse.cz> - 2015-10-02 16:00 +0200
[PATCH 3.12 20/84] usb: host: ehci-sys: delete useless bus_to_hcd conversion Jiri Slaby <jslaby@suse.cz> - 2015-10-02 16:00 +0200
[PATCH 3.12 02/84] PCI: Add VPD function 0 quirk for Intel Ethernet devices Jiri Slaby <jslaby@suse.cz> - 2015-10-02 16:00 +0200
[PATCH 3.12 10/84] arm64: KVM: Fix host crash when injecting a fault into a 32bit guest Jiri Slaby <jslaby@suse.cz> - 2015-10-02 16:00 +0200
[PATCH 3.12 07/84] libfc: Fix fc_fcp_cleanup_each_cmd() Jiri Slaby <jslaby@suse.cz> - 2015-10-02 16:00 +0200
[PATCH 3.12 04/84] staging: comedi: usbduxsigma: don't clobber ao_timer in command test Jiri Slaby <jslaby@suse.cz> - 2015-10-02 16:00 +0200
Re: [PATCH 3.12 00/84] 3.12.49-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2015-10-02 17:40 +0200
Re: [PATCH 3.12 00/84] 3.12.49-stable review Guenter Roeck <linux@roeck-us.net> - 2015-10-02 18:10 +0200
csiph-web