From patchwork Tue Jun 28 19:12:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 71154 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1766058qgy; Tue, 28 Jun 2016 12:32:03 -0700 (PDT) X-Received: by 10.55.140.69 with SMTP id o66mr4677603qkd.143.1467142323228; Tue, 28 Jun 2016 12:32:03 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f65si5193569qkj.271.2016.06.28.12.32.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 Jun 2016 12:32:03 -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]:39078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyjq-0006rC-OB for patch@linaro.org; Tue, 28 Jun 2016 15:32:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyRg-0001w1-Jf for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHyRf-0006sh-Ez for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:16 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:34553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyRf-0006sH-6o for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:15 -0400 Received: by mail-lf0-x22b.google.com with SMTP id h129so18187036lfh.1 for ; Tue, 28 Jun 2016 12:13:15 -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=ruisUysU1xLBMfKav35GeNC6AeI3070gONt5Cx4ta10=; b=DChqwvtMw4wzOytE0vjIltM91KSFaj54rKrKJLgIrzEu7zOhf3Yqk8gyLP8fBb6jtM tqqt9YiSDS8O4ZyTcIEaNJZPRS6Pv6aiunJpof2mBx/OtGI21SmXa/cQMSKQ5Oqj+WQp 4f3s8sQeTOgf0/FG/rGuJkK+xTEny6fjcU9Wg= 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=ruisUysU1xLBMfKav35GeNC6AeI3070gONt5Cx4ta10=; b=HKrekYiuJ+HYR7fvmS8RkBi5Q0mbhfFu/kXBS6AWyMQaNKaedXhV5yCyhWJzu3CUmy q5FnHEteqMqcVkMXrj3x3fm3ImjVKqWTLJpT0khkDcmQ26ExPQA2AhG9Z8tW57j7Wvme 4UQ7dlzsDUSfm60O0NG02TNt+/Dpi6iPE7KoOp00wJFs7Go1LEENS/+M4pVnOAuPtn3W I26xbi2HZv+XDHbA+PlYYEGfs02Azj0VhsceudGe/6tiRb6jcMLHRLkNWAie/04DEmf9 XXZnie48o3flZFSkrDHHphgWBNcrWjISL9A83ut8Pmr4pnSSrV3OGPhDSLM+AH1RXbC2 8CjA== X-Gm-Message-State: ALyK8tKXu1WJuy2HaRpK9Rl55qTsHOaMR5Lnrn9mKrN4VAk3axPnbIJXH3wx/ppizp8mgnQA X-Received: by 10.25.135.4 with SMTP id j4mr1588918lfd.66.1467141194469; Tue, 28 Jun 2016 12:13:14 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id h10sm4262823ljh.38.2016.06.28.12.13.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jun 2016 12:13:13 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 28 Jun 2016 22:12:44 +0300 Message-Id: <4debae6fa57443adf3b390397a069855ee4c4e4d.1467138806.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::22b Subject: [Qemu-devel] [PULL v2 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 5166ff9..8163ae8 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));