]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Open libgcc.so with RTLD_NOW during pthread_cancel [BZ #22636]
authorFlorian Weimer <fweimer@redhat.com>
Mon, 15 Jan 2018 15:05:36 +0000 (16:05 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 28 Dec 2018 14:03:05 +0000 (15:03 +0100)
Disabling lazy binding reduces stack usage during unwinding.

Note that RTLD_NOW only makes a difference if libgcc.so has not
already been loaded, so this is only a partial fix.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit f993b8754080ac7572b692870e926d8b493db16c)

ChangeLog
NEWS
sysdeps/nptl/unwind-forcedunwind.c

index 7f37d678be2ea5ea59c1fb439ae04266ec385bb3..48292d6bf05e4111ed31f7c1154b50edebf396aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-10  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #22636]
+       * sysdeps/nptl/unwind-forcedunwind.c (pthread_cancel_init): Open
+       libgcc.so with RTLD_NOW, to avoid lazy binding during unwind.
+
 2018-01-08  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
        [BZ #22637]
diff --git a/NEWS b/NEWS
index f2e9b3bf9f91f9ea849a86db6ee5b5a57b0480a3..9a11b86b115499e8414d0930ad970f852f1943b0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -71,6 +71,7 @@ The following bugs are resolved with this release:
   [21609] x86-64: Align the stack in __tls_get_addr
   [21624] Unsafe alloca allows local attackers to alias stack and heap (CVE-2017-1000366)
   [21654] nss: Fix invalid cast in group merging
+  [22636] PTHREAD_STACK_MIN is too small on x86-64
   [22637] nptl: Fix stack guard size accounting
   [22644] string: memmove-sse2-unaligned on 32bit x86 produces garbage when
     crossing 2GB threshold (CVE-2017-18269)
index ca757c48ce60d3f4b827cee0b7a48593d713ef1b..24a1c5b30d3d686b4a99653ecdaccb664d042b33 100644 (file)
@@ -49,7 +49,7 @@ pthread_cancel_init (void)
       return;
     }
 
-  handle = __libc_dlopen (LIBGCC_S_SO);
+  handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN);
 
   if (handle == NULL
       || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL