From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 100953858D1E for ; Wed, 2 Aug 2023 13:08:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 100953858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6bca7d82d54so2448570a34.3 for ; Wed, 02 Aug 2023 06:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690981700; x=1691586500; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=SGebPdaxrgCEbq/Y1WL2RLFgizMamrWBlJu5kWAn+08=; b=FN3LpGv1Uaanym5rhGbw5Xh7u4QPDgVvQOh7MN66Gj9MiBccVEKbpKG2uBkskDi507 2R41vsqQq3qch6kEEavQ+qKEEJiD+e4/Sr3VI/w0fyinYx0A0pXmLoM4EyvQEq0X+rAg eXIy8MzA4lfcQ/batIuUy9HgrWqPePuArpy3McVHndHM3krBX6KpIkAqtNF5LKI3eMbp cmEQEZYasiUQz9L98NdAIVxvOEb/G8lKKV7jdp7VJGnHLNbZFUxZTSsqWWeMZV6cuF16 afGvc85Yj8CPDn742SpO/jMVCfVTcfMZSKWEC7PCZpRP5Jv8bsfx3eAd00SUtCNp8zse 9aYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690981700; x=1691586500; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SGebPdaxrgCEbq/Y1WL2RLFgizMamrWBlJu5kWAn+08=; b=LV0l5f+Z/eakwWfpMC7I5KztZSecpX4ZdiKTmBT4TNSCbqODi0OTA0qUDBOVSdFyFR lwx/1moPf3dzsrrcgFk63hdcLu7c9OeM8iOYt+GaeWQ8WZrZv+QR0N5aMxnph4fZl0ax Kla+v9LN1hqqXVOlQgxicJvwQdJj2MTaSHZwKFvDvPUqUZU9P7IjXgLdCsuHzg/Va+sg +0n69rotp2Ot7axcUo3MTaj4y3d6qdr0lAA1HfAVwg00BpYI6df+fWsEBqxCvUEfvTCN RdoSyde+JFgUo922UWjY/TMeRHjBGZtuFV2ZcCQkDYEQsH4jgGfKPuk9OxwSyt8QWlgE hKhg== X-Gm-Message-State: ABy/qLYW175AHLQAD/JMT1DRrWnVG5gI70xD3sg9ZEtWuf4ULyk3iJlt bVQbAehu9NS+npgqVFpfV0k2O64rQjZiYd0Cnzn9cQ== X-Google-Smtp-Source: APBJJlHaWzEaaj3A47Kelby/YMb6SJ0lzhkYF78PkCdWOwwb67HpOvT97UrhzCz5GHkF5r+WcpUFZQ== X-Received: by 2002:a9d:5c10:0:b0:6b7:5086:2f59 with SMTP id o16-20020a9d5c10000000b006b750862f59mr14388128otk.23.1690981700415; Wed, 02 Aug 2023 06:08:20 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:9aa9:84f6:53b3:4cd0:ffe6? ([2804:1b3:a7c1:9aa9:84f6:53b3:4cd0:ffe6]) by smtp.gmail.com with ESMTPSA id d25-20020a9d5e19000000b006b9e81d94a7sm5874537oti.70.2023.08.02.06.08.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Aug 2023 06:08:19 -0700 (PDT) Message-ID: Date: Wed, 2 Aug 2023 10:08:16 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 2/2] stdlib: Make abort AS-safe (BZ 26275) Content-Language: en-US To: Florian Weimer , Adhemerval Zanella via Libc-alpha Cc: Carlos O'Donell References: <20230731171900.4065501-1-adhemerval.zanella@linaro.org> <20230731171900.4065501-3-adhemerval.zanella@linaro.org> <87h6phyiz5.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <87h6phyiz5.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 02/08/23 04:57, Florian Weimer wrote: > * Adhemerval Zanella via Libc-alpha: > >> + /* There is a SIGABRT handler installed and it returned, or SIGABRT was >> + blocked or ignored. In this case use a AS-safe lock to prevent sigaction >> + to change the signal disposition, reinstall the handle to abort the > > typo: handle[r] > > Maybe mention here that the handler cannot change again because > sigaction blocks on the lock? Ack. > > I also don't quite understand why we need to take the abort lock in > posix_spawn. There isn't any user code that can run in the same address > space after the vfork. My understanding is the potential issues is if caller sets a SIG_IGN for SIGABRT, calls abort, and another thread issues posix_spawn just after the sigaction returns. With default options (not setting POSIX_SPAWN_SETSIGDEF), the process can still see SIG_DFL for SIGABRT, where it should be SIG_IGN.