about summary refs log tree commit diff
path: root/sysdeps/nptl/fork.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-03-01 15:56:36 +0100
committerFlorian Weimer <fweimer@redhat.com>2021-03-01 15:58:01 +0100
commit9fc813e1a37d2e2d5e85a97d5ac4fc1c15d839fb (patch)
tree62e5002b97acab6f776476c2325a37097693b0ea /sysdeps/nptl/fork.c
parent764e9a0334350f52ab6953bef1db97f9b2e89ca5 (diff)
downloadglibc-9fc813e1a37d2e2d5e85a97d5ac4fc1c15d839fb.tar.gz
glibc-9fc813e1a37d2e2d5e85a97d5ac4fc1c15d839fb.tar.xz
glibc-9fc813e1a37d2e2d5e85a97d5ac4fc1c15d839fb.zip
Implement <unwind-link.h> for dynamically loading the libgcc_s unwinder
This will be used to consolidate the libgcc_s access for backtrace
and pthread_cancel.

Unlike the existing backtrace implementations, it provides some
hardening based on pointer mangling.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/nptl/fork.c')
-rw-r--r--sysdeps/nptl/fork.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
index 26703d958f..4fb4c2d254 100644
--- a/sysdeps/nptl/fork.c
+++ b/sysdeps/nptl/fork.c
@@ -33,6 +33,7 @@
 #include <futex-internal.h>
 #include <malloc/malloc-internal.h>
 #include <nss/nss_database.h>
+#include <unwind-link.h>
 
 static void
 fresetlockfiles (void)
@@ -116,6 +117,8 @@ __libc_fork (void)
       /* Reset the lock state in the multi-threaded case.  */
       if (multiple_threads)
 	{
+	  __libc_unwind_link_after_fork ();
+
 	  /* Release malloc locks.  */
 	  call_function_static_weak (__malloc_fork_unlock_child);