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

[Xen-devel] [PATCH] xen: fix XEN_DOMCTL_memory_mapping to not return with domain RCU lock held



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1295273571 0
# Node ID dc8400e0efaff5251f642d8a98dba836719134c5
# Parent  15e53a2463f084c3adbbb21b4deb30d0d4f79b45
xen: fix XEN_DOMCTL_memory_mapping to not return with domain RCU lock held

Broken in 20358:ecc649ec3675

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 15e53a2463f0 -r dc8400e0efaf xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c     Mon Jan 17 14:12:50 2011 +0000
+++ b/xen/arch/x86/domctl.c     Mon Jan 17 14:12:51 2011 +0000
@@ -965,13 +965,13 @@ long arch_do_domctl(
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
+            break;
+
+        ret = -ESRCH;
+        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
         ret=0;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.