Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 8 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:

more specifically:

share|improve this answer

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
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

Your Answer


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.