From patchwork Fri Aug 22 13:24:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 35807 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CD84D20540 for ; Fri, 22 Aug 2014 13:31:58 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id r2sf48083371igi.0 for ; Fri, 22 Aug 2014 06:31:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=I/+TrNW2wuHkqtCEmPT6SwWYZ8hpLtUOt5taeg70EB8=; b=jelpPZsCCvnDCZNDGo3+zLfORE5Q9f/rTuuq/yjWxsdsyJb1/HKpxOE0jvfvqr9SUF 24suXf867qT009PHL+MrexAZrhGjOuZ9a7WYMYhX/+QGFyjAEoj/zTLYIOOtZoZgqIfq 5LY/No0S7Q6XWi2x1LjNuLo3j1RGiWscf6SN4dYkwHcmQcMWrRQld6pjzFBB0pCua5jU HWtryhrIatjZGmrVdzbFyqC0bKXAW4uWa8J6tZ0CxamTzhw+AwkryoeQFddX+QeAkE19 sA8Hu71bVIBWslJzGVvX7uIi4nXy5gJCqibroORyxvMD2XF89vASFwM0eQd063g7P2Kc pJTw== X-Gm-Message-State: ALoCoQn4lgHkBcqM6prdJIhDDbCvo6pYaoDrdOc4elx26+FZddmkmFcl3XEOjqwnf2GGavy57EXs X-Received: by 10.182.135.194 with SMTP id pu2mr3065375obb.35.1408714318324; Fri, 22 Aug 2014 06:31:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.240 with SMTP id 103ls1094749qgn.28.gmail; Fri, 22 Aug 2014 06:31:58 -0700 (PDT) X-Received: by 10.220.97.138 with SMTP id l10mr3931447vcn.25.1408714318233; Fri, 22 Aug 2014 06:31:58 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id o2si13552704vdb.104.2014.08.22.06.31.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:31:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ik5so12177103vcb.20 for ; Fri, 22 Aug 2014 06:31:58 -0700 (PDT) X-Received: by 10.220.30.8 with SMTP id s8mr86825vcc.58.1408714318153; Fri, 22 Aug 2014 06:31:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp17118vcb; Fri, 22 Aug 2014 06:31:57 -0700 (PDT) X-Received: by 10.224.88.3 with SMTP id y3mr7953860qal.65.1408714317068; Fri, 22 Aug 2014 06:31:57 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x48si42260572qgx.80.2014.08.22.06.31.56 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:37126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKowe-0006G7-In for patch@linaro.org; Fri, 22 Aug 2014 09:31:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKopo-0006Wr-84 for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:25:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKopg-0002Bx-TK for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:52 -0400 Received: from afflict.kos.to ([92.243.29.197]:39323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKopg-0002BC-My for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:44 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 33EBB26595; Fri, 22 Aug 2014 15:24:43 +0200 (CEST) From: riku.voipio@linaro.org To: Peter Maydell , qemu-devel@nongnu.org Date: Fri, 22 Aug 2014 16:24:34 +0300 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Tom Musta Subject: [Qemu-devel] [PULL v3 16/22] 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: 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 Signed-off-by: Riku Voipio --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 4424b63..ed32f97 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7794,7 +7794,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;