diff options
-rw-r--r-- | linux-user/main.c | 4 | ||||
-rw-r--r-- | linux-user/syscall.c | 22 |
2 files changed, 19 insertions, 7 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index 6e446de4dd..a8adb0404b 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -525,8 +525,6 @@ segv: info.si_code = TARGET_SEGV_MAPERR; info._sifields._sigfault._addr = env->exception.vaddress; queue_signal(env, info.si_signo, &info); - - end_exclusive(); } /* Handle a jump to the kernel code page. */ @@ -3453,7 +3451,7 @@ CPUArchState *cpu_copy(CPUArchState *env) { CPUState *cpu = ENV_GET_CPU(env); CPUState *new_cpu = cpu_init(cpu_model); - CPUArchState *new_env = cpu->env_ptr; + CPUArchState *new_env = new_cpu->env_ptr; CPUBreakpoint *bp; CPUWatchpoint *wp; 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 |