Page 1 of 1

Newbie's question> ESP register...

PostPosted: Wed Jul 16, 2003 8:53 am
by phantomforce
I tried to run the following simple code.
Code: Select all
#include <stdio.h>

unsigned long get_esp() { __asm__("movl %esp, %eax"); }

int main()
{
    printf("esp: %x\n", get_esp());
    return 0;
}


Under RedHat 9 with Gcc 3.2.2, The value of esp reigsters varied as follows;

Code: Select all
[XXX@XXX util]$ ./esp
esp: bfffe5a8
[XXX@XXX util]$ ./esp
esp: bffff028
[XXX@XXX util]$./esp
esp: bfffdca8
[XXX@XXX util]$ ./esp
esp: bfffeca8
[XXX@XXX util]$ ./esp
esp: bfffdd28
[[XXX@XXX util]$ ./esp
esp: bfffe928


Is this the effect of the PaX???
Viewing the object code itself is not special. I think that the compiler
does not affect for the above. When I replaced the kernel, the result
were static.

In RedHat 9, the dynamic stack is default??? And the technology
is from the gresecurity?? This is my question.

(Soooo sorry for my bad English :wink: )

Re: Newbie's question> ESP register...

PostPosted: Wed Jul 16, 2003 10:23 am
by PaX Team
phantomforce wrote:Is this the effect of the PaX???
http://pageexec.virtualave.net/docs/randustack.txt, in particular, the third paragraph in the implementation section.