[PATCH] setipv4sourcefilter: Avoid using alloca.

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Thu May 25 11:04:22 GMT 2023



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.


More information about the Libc-alpha mailing list