qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: patches@linaro.org, Riku Voipio <riku.voipio@linaro.org>,
	Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PATCH 2/3] linux-user: Fix wrong type used for argument to rt_sigqueueinfo
Date: Mon, 20 Jun 2016 15:50:36 +0100	[thread overview]
Message-ID: <1466434237-19334-3-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1466434237-19334-1-git-send-email-peter.maydell@linaro.org>

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 <peter.maydell@linaro.org>
---
 linux-user/syscall.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7b3d129..8065284 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7909,8 +7909,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));
-- 
1.9.1

  parent reply	other threads:[~2016-06-20 14:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 14:50 [Qemu-devel] [PATCH 0/3] linux-user: three minor fixes Peter Maydell
2016-06-20 14:50 ` [Qemu-devel] [PATCH 1/3] linux-user: Check sigsetsize argument to syscalls Peter Maydell
2016-06-21 19:09   ` Laurent Vivier
2016-06-21 19:50     ` Peter Maydell
2016-06-20 14:50 ` Peter Maydell [this message]
2016-06-21 19:10   ` [Qemu-devel] [PATCH 2/3] linux-user: Fix wrong type used for argument to rt_sigqueueinfo Laurent Vivier
2016-06-20 14:50 ` [Qemu-devel] [PATCH 3/3] linux-user: Support F_GETPIPE_SZ and F_SETPIPE_SZ fcntls Peter Maydell
2016-06-21 19:13   ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466434237-19334-3-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=laurent@vivier.eu \
    --cc=patches@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).