How to Disable Linux ExecShield Buffer Overflows Protection
The first step is to know what Exec Shield is. Exec Shield is a patch for Linux kernel security. It helps to avoid from worms and other problems. This project was started at Red Hat, Inc in late 2002 with the aim of reducing the risk of worm or other automated remote attacks on Linux systems. The first result of the project was a security patch for the Linux kernel that adds an NX bit to x86 CPUs. While the Exec Shield project has had many other components, some people refer to this first patch as Exec Shield.
Disable Exec Shield protection
Login as root
Type the following command below :
# sysctl -w kernel.exec-shield=0
You can disable it permanently by adding following line to /etc/sysctl.conf file:
# vi /etc/sysctl.conf kernel.exec-shield=0
Save and close the file.
Note :
Exec Shield disabling is not recommended one.
Exec Shield protection can also simply disabled via GRUB loader
Add up following lines in grub.conf
# vi /etc/grub.conf Modify / append exec-shield=0 parameter as follows: kernel /vmlinuz-2.6.8 ro root=LABEL=/ exec-shield=0
Close and save the file.
Enable ExecShield Protection Against Buffer Overflows
Open your /etc/sysctl.conf file:
#
vi /etc/sysctl.conf
#### Add the following lines:
kernel.exec-shield = 1 kernel.randomize_va_space = 1
Save and close the file.
The First line will enable ExecShield protection and second line will enable random placement of virtual memory regions protection.
To load sysctl without reboot enter the command given below:
# sysctl -p