From: Roland McGrath Date: Wed, 16 Feb 2005 11:20:29 +0000 (+0000) Subject: 2005-02-07 Ulrich Drepper X-Git-Tag: cvs/fedora-glibc-2_3-20050216T1256~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d93f18427c3e2f937f06b2c4a058e75377f36af;p=thirdparty%2Fglibc.git 2005-02-07 Ulrich Drepper * elf/dl-load.c (_dl_map_object_from_fd): Makre sure registers are set correctly. --- diff --git a/elf/dl-load.c b/elf/dl-load.c index 3da3df7346b..ab1080e51f2 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -105,13 +106,11 @@ ELF_PREFERRED_ADDRESS_DATA; int __stack_prot attribute_hidden attribute_relro - = (PROT_READ|PROT_WRITE #if _STACK_GROWS_DOWN && defined PROT_GROWSDOWN - |PROT_GROWSDOWN + = PROT_GROWSDOWN; #elif _STACK_GROWS_UP && defined PROT_GROWSUP - |PROT_GROWSUP + = PROT_GROWSUP; #endif - ); /* Type for the buffer we put the ELF header and hopefully the program @@ -1327,12 +1326,16 @@ cannot allocate TLS data structures for initial thread"); if (__builtin_expect (__check_caller (RETURN_ADDRESS (0), allow_ldso|allow_libc) == 0, 0)) - __stack_prot |= PROT_EXEC; + __stack_prot |= PROT_READ|PROT_WRITE|PROT_EXEC; __mprotect ((void *) p, s, PROT_READ); } else #endif - __stack_prot |= PROT_EXEC; + __stack_prot |= PROT_READ|PROT_WRITE|PROT_EXEC; + +#ifdef check_consistency + check_consistency (); +#endif errval = (*GL(dl_make_stack_executable_hook)) (stack_endp); if (errval)