[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 08/11] xen/cpupool: prevent a domain from moving itself
In the XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN operation, the existing check for domid == 0 should be checking that a domain does not attempt to modify its own cpupool; fix this by using rcu_lock_remote_domain_by_id. Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> Cc: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx> Cc: Jan Beulich <JBeulich@xxxxxxxx> --- xen/common/cpupool.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index 10b10f8..c901f7e 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -546,12 +546,8 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) { struct domain *d; - ret = -EINVAL; - if ( op->domid == 0 ) - break; - ret = -ESRCH; - d = rcu_lock_domain_by_id(op->domid); - if ( d == NULL ) + ret = rcu_lock_remote_domain_by_id(op->domid, &d); + if ( ret ) break; if ( d->cpupool == NULL ) { -- 1.8.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |