PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, November 11, 2022

[FIXED] why and how do the addresses returned by 'cat /proc/self/maps' change when it's executed again

 November 11, 2022     linux, proc     No comments   

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing