[PATCH] x86-64: Align the stack in __tls_get_addr [BZ #21609]
Florian Weimer
fweimer@redhat.com
Mon Jun 19 10:18:00 GMT 2017
This is a follow-up to bug 15128, where an unaligned stack was
compensated for in the dynamic linker relocation trampoline.
__tls_get_addr itself was not fixed, though, and the function can reach
deeply into libc due to its malloc dependency, so can result crashes
with an unaligned stack, too.
The attached patch adds a compatibility implementation of __tls_get_addr
which aligns the stack, but only on the slow path. Internal calls go to
the default implementation (from elf/dl-tls.c) which does not perform
stack realignment.
I plan to submit a follow-up patch which adds a new symbol version for
__tls_get_addr which bypasses the stack alignment for new binaries.
In my patch, the CFI annotations need review. I have never written
those before.
Thanks,
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tls.patch
Type: text/x-patch
Size: 8388 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170619/ddf4169d/attachment.bin>
More information about the Libc-alpha
mailing list