Bug 6973 - NPTL wrongly includes guard area inside allocated stack
Summary: NPTL wrongly includes guard area inside allocated stack
Status: RESOLVED DUPLICATE of bug 11787
Alias: None
Product: glibc
Classification: Unclassified
Component: nptl (show other bugs)
Version: 2.8
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-22 16:38 UTC by Michael Kerrisk
Modified: 2014-07-02 06:12 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Kerrisk 2008-10-22 16:38:08 UTC
In the NPTL implementation, the guard area (as set by
pthread_attr_setguardsize()) is included in (i.e., deducted from) the stack
allocation.  Common sense says that it should be added to the allocation, and
indeed POSIX.1-2001 and POSIX.1-2008 are clear on this point; from the
specification 2008 pthread_attr_setguardsize():

"If a thread’s stack is created with guard protection, the implementation
allocates extra memory at the overflow end of the stack as a buffer against
stack overflow of the stack pointer."

Solaris adheres to POSIX.1 on this point.  NPTL should also.
Comment 1 Siddhesh Poyarekar 2012-05-23 17:07:56 UTC
We're looking to fix this with bug 11787. Closing this as duplicate.

*** This bug has been marked as a duplicate of bug 11787 ***