[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [linux-2.6.18-xen] xen/privcmd: mmapbatch-v2 fixes
# 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |