[PATCH 2/2 Take-2][BZ #12416] Use stack boundaries from /proc/PID/maps to make stack executable
Siddhesh Poyarekar
siddhesh@redhat.com
Fri Apr 27 03:12:00 GMT 2012
On Wed, 25 Apr 2012 13:34:24 -0700 (PDT), Roland wrote:
> Perhaps it should work in a different way. It's nasty to
> require /proc access, and all the io plus stdio overhead et al might
> make it more costly than another method. It could use something like
> the mprotect-probing technique to locate the hole below the stack
> that linux/dl-execstack.c uses when PROT_GROWSDOWN is not available.
I have written a new patch based on this idea. I have consolidated the
mprotect-probing code into a function to make the code a bit cleaner,
since the same logic is being used repeatedly. I have also updated the
test case to not use procfs and use pthread_getattr_np instead. I have
verified (on x86_64) the test case with and without this fix. I have
also verified that there are no regressions in the testsuite due to
this fix.
Regards,
Siddhesh
ChangeLog:
2012-04-27 Siddhesh Poyarekar <siddhesh@redhat.com>
[BZ #12416]
Based on idea by Roland McGrath.
* elf/tst-execstack.c (do_test): Check that pthread_getattr_np
returns the same end of stack before and after stack is made
executable.
* sysdeps/unix/sysv/linux/dl-execstack.c
(_dl_make_stack_executable): Also mark pages below (or above if
_STACK_GROWS_UP) as executable. Consolidate code to
incrementally mark stack executable to ...
(_incremental_make_stack_executable): ... a new function.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Also-mark-pages-below-__libc_stack_end-as-executable.patch
Type: text/x-patch
Size: 6181 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120427/1f8502a5/attachment.bin>
More information about the Libc-alpha
mailing list