summaryrefslogtreecommitdiffstats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorAndreas Schwab2015-03-10 17:11:35 +0100
committerRiku Voipio2015-03-22 14:18:51 +0100
commit17644b362746c400f45b0d2b0a3ce8a52fed13fb (patch)
tree88f8abf7a31f030b0de1a45e16988ade90ec15c0 /linux-user/syscall.c
parentlinux-user/main.c: Remove redundant end_exclusive() in arm_kernel_cmpxchg64_h... (diff)
downloadqemu-17644b362746c400f45b0d2b0a3ce8a52fed13fb.tar.gz
qemu-17644b362746c400f45b0d2b0a3ce8a52fed13fb.tar.xz
qemu-17644b362746c400f45b0d2b0a3ce8a52fed13fb.zip
linux-user: fix emulation of splice syscall
The second and fourth argument are in/out parameters, store them back after the syscall. Also, the fourth argument was mishandled, and EFAULT handling was missing. Signed-off-by: Andreas Schwab <schwab@suse.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5720195654..4bd954375e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9351,15 +9351,29 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
{
loff_t loff_in, loff_out;
loff_t *ploff_in = NULL, *ploff_out = NULL;
- if(arg2) {
- get_user_u64(loff_in, arg2);
+ if (arg2) {
+ if (get_user_u64(loff_in, arg2)) {
+ goto efault;
+ }
ploff_in = &loff_in;
}
- if(arg4) {
- get_user_u64(loff_out, arg2);
+ if (arg4) {
+ if (get_user_u64(loff_out, arg4)) {
+ goto efault;
+ }
ploff_out = &loff_out;
}
ret = get_errno(splice(arg1, ploff_in, arg3, ploff_out, arg5, arg6));
+ if (arg2) {
+ if (put_user_u64(loff_in, arg2)) {
+ goto efault;
+ }
+ }
+ if (arg4) {
+ if (put_user_u64(loff_out, arg4)) {
+ goto efault;
+ }
+ }
}
break;
#endif