]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: Turn on SILO mode by default on Arm
authorJulien Grall <julien.grall@arm.com>
Mon, 29 Apr 2019 14:05:25 +0000 (15:05 +0100)
committerJulien Grall <julien.grall@arm.com>
Fri, 14 Jun 2019 13:43:47 +0000 (14:43 +0100)
On Arm, exclusive load-store atomics should only be used between trusted
thread. As not all the guests are trusted, it may be possible to DoS Xen
when updating shared memory with guest atomically.

Recent patches introduced new helpers to update shared memory with guest
atomically. Those helpers relies on a memory region to be be shared with
Xen and a single guest.

At the moment, nothing prevent a guest sharing a page with Xen and as
well with another guest (e.g via grant table).

For the scope of the XSA, the quickest way is to deny communications
between unprivileged guest. So this patch is enabling and using SILO
mode by default on Arm.

Users wanted finer graine policy could wrote their own Flask policy.

This is part of XSA-295.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/arm/setup.c
xen/common/Kconfig
xen/include/xsm/xsm.h
xen/xsm/xsm_core.c

index 032a6a882d9cda4c2b925349543261ed3df714cb..8372cd26f6c2d5ae45df9596ef40494d79d4a28a 100644 (file)
@@ -37,6 +37,7 @@
 #include <xen/vmap.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/acpi.h>
+#include <xen/warning.h>
 #include <asm/alternative.h>
 #include <asm/page.h>
 #include <asm/current.h>
@@ -800,8 +801,11 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     tasklet_subsys_init();
 
-
-    xsm_dt_init();
+    if ( xsm_dt_init() != 1 )
+        warning_add("WARNING: SILO mode is not enabled.\n"
+                    "It has implications on the security of the system,\n"
+                    "unless the communications have been forbidden between\n"
+                    "untrusted domains.\n");
 
     init_maintenance_interrupt();
     init_timer_interrupt();
index 43810fc02640324843c8e3d8746e51db5788e1b5..97229c2f7186401414455c52bad7030350eb6cd7 100644 (file)
@@ -90,7 +90,7 @@ config XENOPROF
 
 config XSM
        bool "Xen Security Modules support"
-       default n
+       default ARM
        ---help---
          Enables the security framework known as Xen Security Modules which
          allows administrators fine-grained control over a Xen domain and
@@ -155,6 +155,7 @@ config XSM_SILO
 choice
        prompt "Default XSM implementation"
        depends on XSM
+       default XSM_SILO_DEFAULT if XSM_SILO && ARM
        default XSM_FLASK_DEFAULT if XSM_FLASK
        default XSM_SILO_DEFAULT if XSM_SILO
        default XSM_DUMMY_DEFAULT
index a90a58e3a71d1d6927fb6837a2db8e2a90c8caff..0845cb06ae4d47441190723a3ec299dd645dc56a 100644 (file)
@@ -706,6 +706,11 @@ extern int xsm_multiboot_policy_init(unsigned long *module_map,
 #endif
 
 #ifdef CONFIG_HAS_DEVICE_TREE
+/*
+ * Initialize XSM
+ *
+ * On success, return 1 if using SILO mode else 0.
+ */
 extern int xsm_dt_init(void);
 extern int xsm_dt_policy_init(void **policy_buffer, size_t *policy_size);
 extern bool has_xsm_magic(paddr_t);
index 91ef8a70b77bf057b8ffa40d78222573ceec3418..2a2100929d12416295ce11988b3ef128964a393e 100644 (file)
@@ -164,7 +164,7 @@ int __init xsm_dt_init(void)
 
     xfree(policy_buffer);
 
-    return ret;
+    return ret ?: (xsm_bootparam == XSM_BOOTPARAM_SILO);
 }
 
 /**