DB2Vend, shmat(), and ASLR

by bitznbitez

Setting up a db2 v9.5 system on RHEL with Legato for backups.    For a long time I’ve noticed the following in the db2diag.log file.

Address Space Layout Randomization (ASLR) is enabled in this environment.  ASLR may cause intermittent failures in shmat() for any processes other than  db2sysc, and is recommended to be disabled.  To disable it, set  kernel.randomize_va_space=0

However because I observed no adverse side effects, and because ASLR is in fact a security plus, I opted to leave it enabled.   However when I started logical log backups via Legato I began to get a variety of error messages.   I suspected this problem and it seems to be confirmed at IBM here.   In particular the use of db2vend was what seemed new and therefore suspicious to me.

There are two ways to modify the parameter.   If you want to modify it temporarily only :

echo 0 > /proc/sys/kernel/randomize_va_space

And then recycle the db2 instance.   Alternately if you want to change it permanently then edit the /etc/sysctl.conf file and add :

kernel.randomize_va_space=0

Then reboot.

While this did in fact resolve the warning in the db2diag.log it did not resolve the issues I am having with db2vend, those seem to be other issues relating to the interaction with the shared library or archive system of the 3rd party vendor.

Advertisements