Message ID | 20250107092719.26401-3-michal.orzel@amd.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | xen/flask: Wire up missing hypercalls | expand |
On 1/7/25 04:27, Michal Orzel wrote: > Addition of FLASK permission for this hypercall was overlooked in the > original patch. Fix it. The only dt overlay operation is attaching that can > happen only after the domain is created. Dom0 can attach overlay to itself > as well. > > Fixes: 4c733873b5c2 ("xen/arm: Add XEN_DOMCTL_dt_overlay and device attachment to domains") > Signed-off-by: Michal Orzel <michal.orzel@amd.com> Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
diff --git a/tools/flask/policy/modules/dom0.te b/tools/flask/policy/modules/dom0.te index 16b8c9646d1b..f148bfbf274e 100644 --- a/tools/flask/policy/modules/dom0.te +++ b/tools/flask/policy/modules/dom0.te @@ -40,7 +40,7 @@ allow dom0_t dom0_t:domain { }; allow dom0_t dom0_t:domain2 { set_cpu_policy gettsc settsc setscheduler set_vnumainfo - get_vnumainfo psr_cmt_op psr_alloc get_cpu_policy + get_vnumainfo psr_cmt_op psr_alloc get_cpu_policy dt_overlay }; allow dom0_t dom0_t:resource { add remove }; diff --git a/tools/flask/policy/modules/xen.if b/tools/flask/policy/modules/xen.if index ba9e91d30201..def60da88301 100644 --- a/tools/flask/policy/modules/xen.if +++ b/tools/flask/policy/modules/xen.if @@ -94,7 +94,7 @@ define(`manage_domain', ` getaddrsize pause unpause trigger shutdown destroy setaffinity setdomainmaxmem getscheduler resume setpodtarget getpodtarget getpagingmempool setpagingmempool }; - allow $1 $2:domain2 set_vnumainfo; + allow $1 $2:domain2 { set_vnumainfo dt_overlay }; ') # migrate_domain_out(priv, target) diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 5118f86cf030..e263e745d441 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -844,6 +844,9 @@ static int cf_check flask_domctl(struct domain *d, unsigned int cmd, case XEN_DOMCTL_set_paging_mempool_size: return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPAGINGMEMPOOL); + case XEN_DOMCTL_dt_overlay: + return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__DT_OVERLAY); + default: return avc_unknown_permission("domctl", cmd); } diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors index 7cbdb7ea6408..78fe37583b18 100644 --- a/xen/xsm/flask/policy/access_vectors +++ b/xen/xsm/flask/policy/access_vectors @@ -253,6 +253,8 @@ class domain2 get_cpu_policy # XEN_DOMCTL_vuart_op vuart_op +# XEN_DOMCTL_dt_overlay + dt_overlay } # Similar to class domain, but primarily contains domctls related to HVM domains
Addition of FLASK permission for this hypercall was overlooked in the original patch. Fix it. The only dt overlay operation is attaching that can happen only after the domain is created. Dom0 can attach overlay to itself as well. Fixes: 4c733873b5c2 ("xen/arm: Add XEN_DOMCTL_dt_overlay and device attachment to domains") Signed-off-by: Michal Orzel <michal.orzel@amd.com> --- tools/flask/policy/modules/dom0.te | 2 +- tools/flask/policy/modules/xen.if | 2 +- xen/xsm/flask/hooks.c | 3 +++ xen/xsm/flask/policy/access_vectors | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-)