This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2][BZ #12416] Use stack boundaries from /proc/PID/mapsto make stack executable


ping?

On Thu, 19 Apr 2012 12:00:21 +0530, Siddhesh wrote:

> Hi,
> 
> Using __libc_stack_end as the end of stack to mark an executable stack
> misses pages at the end of stack that are used to store program
> arguments, environment variables and auxiliary elf information. Due to
> this, the stack vma gets split and later requests for stack address
> using pthread_getattr_np() return a different value than before.
> 
> This behaviour can be seen using the reproducer in bz#12416.
> 
> This patch fixes an inconsistency between the treatment of stack size
> in pthread_getattr_np and _dl_make_stack_executable where the former
> used __libc_stack_end to find the stack vma in /proc/PID/maps and used
> the real stack end while the latter used the __libc_stack_end itself
> as the stack end.
> 
> I have modified tst-execstack to test this in make check. Testsuite
> reports no new regressions from this patch.
> 
> Regards,
> Siddhesh
> 
> 2012-04-19  Siddhesh Poyarekar  <siddhesh@redhat.com>
> 
> 	[BZ #12416]
> 	* elf/tst-execstack.c (get_main_stack_bounds): New function.
> 	(do_test): Modify test to also verify that main stack bounds
> do not change after execstack-dso.so is dlopen'd.
> 	* sysdeps/unix/sysv/linux/dl-execstack.c (__strtoul_internal):
> 	Declare extern.
> 	(__read_one_line, __get_map_bounds): New functions.
> 	(_dl_make_stack_executable): Use stack bounds
> 	from /proc/PID/maps if available.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]