From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?J=FCrgen_Gro=DF?= Subject: Re: [PATCH 08/11] xen/cpupool: prevent a domain from moving itself Date: Fri, 19 Apr 2013 11:43:06 +0200 Message-ID: <517111AA.5080708@ts.fujitsu.com> References: <1365800659-26040-1-git-send-email-dgdegra@tycho.nsa.gov> <1365800659-26040-9-git-send-email-dgdegra@tycho.nsa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1365800659-26040-9-git-send-email-dgdegra@tycho.nsa.gov> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Daniel De Graaf Cc: Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Am 12.04.2013 23:04, schrieb Daniel De Graaf: > 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 > Cc: Juergen Gross > Cc: Jan Beulich Sorry for late answer, but I'm on vacation and reading mails not very often... Acked-by: Juergen Gross > --- > 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 ) > { >