From patchwork Wed Apr 23 13:11:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 28886 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0407F20534 for ; Wed, 23 Apr 2014 13:16:17 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id 29sf3839205yhl.1 for ; Wed, 23 Apr 2014 06:16:17 -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: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=NbY3lyYv4YIBQM5FbIBulZxLMFnSc/3QH7xn+Su27T8=; b=FSr+dAUNSvljJzie7n555Gd+Seef2GzUAMZU+99ytGRSo3vsPTtkvW9AZvuUAnvg5R XycGFmZ7EndBgLvH3AiDoJCjBmhctAEYnfFoD1RmgI6uYcBry55SJNkh81jTb+KKim+L isPnwmJZJjBRNoD4e9BriGZhD+xhlslSsbFSacWOlK6RxxTYxBxGNGVPR3iH1yVts6en 7U6mg+ytQOQA1/M9wVna5N3OiFdkC1F9hzHkGdWWx2Z+B44jOlIk6TKB82MCKByrh+GF JrQL+WEisFJsBV+xbYse17JDiq8T3jHYuibXtcLH91FCAQW/8LC4UHlobDKM2kn4nxHG 6qBQ== X-Gm-Message-State: ALoCoQmtf9B+sxrG0u5cfmJRaBJHFKvROGnD5CVXI/KXj/fQSsCXCTw/QO78rUeQO3g+TeGwqnx+ X-Received: by 10.236.141.203 with SMTP id g51mr22677536yhj.24.1398258977519; Wed, 23 Apr 2014 06:16:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.203 with SMTP id h69ls595134qgh.56.gmail; Wed, 23 Apr 2014 06:16:17 -0700 (PDT) X-Received: by 10.58.216.163 with SMTP id or3mr38099vec.80.1398258977391; Wed, 23 Apr 2014 06:16:17 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id tz5si162667vdc.25.2014.04.23.06.16.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 06:16:17 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ij19so1095143vcb.24 for ; Wed, 23 Apr 2014 06:16:17 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr42745973vcb.0.1398258977320; Wed, 23 Apr 2014 06:16:17 -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.220.221.72 with SMTP id ib8csp103190vcb; Wed, 23 Apr 2014 06:16:17 -0700 (PDT) X-Received: by 10.224.126.9 with SMTP id a9mr52305276qas.39.1398258976963; Wed, 23 Apr 2014 06:16:16 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m6si417732qay.195.2014.04.23.06.16.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Apr 2014 06:16:16 -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]:60905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcx28-0003Z9-EZ for patch@linaro.org; Wed, 23 Apr 2014 09:16:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcwyF-0001kr-AQ for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wcwy8-0001JO-GC for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:15 -0400 Received: from afflict.kos.to ([92.243.29.197]:42803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcwy8-0001If-A1 for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:08 -0400 Received: from localhost.localdomain (afflict [92.243.29.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 0599C264D5 for ; Wed, 23 Apr 2014 15:12:06 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 23 Apr 2014 16:11:58 +0300 Message-Id: X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Subject: [Qemu-devel] [PATCH 07/13] 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=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 --- 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 2fb7fd1..9118597 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;