mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
xsm/flask: Add checks on the domain performing the set_target operation
The existing domain__set_target check only verifies that the source and target domains can be associated. We also need to check that the privileged domain making this association is allowed to do so. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
This commit is contained in:
1 parent
4b73f651d0
commit
2b7a98eed8
2 files changed
+9
No files matched your search
@@ -577,6 +577,13 @@ static int flask_domain_settime(struct domain *d)
|
||||
|
||||
static int flask_set_target(struct domain *d, struct domain *e)
|
||||
{
|
||||
int rc;
|
||||
rc = domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
|
||||
if ( rc )
|
||||
return rc;
|
||||
rc = domain_has_perm(current->domain, e, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
|
||||
if ( rc )
|
||||
return rc;
|
||||
return domain_has_perm(d, e, SECCLASS_DOMAIN, DOMAIN__SET_TARGET);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,8 @@ class domain2
|
||||
relabelfrom
|
||||
relabelto
|
||||
relabelself
|
||||
make_priv_for
|
||||
set_as_target
|
||||
}
|
||||
|
||||
class hvm
|
||||
|
||||