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] linux/privcmd: mmapbatch-v2 fixes

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/privcmd: mmapbatch-v2 fixes
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Thu, 21 Jan 2010 11:41:35 +0000
Delivery-date: Thu, 21 Jan 2010 03:42:45 -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
- clear error indication array when no error encountered
- no need to copy back mfn array in comapt mode shim

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/drivers/xen/privcmd/compat_privcmd.c
+++ b/drivers/xen/privcmd/compat_privcmd.c
@@ -102,7 +102,7 @@ int privcmd_ioctl_32(int fd, unsigned in
                struct privcmd_mmapbatch_v2_32 n32;
 #ifdef xen_pfn32_t
                xen_pfn_t *__user arr;
-               xen_pfn32_t *__user arr32;
+               const xen_pfn32_t *__user arr32;
                unsigned int i;
 #endif
 
@@ -133,17 +133,6 @@ int privcmd_ioctl_32(int fd, unsigned in
 #endif
 
                ret = sys_ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, (unsigned 
long)p);
-
-#ifdef xen_pfn32_t
-               for (i = 0; !ret && i < n32.num; ++i) {
-                       xen_pfn_t mfn;
-
-                       if (get_user(mfn, arr + i) || put_user(mfn, arr32 + i))
-                               ret = -EFAULT;
-                       else if (mfn != (xen_pfn32_t)mfn)
-                               ret = -ERANGE;
-               }
-#endif
        }
                break;
        default:
--- sle11sp1-2010-01-20.orig/drivers/xen/privcmd/privcmd.c      2010-01-19 
10:33:58.000000000 +0100
+++ sle11sp1-2010-01-20/drivers/xen/privcmd/privcmd.c   2010-01-21 
12:21:44.000000000 +0100
@@ -389,7 +389,8 @@ static long privcmd_ioctl(struct file *f
                                        ret = -EFAULT;
                                i += nr; p += nr;
                        }
-               }
+               } else if (clear_user(m.err, nr_pages * sizeof(*m.err)))
+                       ret = -EFAULT;
 
        mmapbatch_v2_out:
                list_for_each_safe(l, l2, &pagelist)



Attachment: xenlinux-privcmd-mmap-batch-clear.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/privcmd: mmapbatch-v2 fixes, Jan Beulich <=