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.16-ports-merge-494-g88481c1


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  88481c163885767a6617823314802aa772271804 (commit)
      from  89f1c38881d566bb731711632ac84ee1e3d883ee (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=88481c163885767a6617823314802aa772271804

commit 88481c163885767a6617823314802aa772271804
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Sat Oct 20 08:00:58 2012 +0530

    Retry read in ld.so if the entire ELF header is not read in
    
    [BZ #13601]
    
    A read operation could return less than requested data for a number of
    reasons.

diff --git a/ChangeLog b/ChangeLog
index e5d8bba..eb60959 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-10-20  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	[BZ #13601]
+	* elf/dl-load.c (open_verify): Retry read if the entire ELF
+	header is not read in.
+
 2012-10-19  Joseph Myers  <joseph@codesourcery.com>
 
 	* io/Makefile ($(objpfx)ftwtest.out): Depend on ftwtest-sh.  Pass
diff --git a/NEWS b/NEWS
index aa40b75..fd3f6e5 100644
--- a/NEWS
+++ b/NEWS
@@ -10,13 +10,13 @@ Version 2.17
 * The following bugs are resolved with this release:
 
   1349, 3479, 5044, 5298, 5400, 6530, 6778, 6808, 9685, 9914, 10014, 10038,
-  10631, 11438, 11607, 12140, 13412, 13542, 13629, 13679, 13696, 13717,
-  13741, 13939, 13966, 14042, 14090, 14150, 14151, 14154, 14157, 14166,
-  14173, 14195, 14237, 14251, 14252, 14283, 14298, 14303, 14307, 14328,
-  14331, 14336, 14337, 14347, 14349, 14376, 14417, 14459, 14476, 14477,
-  14505, 14510, 14516, 14518, 14519, 14530, 14532, 14538, 14543, 14544,
-  14545, 14557, 14562, 14568, 14576, 14579, 14583, 14587, 14602, 14621,
-  14638, 14645, 14648, 14652, 14660, 14661, 14694, 14716.
+  10631, 11438, 11607, 12140, 13412, 13542, 13601, 13629, 13679, 13696,
+  13717, 13741, 13939, 13966, 14042, 14090, 14150, 14151, 14154, 14157,
+  14166, 14173, 14195, 14237, 14251, 14252, 14283, 14298, 14303, 14307,
+  14328, 14331, 14336, 14337, 14347, 14349, 14376, 14417, 14459, 14476,
+  14477, 14505, 14510, 14516, 14518, 14519, 14530, 14532, 14538, 14543,
+  14544, 14545, 14557, 14562, 14568, 14576, 14579, 14583, 14587, 14602,
+  14621, 14638, 14645, 14648, 14652, 14660, 14661, 14694, 14716.
 
 * Support for STT_GNU_IFUNC symbols added for s390 and s390x.
   Optimized versions of memcpy, memset, and memcmp added for System z10 and
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 0bfa74a..4b57879 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1722,10 +1722,20 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
       /* We successfully openened the file.  Now verify it is a file
 	 we can use.  */
       __set_errno (0);
-      fbp->len = __libc_read (fd, fbp->buf, sizeof (fbp->buf));
+      fbp->len = 0;
+      assert (sizeof (fbp->buf) > sizeof (ElfW(Ehdr)));
+      /* Read in the header.  */
+      do
+        {
+          ssize_t retlen = __libc_read (fd, fbp->buf + fbp->len,
+					sizeof (fbp->buf) - fbp->len);
+	  if (retlen <= 0)
+	    break;
+	  fbp->len += retlen;
+	}
+      while (__builtin_expect (fbp->len < sizeof (ElfW(Ehdr)), 0));
 
       /* This is where the ELF header is loaded.  */
-      assert (sizeof (fbp->buf) > sizeof (ElfW(Ehdr)));
       ehdr = (ElfW(Ehdr) *) fbp->buf;
 
       /* Now run the tests.  */

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

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