Re: [PATCH] hide guard page for stacks that grow upwards

From: Linus Torvalds
Date: Tue Aug 24 2010 - 18:24:59 EST


On Tue, Aug 24, 2010 at 3:03 PM, Luck, Tony <tony.luck@xxxxxxxxx> wrote:
>
> This looks useful too ... but I can't see where the code is that
> made vm_start be PAGE_SIZE lower to begin with. I'd expect to have
> to make a matching change to make vm_end PAGE_SIZE higher for the
> VM_GROWSUP areas.

That's the fault path - the very check_stack_guard_page() logic itself.

In other words, nowhere do we _explicitly_ make the stack larger by
one page, but nowhere do we explicitly size the stack in the first
place! The stack grows by being populated, and every time a new page
is populated, check_stack_guard_page() will have expanded the stack
vma by one extra page.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/