This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.11-46-g1c3c269


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  1c3c269b55c84c29ec1e2c70f122c5e33fef4257 (commit)
      from  ee5a5ba6725ee949483f043cd0cf2a1579b6b509 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1c3c269b55c84c29ec1e2c70f122c5e33fef4257

commit 1c3c269b55c84c29ec1e2c70f122c5e33fef4257
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Tue Nov 24 11:17:06 2009 -0800

    Fix startup to security-relevant statically linked binaries.
    
    Before the change they crash on startup.  Perform IREL relocations
    earlier to prevent this.

diff --git a/ChangeLog b/ChangeLog
index 3d22169..dd68e5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-24  Ulrich Drepper  <drepper@redhat.com>
+
+	* csu/elf-init.c (__libc_csu_irel): New function.  Code to perform
+	irel relocations split out from...
+	(__libc_csu_init): ...here.
+	* csu/libc-start.c [!SHARED]: Call __libc_csu_irel early.
+
 2009-11-23  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Use struct timespec
diff --git a/csu/elf-init.c b/csu/elf-init.c
index 1d2df62..1e3d6d6 100644
--- a/csu/elf-init.c
+++ b/csu/elf-init.c
@@ -72,15 +72,14 @@ extern void _fini (void);
 /* These functions are passed to __libc_start_main by the startup code.
    These get statically linked into each program.  For dynamically linked
    programs, this module will come from libc_nonshared.a and differs from
-   the libc.a module in that it doesn't call the preinit array.  */
+   the libc.a module in that it doesn't call the preinit array and performs
+   explicit IREL{,A} relocations.  */
 
-void
-__libc_csu_init (int argc, char **argv, char **envp)
-{
-  /* For dynamically linked executables the preinit array is executed by
-     the dynamic linker (before initializing any shared object.  */
 
 #ifndef LIBC_NONSHARED
+void
+__libc_csu_irel (void)
+{
 # ifdef USE_MULTIARCH
 #  ifdef ELF_MACHINE_IRELA
   {
@@ -98,7 +97,17 @@ __libc_csu_init (int argc, char **argv, char **envp)
   }
 #  endif
 # endif
+}
+#endif
 
+
+void
+__libc_csu_init (int argc, char **argv, char **envp)
+{
+  /* For dynamically linked executables the preinit array is executed by
+     the dynamic linker (before initializing any shared object.  */
+
+#ifndef LIBC_NONSHARED
   /* For static executables, preinit happens right before init.  */
   {
     const size_t size = __preinit_array_end - __preinit_array_start;
diff --git a/csu/libc-start.c b/csu/libc-start.c
index 80b672f..dc7ca55 100644
--- a/csu/libc-start.c
+++ b/csu/libc-start.c
@@ -24,6 +24,9 @@
 #include <bp-sym.h>
 
 extern void __libc_init_first (int argc, char **argv, char **envp);
+#ifndef SHARED
+extern void __libc_csu_irel (void);
+#endif
 
 extern int __libc_multiple_libcs;
 
@@ -134,6 +137,9 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
     }
 # endif
 
+  /* Performe IREL{,A} relocations.  */
+  __libc_csu_irel ();
+
   /* Initialize the thread library at least a bit since the libgcc
      functions are using thread functions if these are available and
      we need to setup errno.  */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |    7 +++++++
 csu/elf-init.c   |   21 +++++++++++++++------
 csu/libc-start.c |    6 ++++++
 3 files changed, 28 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]