From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 5E21E385842C for ; Thu, 25 May 2023 12:20:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E21E385842C 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-x32d.google.com with SMTP id 46e09a7af769-6af74ca9f4aso1431438a34.3 for ; Thu, 25 May 2023 05:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685017222; x=1687609222; 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=XQmk0h47faMhGXqaHooni19xtDzkLb9wOg9+INc0enw=; b=YmU93j9z+i7yGnXAFqTwvqreoET+iRWx1Jt7dAOBbLi57O7hFdT7hiSeql5nZTCVQz OFgm8KICW7hUiOh2TAr3Wca6geuJa+n9poHcWr5HFgO4oZ0hQAeuvFOO3yLxlYGjwL9w PKRTpfjHVen5adD8Es7pDosNBnNtPtcg+UgwiiUeS+L5YgrgC6Nefa60MfA3Fc4k9UEN PXPeuWsIW2jov1J54KJN/akTIJ4ItClIsj/IBOJFDG2H/czsJgxTwyZi14gpoylK6h6P TpjtJgfnEiug6fvRpyTlIne/y/eWd7nPCJTp2WOGRhDMi9DxBqhI0e+a1dwaNoTCF4Lo a4Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685017222; x=1687609222; 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=XQmk0h47faMhGXqaHooni19xtDzkLb9wOg9+INc0enw=; b=QNlw13JiIVHyTRu+HlMEJMiK7tBeIpUGM4DLqXusT6vDp5TKpEk0FtPhUy9qLI5YjW M1wjoqvI5drivwb/xEtdjiqaq882/IXSnBr5+ClYhFM3pNUPrVtnVTSyBGgylOsIyw+B LqK36DzYetCM8u/gaAvKpEjEy8QNrhrGaD0aTh4lfBOVVs5ckgnvR8KaK7C9IwDZBs5u JMWWMLVPRWHMxlP5b8LpEn5IAysbZ4cps2woumd3OaWM8u6n08deXr9hQbxKIW0rhtku ytgsTrHvbxPq1NbJw/xbjjv/X7oqMaphhn5wIR+/7QKWTxMrJVKmykhipOCqXAhINAZK n23g== X-Gm-Message-State: AC+VfDykbPnEQx428wrgAB+IN7tj5R1bXt7XrX5+4LQbJWzlScoiqOp/ 6MXxQIf4h37e60ljDMPRCbASY9ckuSxYidrWIyO9pQ== X-Google-Smtp-Source: ACHHUZ4UmMZ/291Y5U8s59vURBRH6gTzrGdElZ/a14ddUC3b7oTipTrCmfIN63zmP1n5m0h/zpo31Q== X-Received: by 2002:a05:6830:1508:b0:6af:95d1:60d1 with SMTP id k8-20020a056830150800b006af95d160d1mr3599552otp.4.1685017222711; Thu, 25 May 2023 05:20:22 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:4dd5:80c6:51f7:4cf7:20d3? ([2804:1b3:a7c1:4dd5:80c6:51f7:4cf7:20d3]) by smtp.gmail.com with ESMTPSA id q4-20020a9d4b04000000b006ae7c3eaf4esm563577otf.26.2023.05.25.05.20.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 May 2023 05:20:22 -0700 (PDT) Message-ID: Date: Thu, 25 May 2023 09:20:19 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] setipv4sourcefilter: Avoid using alloca. Content-Language: en-US To: Siddhesh Poyarekar , Florian Weimer 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> <341f8301-7259-6102-22d7-6c03e88594b7@gotplt.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <341f8301-7259-6102-22d7-6c03e88594b7@gotplt.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.8 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 25/05/23 08:57, Siddhesh Poyarekar wrote: > 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? I don't think it is worth, this requirement will be in the next POSIX [1] and it also means that we will need to propagate this assumption on all internal glibc code (which is only boilerplate code in the end). [1] https://www.austingroupbugs.net/view.php?id=385