xen/arm: Don't emulate the MMIO access if the instruction syndrome is invalid
authorJulien Grall <julien.grall@linaro.org>
Thu, 25 Jul 2013 15:21:30 +0000 (16:21 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 29 Jul 2013 15:54:48 +0000 (16:54 +0100)
When the instruction syndrome is not valid, the transfer register is unknown.
If this register is used in the emulation code (it's the case for the VGIC),
Xen can retrieve wrong data.

For safety, consider invalid instruction syndrome as wrong memory access.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/traps.c

index f2ffcb7ae5f1808362e5ada3fdb970f7d69ca9b3..29690396e351042ff521a6af2c463fd77415a9b7 100644 (file)
@@ -1010,6 +1010,10 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
     if ( rc == -EFAULT )
         goto bad_data_abort;
 
+    /* XXX: Decode the instruction if ISS is not valid */
+    if ( !dabt.valid )
+        goto bad_data_abort;
+
     if (handle_mmio(&info))
     {
         regs->pc += dabt.len ? 4 : 2;