diff options
-rw-r--r-- | libc/ChangeLog.eglibc | 6 | ||||
-rw-r--r-- | libc/elf/dl-load.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/libc/ChangeLog.eglibc b/libc/ChangeLog.eglibc index 0378e4f63..e794928a9 100644 --- a/libc/ChangeLog.eglibc +++ b/libc/ChangeLog.eglibc @@ -1,3 +1,9 @@ +2011-02-28 Pierre Ynard <linkfanel@yahoo.fr> + + [BZ #12492] + * elf/dl-load.c (_dl_map_object_from_fd): Add gracious error path for + the case when mprotect() fails. + 2011-02-28 Denis Zaitceff <zaitceff@gmail.com> * elf/dl-lookup.c (GLRO_dl_debug_mask): Apply the forgotten one. diff --git a/libc/elf/dl-load.c b/libc/elf/dl-load.c index b017258ef..4fee639d7 100644 --- a/libc/elf/dl-load.c +++ b/libc/elf/dl-load.c @@ -1388,7 +1388,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 protection"); + goto call_lose_errno; + } __stack_prot |= PROT_READ|PROT_WRITE|PROT_EXEC; __mprotect ((void *) p, s, PROT_READ); } |