From ba82fcb2d8b36541a52ef6f39347ac5c27804d21 Mon Sep 17 00:00:00 2001 From: kan Date: Fri, 3 Aug 2012 17:04:41 +0000 Subject: Parse notes only after object structure had been allocated. Reported by: kargl Reviewed by: kib (sans whitespace) --- libexec/rtld-elf/map_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libexec') diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index 509a64f..79e4132 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -153,7 +153,6 @@ map_object(int fd, const char *path, const struct stat *sb) 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 @@ map_object(int fd, const char *path, const struct stat *sb) 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); -- cgit v1.1