From 08a6895af8535b852ff4368c30a0c968a69ab1ad Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 24 Jul 2014 12:28:22 +0100 Subject: [PATCH 3/3] xen: arm: Handle traps from 32-bit userspace on 64-bit kernel as undef We are not setup to handle these properly. This turns a host crash into a trap to the guest kernel which will likely result in killing the offending process. This is part of XSA-102. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/traps.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 6536209..e763f12 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -1812,6 +1812,17 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs) { union hsr hsr = { .bits = READ_SYSREG32(ESR_EL2) }; + /* + * We currently do not handle 32-bit userspace on 64-bit kernels + * correctly (See XSA-102). Until that is resolved we treat any + * trap from 32-bit userspace on 64-bit kernel as undefined. + */ + if ( is_pv64_domain(current->domain) && psr_mode_is_32bit(regs->cpsr) ) + { + inject_undef_exception(regs, hsr.len); + return; + } + switch (hsr.ec) { case HSR_EC_WFI_WFE: if ( !check_conditional_instr(regs, hsr) ) -- 1.7.10.4