Skip to content

Commit

Permalink
2005-01-07 Jakub Jelinek <jakub@redhat.com>
Browse files Browse the repository at this point in the history
	[BZ #738]
	* elf/dl-load.c (open_path): If rtld_search_dirs is in RELRO segment,
	avoid writing to it if none of the standard search directories exist.
  • Loading branch information
Roland McGrath committed Feb 16, 2005
1 parent 5944209 commit 2b890a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion elf/dl-load.c
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,12 @@ open_path (const char *name, size_t namelen, int preloaded,
must not be freed using the general free() in libc. */
if (sps->malloced)
free (sps->dirs);
sps->dirs = (void *) -1;
#ifdef HAVE_Z_RELRO
/* rtld_search_dirs is attribute_relro, therefore avoid writing
into it. */
if (sps != &rtld_search_dirs)
#endif
sps->dirs = (void *) -1;
}

return -1;
Expand Down

0 comments on commit 2b890a4

Please sign in to comment.