]> xenbits.xensource.com Git - xen.git/commitdiff
xen: arm: handle AArch32 userspace when dumping 64-bit guest state.
authorIan Campbell <ian.campbell@citrix.com>
Tue, 12 Aug 2014 13:45:49 +0000 (15:45 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Aug 2014 13:45:49 +0000 (15:45 +0200)
A 64-bit guest can still be in 32-bit mode when running userspace,
handle this case by dumping the correct 32-bit state.

Note that on ARM it is not possible to change mode without the help
of the next exception level, hence there is no way a 64-bit guest can
be running in 32-bit kernel modes.

This is part of CVE-2014-5147 / XSA-102.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
master commit: fc0cafeab30fe93963457fafbad7a01c7f55ea5f
master date: 2014-08-12 15:32:27 +0200

xen/arch/arm/traps.c

index e2e2db37a058a3882b37b110d0b630ba7d4e1773..7367399f9b3467f8c05451f47128c24d6a89fe1a 100644 (file)
@@ -697,7 +697,17 @@ static void _show_registers(struct cpu_user_regs *regs,
             show_registers_32(regs, ctxt, guest_mode, v);
 #ifdef CONFIG_ARM_64
         else if ( is_pv64_domain(v->domain) )
-            show_registers_64(regs, ctxt, guest_mode, v);
+        {
+            if ( psr_mode_is_32bit(regs->cpsr) )
+            {
+                BUG_ON(!usr_mode(regs));
+                show_registers_32(regs, ctxt, guest_mode, v);
+            }
+            else
+            {
+                show_registers_64(regs, ctxt, guest_mode, v);
+            }
+        }
 #endif
     }
     else