summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2015-02-16 16:39:35 (GMT)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>2015-02-16 16:44:01 (GMT)
commit065b007a1b3c516b3c7f12c360dd2dcdeb4ac0c8 (patch)
treeffad5f2ea27e808440292b171943692596dfb26d
parent77f41a5cae59c0faa5384af809649f42e6667144 (diff)
downloadqemu-submit/tizen/20151208.013156.zip
qemu-submit/tizen/20151208.013156.tar.gz
qemu-submit/tizen/20151208.013156.tar.bz2
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. Change-Id: I625ecd4dc3e53b8025585727439f1112c38d1758 Patch-Url: https://www.mail-archive.com/qemu-devel@nongnu.org/msg277687.html Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
-rw-r--r--linux-user/syscall.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a08f5ef..52885ab 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9489,14 +9489,24 @@ abi_long do_syscall(void *cpu_env, int num, abi_ulong arg1,
loff_t loff_in, loff_out;
loff_t *ploff_in = NULL, *ploff_out = NULL;
if(arg2) {
- get_user_u64(loff_in, 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