This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PING: [PATCH 2/2 Take-2][BZ #12416] Use stack boundaries from/proc/PID/maps to make stack executable
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Cc: Roland McGrath <roland at hack dot frob dot com>
- Date: Thu, 3 May 2012 18:21:28 +0530
- Subject: PING: [PATCH 2/2 Take-2][BZ #12416] Use stack boundaries from/proc/PID/maps to make stack executable
- References: <20120419120021.4780e8c8@spoyarek><20120425203424.A744A2C0CA@topped-with-meat.com><20120427084258.02317347@spoyarek>
ping?
On Fri, 27 Apr 2012 08:42:58 +0530, Siddhesh wrote:
> 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.