xen: use XSM instead of IS_PRIV for getdomaininfo
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Sat, 28 Jan 2012 13:49:05 +0000 (13:49 +0000)
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>
Sat, 28 Jan 2012 13:49:05 +0000 (13:49 +0000)
The XEN_DOMCTL_getdomaininfo domctl does not allow manipulation of
domains, only basic information such as size and state, so its use
does not fully justify making a domain privileged. XSM modules can
also provide fine-grained control over what domains are visible to
domains that call getdomaininfo.

If XSM is disabled (either at compile time or by using the dummy XSM
module) then there is no change in behavior: only IS_PRIV domains can
use this domctl. If enabled, the XSM module controls access.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
xen/common/domctl.c
xen/xsm/dummy.c

index 8001a916cce7561e490629f6176f54ae6694178a..904fb45e8fd3b1f1cc38fe4daa49bcc0a0290761 100644 (file)
@@ -264,6 +264,10 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
             return -EPERM;
         break;
     }
+#ifdef XSM_ENABLE
+    case XEN_DOMCTL_getdomaininfo:
+        break;
+#endif
     default:
         if ( !IS_PRIV(current->domain) )
             return -EPERM;
index acf9c8a9d2484e7fc4c2821524edbfe913701821..d99f8860d1fedd16f17562e27824075e091ca7e8 100644 (file)
@@ -66,6 +66,8 @@ static int dummy_scheduler (struct domain *d)
 
 static int dummy_getdomaininfo (struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }