public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>,
	Siddhesh Poyarekar <siddhesh@gotplt.org>
Cc: Joe Simmons-Talbott <josimmon@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] setipv4sourcefilter: Avoid using alloca.
Date: Thu, 25 May 2023 08:04:22 -0300	[thread overview]
Message-ID: <dee59377-898f-bb3a-09f5-5368f466692a@linaro.org> (raw)
In-Reply-To: <87o7m8q30e.fsf@oldenburg.str.redhat.com>



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.

  reply	other threads:[~2023-05-25 11:04 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 [this message]
2023-05-25 11:27       ` Florian Weimer
2023-05-25 11:57         ` Siddhesh Poyarekar
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=dee59377-898f-bb3a-09f5-5368f466692a@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=josimmon@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=siddhesh@gotplt.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).