aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorMichael Karcher <karcher@physik.fu-berlin.de>2017-02-25 12:05:17 +0100
committerLaurent Vivier <laurent@vivier.eu>2017-02-27 23:10:02 +0100
commit59ebb6e451ffe5d4ccb5a62ee6646ed418361ef0 (patch)
treeb034fc145cdcd159ff3f80dd5b2d83631b1939a3 /linux-user
parent3219de458c497e15fd3b0c3ba3c1952fc34fe3da (diff)
linux-user: fix do_rt_sigreturn on m68k linux userspace emulation
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>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/signal.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 99adfc29e4..a67db04e1a 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 */