From patchwork Mon Jun 9 12:46:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31551 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E03E920675 for ; Mon, 9 Jun 2014 12:50:19 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id j5sf22160615qaq.8 for ; Mon, 09 Jun 2014 05:50:19 -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=5dcimT9jSV4a/Rn4AyOP3L+lI20HhWByTlWDZ4fSJaY=; b=Y7F2nLxxM8USPwuM4JqEjRGa22u/yf2Mtj7aWFoxT2SwSQHK4cuAgbET7N4cwyhO8e MbPrkfri3gAT/UAlK6/xiYuXr0P5blhSrgD6q8eIssMplkzWwaGiV70PTKKflQgXglU4 e7HFzAYVvIpFs6+A351ufwpS/I1HFdC5RTx3yzmg9fpro/osJcqYZ2p1Igx4D0KUgAD3 5cruOMESc4zbCA1VC/AR6yC2NCOlGgqrjTiuo7VxxkOIfQWuZJnRfxmQlmrPRhxhHRv5 t7+fNmWj/0JLjM39ps8WUmogup/Uj11ffE9KXBMfvmp3aKH/wdcHmx6sfdl+hWjs08x4 k1vg== X-Gm-Message-State: ALoCoQlnQPQ8j3nnV2pTEoJaxIoz6KtS2dlXeK8STXztY3fktPU/unIJLolMzoX05yRN+XtHiL67 X-Received: by 10.58.247.202 with SMTP id yg10mr1920967vec.1.1402318219596; Mon, 09 Jun 2014 05:50:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.85 with SMTP id 79ls1599539qgk.41.gmail; Mon, 09 Jun 2014 05:50:19 -0700 (PDT) X-Received: by 10.58.178.115 with SMTP id cx19mr515348vec.70.1402318219404; Mon, 09 Jun 2014 05:50:19 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id aq3si11815702vdc.7.2014.06.09.05.50.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Jun 2014 05:50:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hy10so707761vcb.17 for ; Mon, 09 Jun 2014 05:50:19 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr26136943vcb.0.1402318219313; Mon, 09 Jun 2014 05:50:19 -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.54.6 with SMTP id vs6csp143446vcb; Mon, 9 Jun 2014 05:50:18 -0700 (PDT) X-Received: by 10.140.102.166 with SMTP id w35mr30258907qge.97.1402318218492; Mon, 09 Jun 2014 05:50:18 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z32si22889333qgz.98.2014.06.09.05.50.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 09 Jun 2014 05:50:18 -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]:60863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtz1m-0001lW-2q for patch@linaro.org; Mon, 09 Jun 2014 08:50:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtyyU-0005cY-Nb for qemu-devel@nongnu.org; Mon, 09 Jun 2014 08:47:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WtyyM-0007h8-Si for qemu-devel@nongnu.org; Mon, 09 Jun 2014 08:46:54 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=55291 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtyyM-0007gU-MS for qemu-devel@nongnu.org; Mon, 09 Jun 2014 08:46:46 -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 BD3FD26547; Mon, 9 Jun 2014 14:46:44 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 9 Jun 2014 15:46:32 +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: 2001:4b98:dc0:45:216:3eff:fe3d:166f Cc: peter.maydell@linaro.org, Riku Voipio Subject: [Qemu-devel] [PULL 07/18] signal/all/do_sigaltstack remove __get_user value check 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.172 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: Riku Voipio Access is already checked in the lock_user_struct call before. Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- linux-user/signal.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index addf3c8..4a8d1d2 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -619,11 +619,12 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp) struct target_sigaltstack ss; ret = -TARGET_EFAULT; - if (!lock_user_struct(VERIFY_READ, uss, uss_addr, 1) - || __get_user(ss.ss_sp, &uss->ss_sp) - || __get_user(ss.ss_size, &uss->ss_size) - || __get_user(ss.ss_flags, &uss->ss_flags)) + if (!lock_user_struct(VERIFY_READ, uss, uss_addr, 1)) { goto out; + } + __get_user(ss.ss_sp, &uss->ss_sp); + __get_user(ss.ss_size, &uss->ss_size); + __get_user(ss.ss_flags, &uss->ss_flags); unlock_user_struct(uss, uss_addr, 0); ret = -TARGET_EPERM;