Wednesday, April 3, 2013

How to disable ASLR in linux permanently.

I was trying to install IBM DB2 v9.7 on the Ubuntu 12.10 and ./db2prereqcheck had been saying to me this:
WARNING:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
Many articles in the Internat says that ASLR can be disabled by just executing this command in the bash:
sudo sh -c "echo 0 > /proc/sys/kernel/randomize_va_space"
But this is not a permanent solution, you have to execute this command after every reboot of the machine.
Also in order to disable ASLR permanently there are some articles recommending to add
kernel.randomize_va_space=0
to the kernel boot parameters, but this won't work.
Finally I found the solution: simply add
kernel.randomize_va_space=0
to the end of the /etc/sysctl.conf. To immediately apply changes execute as root:
sysctl -p
http://www-01.ibm.com/support/docview.wss?uid=swg21365583

3 comments:

  1. Thank you for the knowledge share. It resolved my issue :)

    ReplyDelete
  2. I use a Linux VM for testing buffer overflows and was searching for a resolution to this. Thanks!

    ReplyDelete
  3. use these two kernel boot parameters:
    nokaslr
    and
    norandmaps

    source: https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html

    ReplyDelete