Fix stack size and address inconsistency due to executable stack
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Sat, 26 May 2012 04:18:25 +0000 (09:48 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Sat, 26 May 2012 04:18:26 +0000 (09:48 +0530)
commit9c6ea9facbba4d430807bd21fa82892d713b1ecd
treefc116e5e30c8ea5cada22f53d6914fbc33eb586e
parenta82392228a31bb94b8dc4c35a37b04611d19891f
Fix stack size and address inconsistency due to executable stack

When a stack is marked executable due to loading a DSO that requires
an executable stack, the logic tends to leave out a portion of stack
after the first frame, thus causing a difference in the value returned
by pthread_getattr_np before and after the stack is marked
executable. It ought to be possible to fix this by marking the rest of
the stack as executable too, but in the interest of marking as less of
the stack as executable as possible, the path this fix takes is to
make pthread_getattr_np also look at the first frame as the underflow
end of the stack and compute size and stack top accordingly.

The above happens only for the main process stack. NPTL thread stacks
are not affected by this change.
ChangeLog
NEWS
elf/tst-execstack.c
nptl/ChangeLog
nptl/pthread_getattr_np.c