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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/privcmd: mmapbatch-v2 fixes
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Jan 2010 07:15:22 -0800
Delivery-date: Thu, 21 Jan 2010 07:15:49 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1264086302 0
# Node ID 91224343eeee460c9aafdaadc1bdedab54e92256
# Parent  63b4d7f56688f38fd42ede433fd0f7220e545cda
xen/privcmd: mmapbatch-v2 fixes

- clear error indication array when no error encountered
- no need to copy back mfn array in compat mode shim

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 drivers/xen/privcmd/compat_privcmd.c |   13 +------------
 drivers/xen/privcmd/privcmd.c        |    3 ++-
 2 files changed, 3 insertions(+), 13 deletions(-)

diff -r 63b4d7f56688 -r 91224343eeee drivers/xen/privcmd/compat_privcmd.c
--- a/drivers/xen/privcmd/compat_privcmd.c      Thu Jan 21 14:39:05 2010 +0000
+++ b/drivers/xen/privcmd/compat_privcmd.c      Thu Jan 21 15:05:02 2010 +0000
@@ -103,7 +103,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
 
@@ -134,17 +134,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:
diff -r 63b4d7f56688 -r 91224343eeee drivers/xen/privcmd/privcmd.c
--- a/drivers/xen/privcmd/privcmd.c     Thu Jan 21 14:39:05 2010 +0000
+++ b/drivers/xen/privcmd/privcmd.c     Thu Jan 21 15:05:02 2010 +0000
@@ -409,7 +409,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)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/privcmd: mmapbatch-v2 fixes, Xen patchbot-linux-2.6.18-xen <=