From 887a83d88d5dc6331c9296b1f513e3bda1ae75e8 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Thu, 31 Mar 2022 13:23:17 -0700 Subject: [PATCH 3/3] xen/arm: temporarily elevate idle_domain privileged during create_domUs create_domUs might call functions that perform XSM checks on the current domain, which is idle_domain at this time. Temporarily elevate idle_domain privileges in create_domUs. Signed-off-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 03c023440d..9a49ee7dcb 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -3254,6 +3255,8 @@ void __init create_domUs(void) struct dt_device_node *node; const struct dt_device_node *chosen = dt_find_node_by_path("/chosen"); + xsm_elevate_priv(current->domain); + BUG_ON(chosen == NULL); dt_for_each_child_node(chosen, node) { @@ -3335,6 +3338,8 @@ void __init create_domUs(void) if ( construct_domU(d, node) != 0 ) panic("Could not set up domain %s\n", dt_node_name(node)); } + + xsm_demote_priv(current->domain); } static int __init construct_dom0(struct domain *d) -- 2.25.1