Quick access to stack bounds

Ulrich Drepper drepper@redhat.com
Wed Dec 9 23:25:00 GMT 2009


On 12/09/2009 12:23 PM, Roland McGrath wrote:
> There are no heuristics, just rlimit constraints.
> What could there be?  alloca(1<<20) is kosher.

Yes, and that's a problem  With unlimited stacks and PROT_GROW* almost 
any invalid memory access can be interpreted to belong to a stack.  This 
is why, I thought, there is something in the kernel to try to 
differentiate bogus accesses from extensions.


>> If you propose a kernel change get rid of PROT_GROWS* at the same time.
>
> What do you have in mind?

As kernel extensions?  Richard described the new AT_* constant to tell 
userlevel about the stack.


> A mapping of RLIMIT_STACK size with a flag about
> not precommitting any pages before faulting them in?

I was thinking about completely removing PROT_GROWS*.  Nobody has used 
it in a decade, I bet.

The remaining issue then would be unlimited stacks.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖



More information about the Libc-alpha mailing list