All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Riku Voipio <riku.voipio@iki.fi>,
	Michael Karcher <karcher@physik.fu-berlin.de>,
	Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PULL 5/6] linux-user: fix do_rt_sigreturn on m68k linux userspace emulation
Date: Mon, 27 Feb 2017 23:33:36 +0100	[thread overview]
Message-ID: <20170227223337.17434-6-laurent@vivier.eu> (raw)
In-Reply-To: <20170227223337.17434-1-laurent@vivier.eu>

From: Michael Karcher <karcher@physik.fu-berlin.de>

do_rt_sigreturn uses an uninitialised local variable instead of fetching
the old signal mask directly from the signal frame when restoring the mask,
so the signal mask is undefined after do_rt_sigreturn. As the signal
frame data is in target-endian order, target_to_host_sigset instead of
target_to_host_sigset_internal is required.

do_sigreturn is correct in using target_to_host_sigset_internal, because
get_user already did the endianness conversion.

Signed-off-by: Michael Karcher <karcher@physik.fu-berlin.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20170225110517.2832-3-laurent@vivier.eu>
---
 linux-user/signal.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/linux-user/signal.c b/linux-user/signal.c
index 99adfc2..a67db04 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -5851,14 +5851,13 @@ long do_rt_sigreturn(CPUM68KState *env)
 {
     struct target_rt_sigframe *frame;
     abi_ulong frame_addr = env->aregs[7] - 4;
-    target_sigset_t target_set;
     sigset_t set;
 
     trace_user_do_rt_sigreturn(env, frame_addr);
     if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))
         goto badframe;
 
-    target_to_host_sigset_internal(&set, &target_set);
+    target_to_host_sigset(&set, &frame->uc.tuc_sigmask);
     set_sigmask(&set);
 
     /* restore registers */
-- 
2.9.3

  parent reply	other threads:[~2017-02-27 22:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 22:33 [Qemu-devel] [PULL 0/6] Linux user for upstream patches Laurent Vivier
2017-02-27 22:33 ` [Qemu-devel] [PULL 1/6] linux-user: fix fork() Laurent Vivier
2017-02-27 22:33 ` [Qemu-devel] [PULL 2/6] linux-user: Add sockopts for IPv6 ping and IPv6 traceroute Laurent Vivier
2017-02-27 22:33 ` [Qemu-devel] [PULL 3/6] linux-user: Add signal handling support for x86_64 Laurent Vivier
2017-02-27 22:33 ` [Qemu-devel] [PULL 4/6] linux-user: correctly manage SR in ucontext Laurent Vivier
2017-02-27 22:33 ` Laurent Vivier [this message]
2017-02-27 22:33 ` [Qemu-devel] [PULL 6/6] syscall: fixed mincore(2) not failing with ENOMEM Laurent Vivier
2017-02-28 13:01 ` [Qemu-devel] [PULL 0/6] Linux user for upstream patches Peter Maydell

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=20170227223337.17434-6-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=karcher@physik.fu-berlin.de \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.