Shakeel Butt
2012-Jul-23 14:47 UTC
[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@gmail.com> 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; }