From patchwork Tue Jun 17 14:56:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 32046 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D20AB206A0 for ; Tue, 17 Jun 2014 15:06:28 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id rq2sf13125807pbb.2 for ; Tue, 17 Jun 2014 08:06:28 -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: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=+DNyqvTuCpMTdjdQav2W2BPbuKGXsFoWssA6Qk15ONE=; b=H7+tBK3tyiqQ/7LEmFvOAMYwcY9Ly1fOoh1aWkAoip5WoSBWerf0BBHzYg1zOm+kDH h2GfNcAalA3XJGicFz7Q1eUw385Sgv40DxYMK/H7NUf0k2lo3uY8Y7VlYU5EB8UI+4xC 0Y3yYkit92ZuyAeQKL7Yu+ljxQf4IvDSMUPSM2fvLfqF1gz9iQd51lAEev7XUV+rBOWI 3k95Swjmcmw0SjjWfrUVALPrKRkPz2Zy9TPZhux/4JBZBPS1P6LkZwv7bhKSfjzF1B1G nqDqT51BY9gDUFgMeFhKgI1CRDCTOzZO6aojn1115G9UvNoQUv3wVs4p1m6sT+IxSL5l lygQ== X-Gm-Message-State: ALoCoQkiJc9OQhiaRg7DYQIal9oBHJI4YJUTXS0WtqvGuBQhKu/R+Cmwhqiqm8GWtG3wezTKNxZk X-Received: by 10.66.122.137 with SMTP id ls9mr544478pab.17.1403017588175; Tue, 17 Jun 2014 08:06:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.17.19 with SMTP id 19ls4843869qgc.69.gmail; Tue, 17 Jun 2014 08:06:28 -0700 (PDT) X-Received: by 10.52.255.65 with SMTP id ao1mr1731222vdd.43.1403017587948; Tue, 17 Jun 2014 08:06:27 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id ab3si5581355vec.46.2014.06.17.08.06.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:06:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id il7so6407082vcb.26 for ; Tue, 17 Jun 2014 08:06:27 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr12912941vdc.8.1403017587875; Tue, 17 Jun 2014 08:06:27 -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 vs6csp216363vcb; Tue, 17 Jun 2014 08:06:27 -0700 (PDT) X-Received: by 10.140.100.210 with SMTP id s76mr3661006qge.93.1403017586553; Tue, 17 Jun 2014 08:06:26 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f9si17244910qaf.27.2014.06.17.08.06.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:06:26 -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]:51237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwuxt-0002GV-QA for patch@linaro.org; Tue, 17 Jun 2014 11:06:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwup0-0005hd-Qr for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwuor-0004Pf-R0 for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:14 -0400 Received: from afflict.kos.to ([92.243.29.197]:46244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwuor-0004PB-KO for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:05 -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 6D6B226547; Tue, 17 Jun 2014 16:57:03 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 17 Jun 2014 17:56:50 +0300 Message-Id: <9eeb8306d56e8fd831bbbac6e3cfe69a40312a33.1403016610.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: peter.maydell@linaro.org, Riku Voipio Subject: [Qemu-devel] [PULL v2 07/17] 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.181 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 2a1c681..f55076d 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;