From patchwork Tue Aug 12 18:53:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Musta X-Patchwork-Id: 379451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A1486140093 for ; Wed, 13 Aug 2014 05:01:36 +1000 (EST) Received: from localhost ([::1]:43651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHHKA-0006F2-La for incoming@patchwork.ozlabs.org; Tue, 12 Aug 2014 15:01:34 -0400 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 Received: from mail-qc0-x232.google.com ([2607:f8b0:400d:c01::232]:44700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHHDt-0007RG-MD; Tue, 12 Aug 2014 14:55:05 -0400 Received: by mail-qc0-f178.google.com with SMTP id x3so3173904qcv.37 for ; Tue, 12 Aug 2014 11:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=U5Flht2/tBEynoEJvPq0RjHeHZiCBbEX9vQawCjGr5M=; b=sDeSywy/9dzbT2NGZUOhTE6ikAGpvuFOeB/ozPkMGMb4lBsdBhTOb2wTzvBVc73oe8 nKPas5J2HzRgsCNTM9TCa8cG8l1fsco+5lP+t0IjNXOyvqt/VVNO1JwDP0Qtrg1HZZS5 +a54wLULR2V9yHJPSnFoon3HhPwVBcwC9hSKZ07nfTA59C8J6NGbeODC8N8jyqEVezaS Pyspe/Aq8j6ss8TlAaFsPzocDfihkL1Nv54mczLOO9WI2+xTGcXI6FP4nKzxXilvfYKx I1N7OZ5LFcL432MFJChxQ0l/vJb/GBNxO8pFur/Y1OFKZI58pTHALjRdB8/J4+Ipqvbl Zmxg== X-Received: by 10.140.44.67 with SMTP id f61mr9198883qga.44.1407869705176; Tue, 12 Aug 2014 11:55:05 -0700 (PDT) Received: from tmusta-sc.rchland.ibm.com (rchp4.rochester.ibm.com. [129.42.161.36]) by mx.google.com with ESMTPSA id m20sm27727128qax.25.2014.08.12.11.54.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 11:55:04 -0700 (PDT) From: Tom Musta To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Tue, 12 Aug 2014 13:53:39 -0500 Message-Id: <1407869623-11185-9-git-send-email-tommusta@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1407869623-11185-1-git-send-email-tommusta@gmail.com> References: <1407869623-11185-1-git-send-email-tommusta@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c01::232 Cc: peter.maydell@linaro.org, riku.voipio@linaro.org, agraf@suse.de, Tom Musta Subject: [Qemu-devel] [V2 PATCH 08/12] linux-user: Detect fault in sched_rr_get_interval X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Properly detect a fault when attempting to store into an invalid struct timespec pointer. Signed-off-by: Tom Musta Reviewed-by: Peter Maydell Reviewed-by: David Gibson --- 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;