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-271-g04f2902


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  04f2902d9fadb2b8221162247412fb2c4667d95e (commit)
      from  b170ff0f8fb25d43dc6d6e9484fc33234110fd8d (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=04f2902d9fadb2b8221162247412fb2c4667d95e

commit 04f2902d9fadb2b8221162247412fb2c4667d95e
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Thu Mar 18 13:15:27 2010 -0700

    Future safety in checking ELF header.
    
    If we should use further fields in the e_ident array in the ELF header
    of files we want zero to mean the default.  Enforce zero for now so
    that non-optional features indicated by nonzero values are not go
    unnoticed when using an old dynamic linker.

diff --git a/ChangeLog b/ChangeLog
index 92b6a91..9ff497d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-18  Ulrich Drepper  <drepper@redhat.com>
+
+	* elf/dl-load.c (open_verify): Extend expected to the full size of the
+	e_ident array.  When loading, check that the fields in e_ident we don't
+	know are zero to allow future extensions.
+
 2010-03-18  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* sysdeps/i386/i686/multiarch/memcmp-ssse3.S: Update %xmm3
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 756816f..d8f9131 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1573,7 +1573,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
 #elif defined MORE_ELF_HEADER_DATA
   MORE_ELF_HEADER_DATA;
 #endif
-  static const unsigned char expected[EI_PAD] =
+  static const unsigned char expected[EI_NIDENT] =
   {
     [EI_MAG0] = ELFMAG0,
     [EI_MAG1] = ELFMAG1,
@@ -1657,7 +1657,10 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
       if (__builtin_expect (! VALID_ELF_HEADER (ehdr->e_ident, expected,
 						EI_ABIVERSION)
 			    || !VALID_ELF_ABIVERSION (ehdr->e_ident[EI_OSABI],
-						      ehdr->e_ident[EI_ABIVERSION]),
+						      ehdr->e_ident[EI_ABIVERSION])
+			    || memcmp (&ehdr->e_ident[EI_PAD],
+				       &expected[EI_PAD],
+				       EI_NIDENT - EI_PAD) != 0,
 			    0))
 	{
 	  /* Something is wrong.  */
@@ -1701,6 +1704,9 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
 	  else if (!VALID_ELF_ABIVERSION (ehdr->e_ident[EI_OSABI],
 					  ehdr->e_ident[EI_ABIVERSION]))
 	    errstring = N_("ELF file ABI version invalid");
+	  else if (memcmp (&ehdr->e_ident[EI_PAD], &expected[EI_PAD],
+			   EI_NIDENT - EI_PAD) != 0)
+	    errstring = N_("nonzero padding in e_ident");
 	  else
 	    /* Otherwise we don't know what went wrong.  */
 	    errstring = N_("internal error");

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

Summary of changes:
 ChangeLog     |    6 ++++++
 elf/dl-load.c |   10 ++++++++--
 2 files changed, 14 insertions(+), 2 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]