WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xen: fix XEN_DOMCTL_memory_mapping to not return wit

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xen: fix XEN_DOMCTL_memory_mapping to not return with domain RCU lock held
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 17 Jan 2011 14:16:48 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 17 Jan 2011 06:18:32 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xen: fix XEN_DOMCTL_memory_mapping to not return with domain RCU lock held, Ian Campbell <=