5

From what I understand:

  • There is a memory management unit on the CPU which controls access to the actual memory. Any memory calls flow through this unit which converts virtual addresses to real memory addresses. This allows the computer to have a virtual memory space of 2^64 bytes on a 64 bit machine. When there's not enough RAM then the CPU or the MMU swaps pages in and out from the disk when needed.

  • ELF binaries on linux consist of a header which lists (amongst other information) the addresses within the binary file of the sections of a binary, which include a code section and a data section amongst others.

  • The ELF header also specifies which shared libraries are required. These are stored in memory by the kernel and when the binary is executed their addresses are given to the process by the kernel.

So my question more specifically is, are all sections of the binary and the heap and stack given a random offset from a base position as part of ASLR?

(Sorry if any of this is incredibly wrong, I'm not very experienced in assembly/C/C++ programming and trying to figure out the smaller details of how binary executables work.)

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
user13392352
  • 164
  • 10
  • 1
    After the edit it looks narrow enough, and should be ontopic (there's an existing highly-voted unclosed question on SO [1](https://stackoverflow.com/questions/38189169/elf-pie-aslr-and-everything-in-between-specifically-within-linux)) – user202729 Jan 02 '21 at 11:40

0 Answers0