]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
xen/arm: Don't allow dom0 to access to vpl011 UART0 memory range
authorJulien Grall <julien.grall@linaro.org>
Fri, 10 May 2013 02:17:48 +0000 (03:17 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 10 May 2013 13:17:05 +0000 (14:17 +0100)
As vpl011 UART is not initialized for dom 0, when the domain tries to access to
this range, a segfault will occur in Xen. The right behaviour should be a data
abort for the guest.

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

index 9472d0a4085a54d417f7110c04df18560499c722..13ba62385976fca5bf2b3b9ab5946702aa863d84 100644 (file)
@@ -85,7 +85,9 @@ static void uart0_print_char(char c)
 
 static int uart0_mmio_check(struct vcpu *v, paddr_t addr)
 {
-    return addr >= UART0_START && addr < UART0_END;
+    struct domain *d = v->domain;
+
+    return d->domain_id != 0 && addr >= UART0_START && addr < UART0_END;
 }
 
 static int uart0_mmio_read(struct vcpu *v, mmio_info_t *info)