From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHdrw-0005QN-J5 for qemu-devel@nongnu.org; Wed, 13 Aug 2014 15:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHdrr-0004PM-5P for qemu-devel@nongnu.org; Wed, 13 Aug 2014 15:05:56 -0400 From: Tom Musta Date: Wed, 13 Aug 2014 14:04:43 -0500 Message-Id: <1407956688-16006-9-git-send-email-tommusta@gmail.com> In-Reply-To: <1407956688-16006-1-git-send-email-tommusta@gmail.com> References: <1407956688-16006-1-git-send-email-tommusta@gmail.com> Subject: [Qemu-devel] [V3 PATCH 08/13] 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: Tom Musta , riku.voipio@linaro.org, agraf@suse.de 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