Issue
I'm trying to understand linux memory management.
Why and how do the addresses returned by 'cat /proc/self/maps' change when it's executed again
user@notebook:/$ cat /proc/self/maps | grep heap
55dc94a7c000-55dc94a9d000 rw-p 00000000 00:00 0 [heap]
user@notebook:/$ cat /proc/self/maps | grep heap
562609879000-56260989a000 rw-p 00000000 00:00 0 [heap]
Solution
This is due to Address Space Layout Randomization, aka ASLR. Linux will load code and libraries at different locations each time to make it harder to exploit buffer overflows and similar.
You can disable it with
echo 0 > /proc/sys/kernel/randomize_va_space
which will make the addresses the same each time. You can then re-enable it with:
echo 2 > /proc/sys/kernel/randomize_va_space
and the addresses will be randomized again.
Answered By - that other guy Answer Checked By - Mildred Charles (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.