On 06/07/2016 03:22 PM, Konrad Rzeszutek Wilk wrote:
On Mon, May 23, 2016 at 11:05:29AM -0400, Daniel De Graaf wrote:
This makes it easier to enable or disable parts of the XSM policy.
Hey Daniel,
I am no expert on this so please take it with a grain of salt.
That can actually be helpful to spot documentation problems :)
.. snip..
diff --git a/tools/flask/policy/modules/default_role.te
b/tools/flask/policy/modules/default_role.te
new file mode 100644
index 0000000..74f870f
--- /dev/null
+++ b/tools/flask/policy/modules/default_role.te
@@ -0,0 +1,8 @@
+# Allow all domains to use system_r so that systems that are not using the
+# user/role separation feature will work properly.
+role system_r types domain_type;
In the 'original' code it also had : xen_type :
266 role system_r types { xen_type domain_type };
Is this change done on purpose? Reading the xen.te it describes the 'system_r'
as:
"The system role is used for utility domains and pseudo-domains
"
which is .. confusing. What is an utility domain? Pseudo-domain?
Utility domains would be a domain that is not actually a part of a guest,
such as xenstore, vtpm-manager, and disaggregated components of dom0.
Pseudo-domain is the term used here to refer to DOMID_XEN and DOMID_IO.
Is there a better name for this?
[Looking in the new xen.te I see that it has the same syntax]
+
+# The vm role is used as part of user separation. Allow all domain types to
use
+# this role except dom0.
+role vm_r;
+role vm_r types { domain_type -dom0_t };
diff --git a/tools/flask/policy/modules/dom0.te
b/tools/flask/policy/modules/dom0.te
new file mode 100644
index 0000000..dd4d7dd
--- /dev/null
+++ b/tools/flask/policy/modules/dom0.te
@@ -0,0 +1,74 @@
+################################################################################
+#
+# Allow dom0 access to all sysctls, devices, and the security server.
+#
+# While this could be written more briefly using wildcards, the permissions are
+# listed out to make removing specific permissions simpler.
+#
+################################################################################
+allow dom0_t xen_t:xen {
+ settime tbufcontrol readconsole clearconsole perfcontrol mtrr_add
+ mtrr_del mtrr_read microcode physinfo quirk writeconsole readapic
+ writeapic privprofile nonprivprofile kexec firmware sleep frequency
+ getidle debug getcpuinfo heap pm_op mca_op lockprof cpupool_op tmem_op
+ tmem_control getscheduler setscheduler
+};
+allow dom0_t xen_t:xen2 {
+ resource_op psr_cmt_op psr_cat_op pmu_ctrl get_symbol
+ get_cpu_levelling_caps get_cpu_featureset xsplice_op
Hehe. livepatch_op now :-)
I have a corrected series that also has some other pending hypervisor
patches, which I can post whenever the 4.8 merging window is fully
open.
.. giant snip...
diff --git a/tools/flask/policy/modules/xen.te
b/tools/flask/policy/modules/xen.te
new file mode 100644
index 0000000..f374dc5
--- /dev/null
+++ b/tools/flask/policy/modules/xen.te
.. snip..
+################################################################################
+#
+# Roles
+#
+################################################################################
+
+# The object role (object_r) is used for devices, resources, and event
channels;
+# it does not need to be defined here and should not be used for domains.
+
+# The system role is used for utility domains and pseudo-domains. If roles are
+# not being used for separation, all domains can use the system role.
+role system_r;
+role system_r types { xen_type dom0_t };
Right here it is back again.
Is the 'default_role' neccessary then?
Specifying some role is necessary to create a valid security label
(which is a user:role:type tuple).
The line in xen.te only allows the pseudo-domains and dom0 to use
system_r; this is a useful minimum, if you are going to place any
actual guests in another role. If you include default_role.te,
then this expands to allowing all domains to use system_r.
I could split the default_role extraction into a separate patch if
you think this explanation belongs in a commit message.
I've looked at the original xen.te and them splitting out to individual and
there were no
missing copy-n-paste (except the above 'default_role.te' which I am not
clear about).
Thanks!
--
Daniel De Graaf
National Security Agency
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel