- 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 )