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-changelog

[Xen-changelog] [xen-3.0.3-testing] [PRIVCMD] Fix ia64 domain creation b

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0.3-testing] [PRIVCMD] Fix ia64 domain creation by abstracting the singleshot mapping check.
From: "Xen patchbot-3.0.3-testing" <patchbot-3.0.3-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Oct 2006 17:15:18 -0700
Delivery-date: Fri, 13 Oct 2006 01:42:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1160649893 -3600
# Node ID d2e6a7be622d306528074b62ea21d0b672ebd0ea
# Parent  5297ced4d6102b08a890f9944eff98f3258e8eb5
[PRIVCMD] Fix ia64 domain creation by abstracting the singleshot mapping check.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff -r 5297ced4d610 -r d2e6a7be622d 
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
--- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Thu Oct 12 
11:26:07 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Thu Oct 12 
11:44:53 2006 +0100
@@ -34,6 +34,15 @@
 
 static struct proc_dir_entry *privcmd_intf;
 static struct proc_dir_entry *capabilities_intf;
+
+static int privcmd_enforce_singleshot_mapping(struct vm_area_struct *vma)
+{
+#ifndef HAVE_ARCH_PRIVCMD_MMAP
+       if (xchg(&vma->vm_private_data, (void *)1) != NULL)
+               return 0;
+#endif
+       return 1;
+}
 
 static int privcmd_ioctl(struct inode *inode, struct file *file,
                         unsigned int cmd, unsigned long data)
@@ -122,11 +131,9 @@ static int privcmd_ioctl(struct inode *i
 
                vma = find_vma(mm, msg.va);
                rc = -EINVAL;
-               if (!vma || (msg.va != vma->vm_start) || vma->vm_private_data)
+               if (!vma || (msg.va != vma->vm_start) ||
+                   !privcmd_enforce_singleshot_mapping(vma))
                        goto mmap_out;
-
-               /* Mapping is a one-shot operation per vma. */
-               vma->vm_private_data = (void *)1;
 
                va = vma->vm_start;
 
@@ -190,13 +197,10 @@ static int privcmd_ioctl(struct inode *i
                if (!vma ||
                    (m.addr != vma->vm_start) ||
                    ((m.addr + (m.num<<PAGE_SHIFT)) != vma->vm_end) ||
-                   vma->vm_private_data) {
+                   !privcmd_enforce_singleshot_mapping(vma)) {
                        up_read(&mm->mmap_sem);
                        return -EINVAL;
                }
-
-               /* Mapping is a one-shot operation per vma. */
-               vma->vm_private_data = (void *)1;
 
                p = m.arr;
                addr = m.addr;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0.3-testing] [PRIVCMD] Fix ia64 domain creation by abstracting the singleshot mapping check., Xen patchbot-3.0.3-testing <=