From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHHDz-0004Tu-6x for qemu-devel@nongnu.org; Tue, 12 Aug 2014 14:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHHDt-0007S3-Pp for qemu-devel@nongnu.org; Tue, 12 Aug 2014 14:55:11 -0400 From: Tom Musta Date: Tue, 12 Aug 2014 13:53:39 -0500 Message-Id: <1407869623-11185-9-git-send-email-tommusta@gmail.com> In-Reply-To: <1407869623-11185-1-git-send-email-tommusta@gmail.com> References: <1407869623-11185-1-git-send-email-tommusta@gmail.com> Subject: [Qemu-devel] [V2 PATCH 08/12] linux-user: Detect fault in sched_rr_get_interval List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: peter.maydell@linaro.org, riku.voipio@linaro.org, agraf@suse.de, Tom Musta Properly detect a fault when attempting to store into an invalid struct timespec pointer. Signed-off-by: Tom Musta Reviewed-by: Peter Maydell --- V2: Peter has observed that there are other call sites that may need to be fixed. I will address that in future patch(es). linux-user/syscall.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 49b8a07..a20c2f7 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7760,7 +7760,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, struct timespec ts; ret = get_errno(sched_rr_get_interval(arg1, &ts)); if (!is_error(ret)) { - host_to_target_timespec(arg2, &ts); + ret = host_to_target_timespec(arg2, &ts); } } break; -- 1.7.1