[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen: use XSM instead of IS_PRIV for getvcpuinfo



(Following the reasoning of changeset 24620)

The XEN_DOMCTL_getvcpuinfo domctl only reads the status of
a vcpu and does not manipulate it. Since XSM modules provides
fine-grained control, it is better to use XSM as opposed to IS_PRIV.


Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>

diff -r 3c426da4788e xen/common/domctl.c
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -268,6 +268,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
     }
 #ifdef XSM_ENABLE
     case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_getvcpuinfo:
         break;
 #endif
     default:
diff -r 3c426da4788e xen/xsm/dummy.c
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -78,6 +78,8 @@ static int dummy_getvcpucontext (struct

 static int dummy_getvcpuinfo (struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.