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

Re: [Xen-devel] [PATCH 08/11] xen/cpupool: prevent a domain from moving itself


  • To: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
  • From: Jürgen Groß <juergen.gross@xxxxxxxxxxxxxx>
  • Date: Fri, 19 Apr 2013 11:43:06 +0200
  • Cc: Jan Beulich <JBeulich@xxxxxxxx>, xen-devel@xxxxxxxxxxxxx
  • Delivery-date: Fri, 19 Apr 2013 09:43:28 +0000
  • Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:User-Agent: MIME-Version:To:CC:Subject:References:In-Reply-To: Content-Type:Content-Transfer-Encoding; b=VrP8PNEmlwfYAkMZ/uvDHyaYR1QPTHRJfW+n5SGz2PEmxbL18+9sK8QF oVZOJI1vt/VXnR5NBKOFUoszfckyCXBtgeK1csHQ4C1PfalHn1C1MlySs dsrcPN7BddlHSgkX3HNDm0vxWCKHTMHKcKILvFJblZ9EVlnKDOmUTn/y3 F4VOMBxtcWZIV5gY/enFvexAcgN1+07x5DOZJhboOqcWWikjsrY0A451V 1PP7FUSPdmcfjS587zu9SZVQm9FPq;
  • List-id: Xen developer discussion <xen-devel.lists.xen.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 <dgdegra@xxxxxxxxxxxxx>
Cc: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Cc: Jan Beulich <JBeulich@xxxxxxxx>

Sorry for late answer, but I'm on vacation and reading mails not very often...

Acked-by: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>

---
  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 )
          {



_______________________________________________
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®.