Bug 21608 - __tls_get_addr() should have __attribute((force_align_arg_pointer)) on x86-64
Summary: __tls_get_addr() should have __attribute((force_align_arg_pointer)) on x86-64
Status: RESOLVED DUPLICATE of bug 21609
Alias: None
Product: glibc
Classification: Unclassified
Component: dynamic-link (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-17 23:47 UTC by Nicholas Miell
Modified: 2017-06-18 13:05 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
proposed glibc patch (718 bytes, patch)
2017-06-18 04:48 UTC, Nicholas Miell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas Miell 2017-06-17 23:47:08 UTC
Due to a gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066), there are binaries¹ in the wild² that call __tls_get_addr() with an improperly aligned stack. They will crash if anything in the subsequent call chain uses e.g. MOVAPS to store to the stack.

__tls_get_addr() should be annotated with __attribute__((force_align_arg_pointer)) on x86-64 to avoid this bug.



¹ Many games using the Unity engine.
² Fedora 26 beta
Comment 1 Nicholas Miell 2017-06-18 04:48:35 UTC
Created attachment 10152 [details]
proposed glibc patch
Comment 2 Florian Weimer 2017-06-18 09:46:58 UTC
Sorry, I didn't see this bug.  Mine has more references, so closing this one as a duplicate.

*** This bug has been marked as a duplicate of bug 21609 ***
Comment 3 Florian Weimer 2017-06-18 13:05:50 UTC
Note that patch does not work because we are not ready to move the GCC requirement to a version which supports force_align_arg_pointer on x86-64.