From patchwork Fri Jun 24 09:53:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 70814 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp867526qgy; Fri, 24 Jun 2016 03:14:11 -0700 (PDT) X-Received: by 10.55.198.196 with SMTP id s65mr3366372qkl.119.1466763251893; Fri, 24 Jun 2016 03:14:11 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v32si4370409qtc.50.2016.06.24.03.14.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 24 Jun 2016 03:14:11 -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; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGO7n-0007kT-A3 for patch@linaro.org; Fri, 24 Jun 2016 06:14:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNnz-0000qH-8R for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGNnt-0003NP-Jm for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:42 -0400 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:36682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNnt-0003NH-BY for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:37 -0400 Received: by mail-lf0-x230.google.com with SMTP id q132so112559143lfe.3 for ; Fri, 24 Jun 2016 02:53:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uYNaJCizUOzDQElS8rnnOZiajDaIDhLmuaIxcozEwr8=; b=MXHKfscifLeGrvoTpByNrSdf78lOoH7XnOG9hJVt0dZhiaKPBUILR81TVRnKPH97O4 hQr5aCvCPcjdlsXHyAfDJm6ArkHvWSupPmN2mDTQb4PzmpncuE8cAcKCcargQvQ9bTux iSWw8j/A+pw1OJiMkqzVmEtzXupgPmSc4Hk0k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uYNaJCizUOzDQElS8rnnOZiajDaIDhLmuaIxcozEwr8=; b=d2R63Rmc88yPmhGVJvVCC57JUo7bGvfI41Eadyn2KJ4Sen5Xv2v0vMsTrhx+ignsMy hD3+Yak67Zgi9jd0y2DFMCFfc+bawe8P7/0aj00AcuCy7AB2IO9VKxf8FCeGKPW7VcXi SF0uLT3hYO0hH2709+ASuoqvqpSnbljOk1TyHQAtyOVzjEtsUflEUP3MOrh+mQGHCnbp lO0UeZGP3hIyy749h234GvCWY3xrsfc2mB1xyTRYkxZXVgOZYy2zaMYmM41Wig6/WA3B QxvDXjTqueEmwtArxTAsTvxhLb+mzR5mv5B4kFUcSSgmJ5TcZVz/gPpXTPufAuQcsmp+ zj6g== X-Gm-Message-State: ALyK8tIFdLT5ep4KU/hPGIYtCEBztDPT0nSVJ0ryh+pKKpUpY0/COGTrn01KdCwvmJerm1OD X-Received: by 10.25.20.95 with SMTP id k92mr1002123lfi.207.1466762016507; Fri, 24 Jun 2016 02:53:36 -0700 (PDT) Received: from beaming.home (85-76-80-69-nat.elisa-mobile.fi. [85.76.80.69]) by smtp.gmail.com with ESMTPSA id o137sm798203lfe.2.2016.06.24.02.53.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jun 2016 02:53:35 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 24 Jun 2016 12:53:05 +0300 Message-Id: <48a32aaa67a77a0fba96500f489b6018a38b36bd.1466760944.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::230 Subject: [Qemu-devel] [PULL 10/24] linux-user: Fix wrong type used for argument to rt_sigqueueinfo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The third argument to the rt_sigqueueinfo syscall is a pointer to a siginfo_t, not a pointer to a sigset_t. Fix the error in the arguments to lock_user(), which meant that we would not have detected some faults that we should. Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/syscall.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.1.4 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 95eafeb..686ebfb 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7876,8 +7876,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_NR_rt_sigqueueinfo: { siginfo_t uinfo; - if (!(p = lock_user(VERIFY_READ, arg3, sizeof(target_sigset_t), 1))) + + p = lock_user(VERIFY_READ, arg3, sizeof(target_siginfo_t), 1); + if (!p) { goto efault; + } target_to_host_siginfo(&uinfo, p); unlock_user(p, arg1, 0); ret = get_errno(sys_rt_sigqueueinfo(arg1, arg2, &uinfo));