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.13-251-g01f16ab


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  01f16ab0a581838d44ad79e82c0c3e1691d8506e (commit)
      from  7ae22829afb2b4ca531d1c00437d428f55d59341 (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=01f16ab0a581838d44ad79e82c0c3e1691d8506e

commit 01f16ab0a581838d44ad79e82c0c3e1691d8506e
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Mon May 30 01:55:40 2011 -0400

    Prevent loader from loading itself

diff --git a/ChangeLog b/ChangeLog
index 70dbc40..bb7f02e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-05-30  Ulrich Drepper  <drepper@gmail.com>
+
+	* elf/rtld.c (dl_main): Don't allow the loader to load itself.
+
 2011-05-29  Ulrich Drepper  <drepper@gmail.com>
 
 	[BZ #12350]
diff --git a/elf/rtld.c b/elf/rtld.c
index 174954b..9eb9289 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1076,6 +1076,14 @@ of this helper program; chances are you did not intend to run this program.\n\
       /* Now the map for the main executable is available.  */
       main_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
 
+      if (GL(dl_rtld_map).l_info[DT_SONAME] != NULL
+	  && main_map->l_info[DT_SONAME] != NULL
+	  && strcmp ((const char *) D_PTR (&GL(dl_rtld_map), l_info[DT_STRTAB])
+		     + GL(dl_rtld_map).l_info[DT_SONAME]->d_un.d_val,
+		     (const char *) D_PTR (main_map, l_info[DT_STRTAB])
+		     + main_map->l_info[DT_SONAME]->d_un.d_val) == 0)
+	_dl_fatal_printf ("loader cannot load itself\n");
+
       phdr = main_map->l_phdr;
       phnum = main_map->l_phnum;
       /* We overwrite here a pointer to a malloc()ed string.  But since

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

Summary of changes:
 ChangeLog  |    4 ++++
 elf/rtld.c |    8 ++++++++
 2 files changed, 12 insertions(+), 0 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]