aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2013-01-15 16:39:07 +0100
committerAndreas Schwab <schwab@suse.de>2013-04-11 09:22:05 +0200
commit273cdee86d86e107c0eecef5614f57e37567b54e (patch)
treeedd1f8a09dbacf3ca7cd4440837cad08b9587ab7 /elf/dl-load.c
parent01dc6df938832fe923ac394812553c0fc8a0f113 (diff)
downloadglibc-273cdee86d86e107c0eecef5614f57e37567b54e.zip
glibc-273cdee86d86e107c0eecef5614f57e37567b54e.tar.gz
glibc-273cdee86d86e107c0eecef5614f57e37567b54e.tar.bz2
Fix invalid free of memory allocated during rtld init
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 6e65980..dd182c9 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -797,6 +797,9 @@ _dl_init_paths (const char *llp)
(const void *) (D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_RUNPATH]->d_un.d_val),
l, "RUNPATH");
+ /* During rtld init the memory is allocated by the stub malloc,
+ prevent any attempt to free it by the normal malloc. */
+ l->l_runpath_dirs.malloced = 0;
/* The RPATH is ignored. */
l->l_rpath_dirs.dirs = (void *) -1;
@@ -813,6 +816,9 @@ _dl_init_paths (const char *llp)
(const void *) (D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_RPATH]->d_un.d_val),
l, "RPATH");
+ /* During rtld init the memory is allocated by the stub
+ malloc, prevent any attempt to free it by the normal
+ malloc. */
l->l_rpath_dirs.malloced = 0;
}
else