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

[Xen-devel] [PATCH] linux/privcmd: mmapbatch-v2 fixes



- 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

 


Rackspace

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