From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7hB5-0001xH-7X for qemu-devel@nongnu.org; Sat, 12 Dec 2015 05:13:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7hB0-0004Ba-A2 for qemu-devel@nongnu.org; Sat, 12 Dec 2015 05:13:23 -0500 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:56629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7hB0-0004BJ-3C for qemu-devel@nongnu.org; Sat, 12 Dec 2015 05:13:18 -0500 From: Michael Karcher Date: Sat, 12 Dec 2015 11:13:08 +0100 Message-Id: <1449915188-15374-2-git-send-email-karcher@physik.fu-berlin.de> In-Reply-To: <1449915188-15374-1-git-send-email-karcher@physik.fu-berlin.de> References: <1449915188-15374-1-git-send-email-karcher@physik.fu-berlin.de> Subject: [Qemu-devel] [PATCH 1/1 v2] Fix do_rt_sigreturn on m68k linux userspace emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio , Laurent Vivier , qemu-devel@nongnu.org Cc: glaubitz@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 --- 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 e03ed60..13f9142 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -5258,14 +5258,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; int d0; 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); do_sigprocmask(SIG_SETMASK, &set, NULL); /* restore registers */ -- 2.1.4