Reputation: 2427
unsigned long find_start(void){
__asm__("movq %rsp, %rax");
}
int main(){
printf ("OX%x\n" , find_start()) ;
}
This is a further question of my previous one,
the output is different each time I run the programe.
isn't the start address of the stack fixed in linux?
The kernel version is 2.6.18-194.el5
Update from comments: I'm now trying to do a hello world exploit,how to overcome this?Will the process created by execve be using the same stack start address as its parent process?
Upvotes: 0
Views: 3186
Reputation: 77752
How would that be possible on an operating system that supports multiple processes and multiple threads?
EDIT: I should mention what I brought up in the comments: Address Space Layout Randomization, a security feature that deliberately scrambles the address around.
Upvotes: -1
Reputation: 45075
Perhaps you're seeing the effect of address space layout randomization. It's a security feature, to make it harder to exploit stack or buffer overruns.
Upvotes: 5