| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/5] flask/policy: split into modules
 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.
.. 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?
[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 :-)
.. 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?
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!
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |