From patchwork Wed Dec 9 20:54:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Karcher X-Patchwork-Id: 554946 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 94906140F93 for ; Thu, 10 Dec 2015 11:33:50 +1100 (AEDT) Received: from localhost ([::1]:38676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6pB6-0004ZS-Bs for incoming@patchwork.ozlabs.org; Wed, 09 Dec 2015 19:33:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6lkw-0003Od-10 for qemu-devel@nongnu.org; Wed, 09 Dec 2015 15:54:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6lkt-00018q-9f for qemu-devel@nongnu.org; Wed, 09 Dec 2015 15:54:33 -0500 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:50122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6lkt-00018j-48 for qemu-devel@nongnu.org; Wed, 09 Dec 2015 15:54:31 -0500 Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.85) with esmtp (envelope-from ) id <1a6lks-001kFc-6Z>; Wed, 09 Dec 2015 21:54:30 +0100 Received: from port-92-204-102-138.dynamic.qsc.de ([92.204.102.138] helo=aquila.fritz.box) by inpost2.zedat.fu-berlin.de (Exim 4.85) with esmtpsa (envelope-from ) id <1a6lkr-003KV6-Rk>; Wed, 09 Dec 2015 21:54:30 +0100 From: Michael Karcher To: Riku Voipio , Laurent Vivier , qemu-devel@nongnu.org Date: Wed, 9 Dec 2015 21:54:17 +0100 Message-Id: <1449694457-5843-2-git-send-email-karcher@physik.fu-berlin.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449694457-5843-1-git-send-email-karcher@physik.fu-berlin.de> References: <1449694457-5843-1-git-send-email-karcher@physik.fu-berlin.de> X-Originating-IP: 92.204.102.138 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 130.133.4.66 X-Mailman-Approved-At: Wed, 09 Dec 2015 19:33:12 -0500 Cc: glaubitz@physik.fu-berlin.de Subject: [Qemu-devel] [PATCH 1/1] Fix do_rt_sigreturn on m68k linux userspace emulation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);