summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--NEWS14
-rw-r--r--elf/dl-load.c14
3 files changed, 25 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index e5d8bbaa6a..eb60959bec 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 aa40b75021..fd3f6e52da 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 0bfa74a25e..4b57879b9d 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. */