Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there Exec Shield buffer overflow protection for Ubuntu?

I tried to enable Exec Shield on Ubuntu 12.04 with the following command

sudo sysctl -w kernel.exec-shield=1

but it said

error: "kernel.exec-shield" is an unknown key

If not, what is the equivalent solution for Ubuntu and how can I install and enable it?

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

Ubuntu has NX protection enabled by default. This either uses hardware NX when the CPU supports it, or uses NX emulation in the kernel (the equivalent of the Red Hat Exec Shield patch).

For more information, visit: https://wiki.ubuntu.com/Security/Features

more specifically: https://wiki.ubuntu.com/Security/Features#nx

share|improve this answer
add comment

Open your /etc/sysctl.conf file:

# sudo gedit /etc/sysctl.conf
#### Add the following lines:

###enable ExecShield protection

kernel.exec-shield = 1

###enable random placement of virtual memory regions protection

kernel.randomize_va_space = 1

  Save and close the file.   

To load sysctl without reboot type this command below ::
sysctl -p

share|improve this answer
2  
Can you confirm that Ubuntu supports the kernel.exec-shield key? Last I checked it didn't. This seems to be a Red Hat/Fedora feature so far. –  Kevin Bowen Dec 13 '12 at 3:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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