[PATCH v2 10/13] posix: Improve thread safety of functions using environ with execveat
Cristian Rodríguez
cristian@rodriguez.im
Thu Nov 28 18:41:56 GMT 2024
On Thu, Nov 28, 2024 at 2:46 PM Adhemerval Zanella Netto <
adhemerval.zanella@linaro.org> wrote:
>
>
> On 28/11/24 05:22, Florian Weimer wrote:
>
> >> Can't we use MADV_DONTFORK here? There still the small windows between
> >> mmap return and madvise call, but I am not very confident that adding
> >> a possible unbounded dynamic stack allocation is best way forward
> >> here.
> >
> > No, the vfork has already happened at this point. We would need
> > something to unmap the mapping on a successful execve call.
>
> Right, and it is not clear that vfork would always execv*. I still
> don't like this stack solution, but I also don't have a better solution.
>
It is my understanding there isn' t better solution without kernel
support.. __cleanup__ attribute will not work on this case..or will it ? I
haven't tried.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20241128/a65ec487/attachment-0001.htm>
More information about the Libc-alpha
mailing list