[PATCH v4 1/2] malloc: Randomize the alignment of the thread heaps [BZ #22853]

Florian Weimer fweimer@redhat.com
Mon Nov 9 19:40:23 GMT 2026


* Adhemerval Zanella Netto:

> I think we should remove this, and always use the random residue. Nothing in
> the scheme depends on the residue being zero when ASLR is off, also:
>
>   * It adds a system call to the start-up of every process, threaded
>     or not, before main. 
>
>   * personality is not universally allowed by seccomp filters.  In systemd,
>     personality is only in the @system-service group, not in @default or
>     @process.
>
>   * It is not consistent with what we do elsewhere.  The stack protector
>     canary and the tcache key are random under ADDR_NO_RANDOMIZE as well,
>     and the patch does not honor kernel.randomize_va_space=0 either.
>
> If someone needs reproducible thread heaps, a tunable can be added
> later; it is cheaper than a system call in every process.

How predictable are thread heap addresses today under GDB?  If they are
predictable today, I think we should preserve this behavior.

We only need it when creating the first thread arena, right?  I think a
delayed initialization scheme would address the overhead concern.

Thanks,
Florian



More information about the Libc-alpha mailing list