I've been looking a bit into kernel options for hardening, and there is one that seems to be a good idea to deploy - randomize_va_space. But before I activate that feature I started a google search, and I found mainly descriptions on how to turn it off. Usually without reason, but the few reasons I saw where "it slows down", but that was an old thread, or some college kid wanted to try out some self-written buffer overflow.

Are there any good reasons, as in problems that this kernel parameter causes, to not activate the feature?


When debugging some C code, especially tracking down after-free-accesses bugs, address space randomization is quite inconvenient, because it makes bugs non deterministic. By turning it off, you can much more easily reproduce the issues. That's a good reason to turn it off on development machines (as opposed to production systems).

As for the slowing down, there is a theoretical effect due to the spreading of "interesting addresses" over a larger space. Since the MMU on x86 hardware uses forward tables to represent the address space (a mapping from virtual space to physical space, contrary to the reverse tables used in recent PowerPC processors), it can be predicted that address space randomization will induce slight additional pressure on the caches (more cache memory will be used to read parts of the MMU tables). However, as for all performance-related issues, I strongly suggest that such a slowdown should be duly measured and confirmed before taking harsh measures. In other words, turning address space randomization off is worth a try if you are desperate for performance on a given system, but it should not matter much on average.

| improve this answer | |
  • Excellent answer. It's important to note that it's on by default in most modern ASLR-enabled distros. – Polynomial Aug 20 '12 at 12:30

I'm late to this party, but when profiling code, various factors — including the stack's starting address — have been shown to introduce unexpected but significant measurement bias (see Mytkowicz et al, 2009). It's reasonable to suppose that ASLR would have a similar effect.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.