Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 388960 Details for
Bug 528558
sys-libs/glibc-2.20: TLS init crashes on hardened
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch making the TLS initialization avoiding the problematic sysenter
glibc_avoid_sysenter_on_tls_init_with_x86_pic.patch (text/plain), 2.04 KB, created by
Francisco Blas Izquierdo Riera
on 2014-11-09 19:13:30 UTC
(
hide
)
Description:
Patch making the TLS initialization avoiding the problematic sysenter
Filename:
MIME Type:
Creator:
Francisco Blas Izquierdo Riera
Created:
2014-11-09 19:13:30 UTC
Size:
2.04 KB
patch
obsolete
>From: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> >Subject: [PATCH] Use the no sysenter syscall when initializing TLS > >The glibc 2.20 uses INTERNAL_SYSCALL instead of some custom assembly to >initialize the thread local storage. This is a known chicken and egg problem >which Kevin F. Quinn solved for the sbrk call. > >This patch introduces a similar fix in TLS_INIT_TP to fix the issues caused by >commit. Special kudos to blueness for pinpointing commit >9570bc53fcc11d3cfe028989e611266e8d55bd09 > >This should fix Gentoo bug #528558 > >This patch is released under the GPLv2 or a higher version license as is the >original file as long as the author and the tester are credited. > >Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=528558 >Upstream-status: Not supported >Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> >Reported-by: Toralf Förster <toralf.foerster@gmx.de> >Pinpointed-by: Anthony Basile <blueness@gentoo.org> >Tested-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> > >--- sysdeps/i386/nptl/tls.h >+++ sysdeps/i386/nptl/tls.h >@@ -189,6 +189,15 @@ > desc->vals[3] = 0x51; > } > >+/* We have no sysenter until the tls is initialized which is a >+ problem on PIC. Thus we need to do the right call depending >+ on the situation. */ >+#ifndef INTERNAL_SYSCALL_NOSYSENTER >+#define TLS_INIT_SYSCALL INTERNAL_SYSCALL >+#else >+#define TLS_INIT_SYSCALL INTERNAL_SYSCALL_NOSYSENTER >+#endif >+ > /* Code to initially initialize the thread pointer. This might need > special attention since 'errno' is not yet available and if the > operation can cause a failure 'errno' must not be touched. */ >@@ -209,7 +218,7 @@ > \ > /* Install the TLS. */ \ > INTERNAL_SYSCALL_DECL (err); \ >- _result = INTERNAL_SYSCALL (set_thread_area, err, 1, &_segdescr.desc); \ >+ _result = TLS_INIT_SYSCALL (set_thread_area, err, 1, &_segdescr.desc); \ > \ > if (_result == 0) \ > /* We know the index in the GDT, now load the segment register. \
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 528558
:
388780
|
388884
|
388886
| 388960 |
389152
|
389536