Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
121
rated 0 times [  121] [ 0]  / answers: 1 / hits: 225438  / 3 Years ago, tue, june 1, 2021, 6:50:41

I am using Ubuntu 12.04 32-bits, for some experiment I need to disable ASLR; how do I accomplish that? What should I do after that to enable ASLR again?


More From » kernel

 Answers
6

According to an article How Effective is ASLR on Linux Systems?, you can configure ASLR in Linux using the /proc/sys/kernel/randomize_va_space interface.




The following values are supported:




  • 0 – No randomization. Everything is static.

  • 1 – Conservative
    randomization. Shared libraries, stack, mmap(), VDSO and heap are
    randomized.

  • 2 – Full randomization. In addition to elements listed in
    the previous point, memory managed through brk() is also randomized.




So, to disable it, run



echo 0 | sudo tee /proc/sys/kernel/randomize_va_space


and to enable it again, run



echo 2 | sudo tee /proc/sys/kernel/randomize_va_space


This won't survive a reboot, so you'll have to configure this in sysctl. Add a file /etc/sysctl.d/01-disable-aslr.conf containing:



kernel.randomize_va_space = 0


should permanently disable this.


[#30378] Thursday, June 3, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arbaour

Total Points: 346
Total Questions: 115
Total Answers: 105

Location: Oman
Member since Wed, Apr 12, 2023
1 Year ago
;