From patchwork Thu Jan 12 22:39:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 714701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v011R0NkJz9srY for ; Fri, 13 Jan 2017 09:40:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="UUoKskU8"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=Yq9fEAmhGFwRTLqhvadfoTwJIiXIp qMyslmeUFt6/rQbJz4Hrvc12ocQnNlvb/oXoCZtxwqOMe6dxIGsOLOLNeX8QmDkq xzddXX7woOdcipfuA2yGguYMHFCRXuLQrG3G+B0Qh47kVKmnU+pDi1cE0Er23sBv MtzuRBXsG0ax2s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=1ELU8VVrtXgxGw/h5XDrxujTvsQ=; b=UUo KskU8NgETfU1E7QoH+3bSCSAfhbUUfvrmV+9Ot+rCgwV2qdQvPAfoKfv2cxyH455 SKpXckq6AbeypHtwCLzzNN6/l2Q6XKlyd+TBSDXIz4xLR0nRs+MBrCXpbDa59ZhS UWK48ZoK58uD52QKKyrnZlWe67SUMjUwC/9C1yGQ= Received: (qmail 127907 invoked by alias); 12 Jan 2017 22:40:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 127893 invoked by uid 89); 12 Jan 2017 22:40:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:1422, 2718 X-HELO: relay1.mentorg.com Date: Thu, 12 Jan 2017 22:39:55 +0000 From: Joseph Myers To: Subject: Make soft-float powerpc swapcontext restore the signal mask (bug 21045) Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) The soft-float powerpc version of swapcontext does not restore the signal mask, resulting in stdlib/tst-setcontext2 failing: after getcontext after setcontext after swapcontext FAIL: SIGUSR2 is blocked after swapcontext. This patch fixes this by adjusting the arguments passed to __sigprocmask so that it restores the saved signal mask as well as saving the existing one. (For hard-float, this code is only used for a compat symbol, not for the current version of swapcontext.) Tested for soft-float powerpc. Any comments? 2017-01-12 Joseph Myers [BZ #21045] * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S (__CONTEXT_FUNC_NAME): Pass address of signal mask to be restored to __sigprocmask. diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S index a0bcbf1..6696d54 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S @@ -271,7 +271,8 @@ ENTRY(__CONTEXT_FUNC_NAME) /* Restore ucontext (parm1) from stack. */ lwz r12,_FRAME_PARM_SAVE1(r1) - li r4,0 + lwz r4,_FRAME_PARM_SAVE2(r1) + addi r4,r4,_UC_SIGMASK stw r3,_UC_REGS_PTR(r12) addi r5,r12,_UC_SIGMASK li r3,SIG_SETMASK