All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, jgross@suse.com,
	Bertrand.Marquis@arm.com, julien@xen.org,
	Volodymyr_Babchuk@epam.com,
	Stefano Stabellini <stefano.stabellini@xilinx.com>
Subject: [PATCH v4 3/9] xen/arm: temporarily elevate idle_domain privileged during create_domUs
Date: Thu, 31 Mar 2022 17:38:41 -0700	[thread overview]
Message-ID: <20220401003847.38393-3-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2203311735380.2910984@ubuntu-linux-20-04-desktop>

From: Stefano Stabellini <stefano.stabellini@xilinx.com>

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 <stefano.stabellini@xilinx.com>
---
 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 b6189b935d..100a4959a8 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -27,6 +27,7 @@
 #include <asm/setup.h>
 #include <asm/cpufeature.h>
 #include <asm/domain_build.h>
+#include <xsm/xsm.h>
 
 #include <xen/irq.h>
 #include <xen/grant_table.h>
@@ -3210,6 +3211,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)
     {
@@ -3291,6 +3294,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



  parent reply	other threads:[~2022-04-01  0:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  0:38 [PATCH v4 0/9] dom0less PV drivers Stefano Stabellini
2022-04-01  0:38 ` [PATCH v4 1/9] xen/dt: dt_property_read_string should return -ENODATA on !length Stefano Stabellini
2022-04-01  8:05   ` Henry Wang
2022-04-01  0:38 ` [PATCH v4 2/9] xen/arm: implement domU extended regions Stefano Stabellini
2022-04-01 13:52   ` Luca Fancellu
2022-04-01 14:34   ` Julien Grall
2022-04-01  0:38 ` Stefano Stabellini [this message]
2022-04-01 17:36   ` [PATCH v4 3/9] xen/arm: temporarily elevate idle_domain privileged during create_domUs Julien Grall
2022-04-01  0:38 ` [PATCH v4 4/9] xen: export evtchn_alloc_unbound Stefano Stabellini
2022-04-05  9:50   ` Jan Beulich
2022-04-01  0:38 ` [PATCH v4 5/9] xen: introduce xen,enhanced dom0less property Stefano Stabellini
2022-04-01  0:38 ` [PATCH v4 6/9] xen/arm: configure dom0less domain for enabling xenstore after boot Stefano Stabellini
2022-04-01  0:38 ` [PATCH v4 7/9] xenstored: send an evtchn notification on introduce_domain Stefano Stabellini
2022-04-01 12:48   ` Juergen Gross
2022-04-01  0:38 ` [PATCH v4 8/9] tools: add example application to initialize dom0less PV drivers Stefano Stabellini
2022-04-01 10:21   ` Julien Grall
2022-04-01 10:46     ` Juergen Gross
2022-04-01 13:35       ` Julien Grall
2022-04-01 13:52         ` Juergen Gross
2022-04-01 14:04           ` Julien Grall
2022-04-01 14:11             ` Juergen Gross
2022-04-06  2:21       ` Stefano Stabellini
2022-04-06  8:58         ` Julien Grall
2022-04-13  1:22           ` Stefano Stabellini
2022-04-01  0:38 ` [PATCH v4 9/9] docs: document dom0less + " Stefano Stabellini
2022-04-01 10:48   ` Luca Fancellu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220401003847.38393-3-sstabellini@kernel.org \
    --to=sstabellini@kernel.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=stefano.stabellini@xilinx.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.