[PATCH v2] x32: Use THREAD_SELF for RSEQ_* accessors

Florian Weimer fw@deneb.enyo.de
Sun Aug 24 12:00:21 GMT 2025


* Uros Bizjak:

> An alternative approach would be to figure why is __rseq_offset
> negative. One would expect that since %fs points to the beginning of
> the TCB block, then all offsets from %fs should be positive. Perhaps
> the RSEQ area could be placed elsewhere in the TCB block to guarantee
> positive offset?

In current glibc, the rseq is variably sized and treated like
initial-exec TLS.  In the current allocator, initial-exec TLS is
allocated at lower addresses than local-exec TLS.  The ABI requires
that local-exec TLS is allocated immediately before the TCB in memory.
We can place the rseq area (and initial-exec TLS) after the TCB, but
that requires another initial-exec TLS allocator (and we already have
two).  I hope that one day, we can merge the two allocators (both of
which are not really efficient), and also make it possible to
implement TLS layouts like the one you are proposing quite
straightforward.  A new TLS allocator is also desirable because we
need to reserve extra address space for TLS for the main thread, so
that dlopen and auditing succeeds in more cases.


More information about the Libc-alpha mailing list