Blame SOURCES/glibc-rh767146.patch

b9ba6d
diff -rup a/elf/dl-load.c b/elf/dl-load.c
b9ba6d
--- a/elf/dl-load.c	2012-02-03 10:59:58.917870716 -0700
b9ba6d
+++ b/elf/dl-load.c	2012-02-03 11:01:01.796580644 -0700
b9ba6d
@@ -1130,6 +1130,16 @@ _dl_map_object_from_fd (const char *name
b9ba6d
 		= N_("ELF load command address/offset not properly aligned");
b9ba6d
 	      goto call_lose;
b9ba6d
 	    }
b9ba6d
+	  if (__builtin_expect ((ph->p_offset + ph->p_filesz > st.st_size), 0))
b9ba6d
+	    {
b9ba6d
+	      /* If the segment requires zeroing of part of its last
b9ba6d
+		 page, we'll crash when accessing the unmapped page.
b9ba6d
+		 There's still a possibility of a race, if the shared
b9ba6d
+		 object is truncated between the fxstat above and the
b9ba6d
+		 memset below.  */
b9ba6d
+	      errstring = N_("ELF load command past end of file");
b9ba6d
+	      goto call_lose;
b9ba6d
+	    }
b9ba6d
 
b9ba6d
 	  c = &loadcmds[nloadcmds++];
b9ba6d
 	  c->mapstart = ph->p_vaddr & ~(GLRO(dl_pagesize) - 1);
b9ba6d
Only in b/elf: dl-load.c.orig