aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_create.c
diff options
context:
space:
mode:
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>2012-12-13 11:44:02 +0000
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>2012-12-13 11:44:02 +0000
commita31ed4edbe48c8f24b4a7f1f41c7cc9d7453721e (patch)
tree6f4794c68644445b60cd3c77df161077543bdcb7 /tools/libxl/libxl_create.c
parentb051ddb41617ba543ee8de5cfc3258a0a2b71aa6 (diff)
downloadxen-a31ed4edbe48c8f24b4a7f1f41c7cc9d7453721e.tar.gz
xen-a31ed4edbe48c8f24b4a7f1f41c7cc9d7453721e.tar.bz2
xen-a31ed4edbe48c8f24b4a7f1f41c7cc9d7453721e.zip
libxl: introduce XSM relabel on build
Allow a domain to be built under one security label and run using a different label. This can be used to prevent the domain builder or control domain from having the ability to access a guest domain's memory via map_foreign_range except during the build process where this is required. Example domain configuration snippet: seclabel='customer_1:vm_r:nomigrate_t' init_seclabel='customer_1:vm_r:nomigrate_t_building' Note: this does not provide complete protection from a malicious dom0; mappings created during the build process may persist after the relabel, and could be used to indirectly access the guest's memory. However, if dom0 correctly unmaps the domain upon building, a the domU is protected against dom0 becoming malicious in the future. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl_create.c')
-rw-r--r--tools/libxl/libxl_create.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 9d20086347..b183255568 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1182,6 +1182,10 @@ static void domcreate_complete(libxl__egc *egc,
int rc)
{
STATE_AO_GC(dcs->ao);
+ libxl_domain_config *const d_config = dcs->guest_config;
+
+ if (!rc && d_config->b_info.exec_ssidref)
+ rc = xc_flask_relabel_domain(CTX->xch, dcs->guest_domid, d_config->b_info.exec_ssidref);
if (rc) {
if (dcs->guest_domid) {