arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1484832.patch

147e83
commit 273cdee86d86e107c0eecef5614f57e37567b54e
147e83
Author: Andreas Schwab <schwab@suse.de>
147e83
Date:   Tue Jan 15 16:39:07 2013 +0100
147e83
147e83
    Fix invalid free of memory allocated during rtld init
147e83
147e83
diff --git a/elf/dl-load.c b/elf/dl-load.c
147e83
index 013efdb3814700d3..6a0005da502c8f37 100644
147e83
--- a/elf/dl-load.c
147e83
+++ b/elf/dl-load.c
147e83
@@ -822,6 +822,9 @@ _dl_init_paths (const char *llp)
147e83
 			   (const void *) (D_PTR (l, l_info[DT_STRTAB])
147e83
 					   + l->l_info[DT_RUNPATH]->d_un.d_val),
147e83
 			   l, "RUNPATH");
147e83
+	  /* During rtld init the memory is allocated by the stub malloc,
147e83
+	     prevent any attempt to free it by the normal malloc.  */
147e83
+	  l->l_runpath_dirs.malloced = 0;
147e83
 
147e83
 	  /* The RPATH is ignored.  */
147e83
 	  l->l_rpath_dirs.dirs = (void *) -1;
147e83
@@ -838,6 +841,9 @@ _dl_init_paths (const char *llp)
147e83
 			       (const void *) (D_PTR (l, l_info[DT_STRTAB])
147e83
 					       + l->l_info[DT_RPATH]->d_un.d_val),
147e83
 			       l, "RPATH");
147e83
+	      /* During rtld init the memory is allocated by the stub
147e83
+		 malloc, prevent any attempt to free it by the normal
147e83
+		 malloc.  */
147e83
 	      l->l_rpath_dirs.malloced = 0;
147e83
 	    }
147e83
 	  else