From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from boar.tulip.relay.mailchannels.net (boar.tulip.relay.mailchannels.net [23.83.218.250]) by sourceware.org (Postfix) with ESMTPS id 55B753858D32 for ; Thu, 25 May 2023 11:58:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 55B753858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 0136F7E243C; Thu, 25 May 2023 11:57:57 +0000 (UTC) Received: from pdx1-sub0-mail-a306.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 894907E23CD; Thu, 25 May 2023 11:57:56 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1685015876; a=rsa-sha256; cv=none; b=F1ox7KPyd9uHFN2AQEqkjt+OY/yAKss7QnwbUwadVX51mHIVkQFlTp8rcAN8BuN99JR8Zm 6AlS9194XNpaKTAX2i0CubPLGn9zckk1/RZNSfeeldN2M6SpTgqMlKtqu62iKeh5UTlkKL rWyp44cjR0weCYyqVuDidHip24wU3NuO0Jta6xaba8LrouzIDzSYjeRTFvVy9MIc0TVsRx U4m5qbGxP1aVNgdxyImu2U0YlMI9Ycx/uIgdI/4Qs6D3IPY4nkYgwVNZZI6MIBf4tlF4Z5 h++Uwf9dyHu2rnLkRMLP3z6m22HFNtvdjUOf4W/m0GiZ1WdgZmw/sYcS0PObWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1685015876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=87gZEVrseFcdmBwHJ2sLAcGyAkVWND+Q6VrropEg3Aw=; b=gVkv3WwHIGTpu98eTnp3NYQKtkPxlclw1+s5Cva3ZnnHc1vYb0AGY4Y5vk/bKqO1LHNaEb ytyXmhvEtpeVdfBsBHBix8wU807oWJc31yg+jme9urZWFLRDp1L/0BaLZeVCm3UOTuNDhs 7zQwm17N1DtwEza911gylUAAr6me/ebNYgUt5Aq3SSNBiMLWRZJQXKKlNHwxWxQ878WH3g n96P2ZBSsWtDTCUULxD6Nq6KewjWLXGHbLAyNwPgouwvdBktmaQpOzq6GEK6Mb0S7xHdvY V6daoKHKBRw+zfnYnpjmmftK1WnWuSiqP54ydjxLgkwTq3hmMPQywykiBmYD7A== ARC-Authentication-Results: i=1; rspamd-79bb5575d7-wk5nl; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Bubble-Bored: 4ae150b178be48f6_1685015876802_127685214 X-MC-Loop-Signature: 1685015876802:1638397035 X-MC-Ingress-Time: 1685015876802 Received: from pdx1-sub0-mail-a306.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.104.253.217 (trex/6.8.1); Thu, 25 May 2023 11:57:56 +0000 Received: from [192.168.0.182] (bras-vprn-toroon4834w-lp130-02-142-113-138-85.dsl.bell.ca [142.113.138.85]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a306.dreamhost.com (Postfix) with ESMTPSA id 4QRmlR6xkyz1n; Thu, 25 May 2023 04:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1685015876; bh=87gZEVrseFcdmBwHJ2sLAcGyAkVWND+Q6VrropEg3Aw=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=iPUfjSTfKyX/BWvFcV0k20Z7pvqC/pgIjDqt20IDul+3UnDSVcuH12eHz+vTX771V 7x3MZO/LcGmy6p6fN7POYScLy7zicvw6KnZA8Kg8vxAw/fPoDihRlIXDppAGPwzbGi M5xqg3gmXPXuHSez7NT6N8MZO7Lhb26v8lb+TG/7M4jldY/IRprmWurbTXolIDZXYC rAB0IcYJ0E1HA2PnVuzU6IKAXF4UEtsg+AK7f1fpOlan8GnyUZUBLUcrTvrA/lfVRO +2nTTHhV9JsVjirRThKrxlGlqGBHwT80RagozLNga9sjdWlKlik7aQ4Bjxf9JMn9NQ QLmiODDH/2DBg== Message-ID: <341f8301-7259-6102-22d7-6c03e88594b7@gotplt.org> Date: Thu, 25 May 2023 07:57:54 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] setipv4sourcefilter: Avoid using alloca. Content-Language: en-US To: Florian Weimer , Adhemerval Zanella Netto Cc: Joe Simmons-Talbott , libc-alpha@sourceware.org References: <20230524181831.41099-1-josimmon@redhat.com> <5a4468f7-d72e-d252-88bf-0c17e349299c@gotplt.org> <87o7m8q30e.fsf@oldenburg.str.redhat.com> <87bki8lkgt.fsf@oldenburg.str.redhat.com> From: Siddhesh Poyarekar In-Reply-To: <87bki8lkgt.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3031.4 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 2023-05-25 07:27, Florian Weimer wrote: > * Adhemerval Zanella Netto: > >> On 25/05/23 04:33, Florian Weimer via Libc-alpha wrote: >>> * Siddhesh Poyarekar: >>> >>>> scratch_buffer_free will also likely tamper with errno (it calls free >>>> after all) so it might make sense to save/restore errno here. In fact >>>> I wonder if it makes sense to have scratch_buffer_free do that so that >>>> it's always safe to use it without worrying about errno. >>> >>> We need to change free not to clobber errno. Mainly this requires >>> protecting munmap and mprotect calls. It's a QoI issue. >>> >>> Thanks, >>> Florian >> >> We already save/restore errno on free since 69fda43b8dd795c. We can optimize >> it a bit by adding munmap/mprotect that calls INTERNAL_SYSCALL_CALL, but I >> am not sure if the complexity will really be worth here. > > Ah, right, then scratch_buffer_free should be okay, too. I guess, but should we still stick to preserving errno to account for lack of errno preservation in non-glibc malloc implementations? Thanks, Sid