diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2013-04-23 11:48:11 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-04-23 11:48:11 +0200 |
commit | bb812101db5117e07de1b557b355c3855850cc95 (patch) | |
tree | 64956a82913e7ccf27a59ae014e34d3c66ebaeec /xen/common | |
parent | 96ef6e88359910738905ac2e1969dc05d7d7e7dc (diff) | |
download | xen-bb812101db5117e07de1b557b355c3855850cc95.tar.gz xen-bb812101db5117e07de1b557b355c3855850cc95.tar.bz2 xen-bb812101db5117e07de1b557b355c3855850cc95.zip |
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@tycho.nsa.gov>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Diffstat (limited to 'xen/common')
-rw-r--r-- | xen/common/cpupool.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index 2aaa48610c..2164a9fc72 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -576,12 +576,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 ) { |