From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: Florian Weimer <fweimer@redhat.com>,
Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: Joe Simmons-Talbott <josimmon@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] setipv4sourcefilter: Avoid using alloca.
Date: Thu, 25 May 2023 07:57:54 -0400 [thread overview]
Message-ID: <341f8301-7259-6102-22d7-6c03e88594b7@gotplt.org> (raw)
In-Reply-To: <87bki8lkgt.fsf@oldenburg.str.redhat.com>
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
next prev parent reply other threads:[~2023-05-25 11:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 18:18 Joe Simmons-Talbott
2023-05-25 2:09 ` Siddhesh Poyarekar
2023-05-25 7:33 ` Florian Weimer
2023-05-25 11:04 ` Adhemerval Zanella Netto
2023-05-25 11:27 ` Florian Weimer
2023-05-25 11:57 ` Siddhesh Poyarekar [this message]
2023-05-25 12:20 ` Adhemerval Zanella Netto
2023-05-25 12:25 ` Siddhesh Poyarekar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=341f8301-7259-6102-22d7-6c03e88594b7@gotplt.org \
--to=siddhesh@gotplt.org \
--cc=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=josimmon@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).