[Midnightbsd-cvs] src [7871] trunk/libexec/rtld-elf/map_object.c: Parse notes only after object structure had been allocated.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Sep 14 12:22:57 EDT 2016


Revision: 7871
          http://svnweb.midnightbsd.org/src/?rev=7871
Author:   laffer1
Date:     2016-09-14 12:22:56 -0400 (Wed, 14 Sep 2016)
Log Message:
-----------
Parse notes only after object structure had been allocated.

Obtained from: FreeBSD svn rev 239435

Revision Links:
--------------
    http://svnweb.midnightbsd.org/src/?rev=239435

Modified Paths:
--------------
    trunk/libexec/rtld-elf/map_object.c

Modified: trunk/libexec/rtld-elf/map_object.c
===================================================================
--- trunk/libexec/rtld-elf/map_object.c	2016-09-14 16:21:39 UTC (rev 7870)
+++ trunk/libexec/rtld-elf/map_object.c	2016-09-14 16:22:56 UTC (rev 7871)
@@ -153,7 +153,6 @@
 		break;
 	    note_start = (Elf_Addr)(char *)hdr + phdr->p_offset;
 	    note_end = note_start + phdr->p_filesz;
-	    digest_notes(obj, note_start, note_end);
 	    break;
 	}
 
@@ -291,7 +290,8 @@
     obj->stack_flags = stack_flags;
     obj->relro_page = obj->relocbase + trunc_page(relro_page);
     obj->relro_size = round_page(relro_size);
-
+    if (note_start < note_end)
+	digest_notes(obj, note_start, note_end);
     munmap(hdr, PAGE_SIZE);
     return (obj);
 



More information about the Midnightbsd-cvs mailing list