From patchwork Fri Jun 6 09:46:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31470 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 35EE0203C3 for ; Fri, 6 Jun 2014 09:50:07 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf10747623obc.9 for ; Fri, 06 Jun 2014 02:50:06 -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: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=ktiJNXtKFJ9LCAnPgjj1Ez7aJjUayURBJEgpVPF+z70=; b=cTP8AQCWO2F7vNGwY1eiwpCvKe2wx6oJTu8Aiii1Su2qo+8UyuWKjVTKAadLQyiyW7 fDJr+XnEi3omh/gYqK+NZ6Joxj86G7ajZStC9iZkydWu1MTWloInTUfqhls4k2MDGvAN 6O01wML4YU33e8uBrbHrjIkee+b2pOuqbsj0T1vBm9jtVO2GZZPufwtyOj1tEcUn/HSh /lKJejQY4LX/8ymSl4n9OXfOrvvSmjabpijpnyZHCyDNNRCOpc7WXcYVIzSGU+DtsrOm 3YjgIxY53fcXOFL/zS9OsCBJBgTvuN3olsmmyefpMURF/a70DBbKsjIayq94XzS4/Dwk EErw== X-Gm-Message-State: ALoCoQnpVXZ4uLGBsrSerz/8K3npPaBK+PKsb3gm2BQvmnY8XYIuEeSEP0YyNXH56J6umUeUYJ78 X-Received: by 10.42.194.6 with SMTP id dw6mr2460604icb.22.1402048206909; Fri, 06 Jun 2014 02:50:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.33.244 with SMTP id j107ls577071qgj.24.gmail; Fri, 06 Jun 2014 02:50:06 -0700 (PDT) X-Received: by 10.53.12.229 with SMTP id et5mr2985345vdd.32.1402048206799; Fri, 06 Jun 2014 02:50:06 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id tx9si4464656vcb.102.2014.06.06.02.50.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Jun 2014 02:50:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id im17so2635618vcb.21 for ; Fri, 06 Jun 2014 02:50:06 -0700 (PDT) X-Received: by 10.53.8.162 with SMTP id dl2mr2989634vdd.24.1402048206732; Fri, 06 Jun 2014 02:50:06 -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 vs6csp84335vcb; Fri, 6 Jun 2014 02:50:06 -0700 (PDT) X-Received: by 10.140.105.119 with SMTP id b110mr6497334qgf.28.1402048206279; Fri, 06 Jun 2014 02:50:06 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t9si12338877qaj.15.2014.06.06.02.50.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 06 Jun 2014 02:50:06 -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]:46195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsqmj-00034Y-Tl for patch@linaro.org; Fri, 06 Jun 2014 05:50:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsqjt-0006Fo-GN for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:47:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wsqjm-0001Wi-97 for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:47:09 -0400 Received: from afflict.kos.to ([92.243.29.197]:38372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsqjm-0001WG-2B for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:47:02 -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 A527C26547; Fri, 6 Jun 2014 11:46:59 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 6 Jun 2014 12:46:51 +0300 Message-Id: <1402048017-30604-8-git-send-email-riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH v2 07/13] 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.176 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 --- 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 91fd27f..56d6e29 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;