[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Safe stack overflow



On 02/24/14 21:33, Miro Kropáček wrote:

On Mon, Feb 24, 2014 at 10:20 PM, Markus Fröschle <markus@mubf.de <mailto:markus@mubf.de>> wrote:

    Hmmm. I don’t get it.

Typical TPA looks like this:

<heap>
<stack>
<bss segment>
<data segment>
<text segment>

Text segments lies on the lowest address, stack on the highest. Now, if a stack overflow occurs, bss and data gets overwritten. If you rearrange it like this:

<heap>
<bss segment>
<data segment>
<text segment>
<stack>

as soon as the SP leaves the program's allocated and protected area => boom, memory violation.


What about non-MP systems ??

Alan.