Fix emulation of splice syscall 00/35500/1 accepted/tizen_3.0.2014.q4_common tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.2015.q2_common tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/3.0.2014.q4/common/20150224.150711 accepted/tizen/common/20150223.141054 accepted/tizen/mobile/20150319.092022 accepted/tizen/mobile/20151208.124709 accepted/tizen/tv/20150319.091859 accepted/tizen/tv/20151208.124730 accepted/tizen/wearable/20150227.104320 accepted/tizen/wearable/20151208.124740 submit/tizen/20151208.013156 submit/tizen_3.0.2014.q4_common/20150224.000000 submit/tizen_common/20150223.083300 submit/tizen_mobile/20150319.052340 submit/tizen_tv/20150319.052230 submit/tizen_wearable/20150227.104204 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
authorAndreas Schwab <schwab@suse.de>
Mon, 16 Feb 2015 16:39:35 +0000 (17:39 +0100)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Mon, 16 Feb 2015 16:44:01 +0000 (17:44 +0100)
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>
linux-user/syscall.c

index a08f5ef..52885ab 100644 (file)
@@ -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