From what iI understand, ASLR has 3 Modes:
- 0 - turned off
- 1 - randomizes stack, heap, shared libraries, vDSO, mmap memory area and text area (if built with -fPIE -pie)
- 2 - additionally randomizes
brk()-allocated memory, which comes, to my understanding, mostly from smallmalloc()-calls.
So my questions is, whyWhy is there an extra mode especially for brk()-allocated memory (if this is really all it does) and how important is it or rather when is it important to use Mode 2 of ASLR instead of Mode 1?