From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6mpq-000860-Rw for qemu-devel@nongnu.org; Wed, 09 Dec 2015 17:03:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6mpn-00057n-M8 for qemu-devel@nongnu.org; Wed, 09 Dec 2015 17:03:42 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:55862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6mpn-00057Z-Dy for qemu-devel@nongnu.org; Wed, 09 Dec 2015 17:03:39 -0500 References: <1449694457-5843-1-git-send-email-karcher@physik.fu-berlin.de> <1449694457-5843-2-git-send-email-karcher@physik.fu-berlin.de> From: Laurent Vivier Message-ID: <5668A52C.1070408@vivier.eu> Date: Wed, 9 Dec 2015 23:03:24 +0100 MIME-Version: 1.0 In-Reply-To: <1449694457-5843-2-git-send-email-karcher@physik.fu-berlin.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 1/1] Fix do_rt_sigreturn on m68k linux userspace emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Karcher , Riku Voipio , qemu-devel@nongnu.org Cc: glaubitz@physik.fu-berlin.de Le 09/12/2015 21:54, Michael Karcher a écrit : > do_rt_sigreturn forgets to initialize the signal mask variable before > trying to use it to restore the mask, so the signal mask is undefined > after do_rt_sigreturn. This bug has been in all the time since > 7181155d when do_rt_sigreturn was implemented for m68k. > > Signed-off-by: Michael Karcher > --- > linux-user/signal.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/linux-user/signal.c b/linux-user/signal.c > index e03ed60..ae1014b 100644 > --- a/linux-user/signal.c > +++ b/linux-user/signal.c > @@ -5260,11 +5260,14 @@ long do_rt_sigreturn(CPUM68KState *env) > abi_ulong frame_addr = env->aregs[7] - 4; > target_sigset_t target_set; > sigset_t set; > - int d0; > + int d0, i; > > if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) > goto badframe; > > + for(i = 0; i < TARGET_NSIG_WORDS; i++) { > + target_set.sig[i] = frame->uc.tuc_sigmask.sig[i]; > + } > target_to_host_sigset_internal(&set, &target_set); > do_sigprocmask(SIG_SETMASK, &set, NULL); > > Nice catch. I agree with you that the current code is completely broken, but on the other architectures, this operation seems to be done directly by target_to_host_sigset(&set, &frame->uc.tuc_sigmask); Could you have try with that ? Thank you for your help, Laurent