Commit 1714df7f authored by Andres Lagar-Cavilla's avatar Andres Lagar-Cavilla Committed by Konrad Rzeszutek Wilk

xen/privcmd: Fix mmap batch ioctl error status copy back.

Copy back of per-slot error codes is only necessary for V2. V1 does not provide
an error array, so copyback will unconditionally set the global rc to EFAULT.
Only copyback for V2.
Signed-off-by: default avatarAndres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent ceb90fa0
...@@ -389,7 +389,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version) ...@@ -389,7 +389,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
state.err = err_array; state.err = err_array;
ret = traverse_pages(m.num, sizeof(xen_pfn_t), ret = traverse_pages(m.num, sizeof(xen_pfn_t),
&pagelist, mmap_return_errors_v1, &state); &pagelist, mmap_return_errors_v1, &state);
} else } else if (version == 2)
ret = __copy_to_user(m.err, err_array, m.num * sizeof(int)); ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
/* If we have not had any EFAULT-like global errors then set the global /* If we have not had any EFAULT-like global errors then set the global
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment