On 01/02/2016 11:34 AM, Marcin KoÅcielnicki wrote:
Preparation for gcc -fsplit-stack support (gcc bug #68191). The new
field is basically identical to the one on x86. Its TCB offset needs
to be constant, as it'll be hardcoded in gcc.
* sysdeps/s390/nptl/tls.h: Add __private_ss to struct tcbhead.
What happens if you run newly compiled code with split-stack support on
a glibc that doesn't include this space allocated in tcbhead_t? You get
a write beyond the tcbhead_t into some other data? Depending on the thread
memory layout that could be a guard page or static TLS data?
This is the same problem we saw in POWER when adding a field in tcbhead_t
for fast-architecture access.
The only way to do this compatibly is to add a versioned symbol that
the compiler references to in order to prevent new binaries from
running on old glibc and crashing or worse silently corrupting data.
To reiterate: How do you plan to handle compatibility for this new feature?
If you did an analysis of nptl/allocatestack.c and showed that there were
still alignment bytes left, that might be one way to work around this without
needing a versioned reference.