1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

Test for mprotect failure in dl-load.c (bug 12492).

This commit is contained in:
Pierre Ynard
2013-06-28 21:43:42 +00:00
committed by Joseph Myers
parent ce61a2ad2e
commit 0432680e8c
3 changed files with 23 additions and 13 deletions

View File

@@ -1487,7 +1487,11 @@ cannot allocate TLS data structures for initial thread");
if (__builtin_expect (p + s <= relro_end, 1))
{
/* The variable lies in the region protected by RELRO. */
__mprotect ((void *) p, s, PROT_READ|PROT_WRITE);
if (__mprotect ((void *) p, s, PROT_READ|PROT_WRITE) < 0)
{
errstring = N_("cannot change memory protections");
goto call_lose_errno;
}
__stack_prot |= PROT_READ|PROT_WRITE|PROT_EXEC;
__mprotect ((void *) p, s, PROT_READ);
}