Re: Nanokernel stack border protection


Benjamin Walsh <benjamin.walsh@...>
 

On Mon, Sep 26, 2016 at 09:48:17PM +0000, Mariusz Okrój wrote:
Stack boundary check can be implemented on x86 using paging mechanism
(MMU). The only thing that need to be done is to separate stacks with
non-mapped pages. So if the upper boundary of stack is reached (ESP
goes into non-mapped page) then the PF exception is generated.

The only constraint of this solution is that stacks need to be aligned
to 4kB.
The problem with this is that it's not a general practical solution for
Zephyr, where stacks can be much smaller than 4K. And that's without
counting the 8K overhead of the page directory and page table. When you
have a system with 8K of RAM, this doesn't work...

Join devel@lists.zephyrproject.org to automatically receive all group messages.