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:
Daniel De Graaf committed 2013-01-11 10:37:10 +00:00
1 parent 4b73f651d0
commit 2b7a98eed8
2 files changed
+9

No files matched your search

+7
View File
@@ -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);
}
+2
View File
@@ -78,6 +78,8 @@ class domain2
relabelfrom
relabelto
relabelself
make_priv_for
set_as_target
}
class hvm
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.