/proc/sys/vm/legacy_va_layout (since Linux 2.6.9) If nonzero, this disables the new 32-bit memory-mapping layout; the kernel will use the legacy (2.4) layout for all processes.
修改heap增长方向代码(以linux4.1的arm为例)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
void arch_pick_mmap_layout(struct mm_struct *mm) { unsigned long random_factor = 0UL;
if (current->flags & PF_RANDOMIZE) random_factor = arch_mmap_rnd();