From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 224731F4B4 for ; Tue, 29 Sep 2020 06:55:07 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F1033857010; Tue, 29 Sep 2020 06:55:05 +0000 (GMT) Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 6F3293857C5F for ; Tue, 29 Sep 2020 06:55:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6F3293857C5F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1kN9XP-0004xU-HL; Tue, 29 Sep 2020 06:54:59 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1kN9XP-0006y6-Cs; Tue, 29 Sep 2020 08:54:59 +0200 From: Florian Weimer To: Rich Felker Subject: Re: [PATCH] Make abort() AS-safe (Bug 26275). References: <20200927141952.121047-1-carlos@redhat.com> <871rinm1fx.fsf@mid.deneb.enyo.de> <20200928234833.GC17637@brightrain.aerifal.cx> Date: Tue, 29 Sep 2020 08:54:59 +0200 In-Reply-To: <20200928234833.GC17637@brightrain.aerifal.cx> (Rich Felker's message of "Mon, 28 Sep 2020 19:48:33 -0400") Message-ID: <87d025jcn0.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlos O'Donell via Libc-alpha Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * Rich Felker: > Is there a reason to take the lock across fork rather than just > resetting it in the child? After seeing this I'm working on fixing the > same issue in musl and was about to take the lock, but realized ours > isn't actually protecting any userspace data state, just excluding > sigaction on SIGABRT during abort. It's also necessary to stop the fork because the subprocess could otherwise observe the impossible SIG_DFL state. In case the signal handler returns, the implementation needs to produce a termination status with SIGABRT as the termination signal, and the only way I can see to achieve that is to remove the signal handler and send the signal again. This suggests that a lock in sigaction is needed as well. But for the fork case, restting the lock in the new subprocess should be sufficient.