From patchwork Tue Jun 10 13:20:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31653 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AD59320675 for ; Tue, 10 Jun 2014 13:24:00 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id jz11sf16121306veb.0 for ; Tue, 10 Jun 2014 06:24:00 -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=+DNyqvTuCpMTdjdQav2W2BPbuKGXsFoWssA6Qk15ONE=; b=hiFJsfDok/zUJVNWQQcEKmQ/JFFnRnKWtN5a1m5PrFKwu5LzBTOgtQ1s94zvUWP/3/ 40Vhw8x7krJga1Z4gbTc6GtKi3PlB6x6zzVHy+eIU3slDewKDOz45RojCQPNzz2sm1C+ othptKVN+1QC1ZblQqXu4IAw3xxt5ap79thrPXahXisinaTU8E8upN58sch0gVjtkaGn vKDc2Lfd9hcMCq4BqIRklF5MgY5le4HxZRkZskA7lHKrH9AyzMWgutrCar8x7giyOu6V SyWY7kpC4dTUiqQv0ifG7sHSWYl8sK6QUfFuGlMrtL1OvvqdvPOxsJZ3/boQHP1+D01V APzg== X-Gm-Message-State: ALoCoQnvOupRy8Bk1xdXiit3Ec/efH5nkvDk0fNjpS7MJYPvEepkqM+gZrEfByuNZTDwjw8NkJwx X-Received: by 10.58.187.68 with SMTP id fq4mr4753571vec.0.1402406640546; Tue, 10 Jun 2014 06:24:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.72 with SMTP id j66ls2090883qge.99.gmail; Tue, 10 Jun 2014 06:24:00 -0700 (PDT) X-Received: by 10.52.138.14 with SMTP id qm14mr27014463vdb.49.1402406640293; Tue, 10 Jun 2014 06:24:00 -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 tt2si3483803vdc.3.2014.06.10.06.24.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 06:24:00 -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 hy4so3521277vcb.34 for ; Tue, 10 Jun 2014 06:24:00 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr32354026vcg.16.1402406640216; Tue, 10 Jun 2014 06:24:00 -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 vs6csp225021vcb; Tue, 10 Jun 2014 06:23:59 -0700 (PDT) X-Received: by 10.224.114.145 with SMTP id e17mr41639661qaq.53.1402406639776; Tue, 10 Jun 2014 06:23:59 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v4si27589452qaf.17.2014.06.10.06.23.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Jun 2014 06:23:59 -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]:39755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuM1v-0004xx-4M for patch@linaro.org; Tue, 10 Jun 2014 09:23:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuLyz-0000Lc-GE for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:21:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuLyp-0007Zq-Ha for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:20:57 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=56219 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuLyp-0007ZN-Az for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:20:47 -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 54F3426547; Tue, 10 Jun 2014 15:20:45 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 10 Jun 2014 16:20:36 +0300 Message-Id: <37d60d802674f8418004f77e39ead12f5b690702.1402405819.git.riku.voipio@linaro.org> 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: Riku Voipio Subject: [Qemu-devel] [PATCH v3 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.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: 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;