0

I read about the buffer overflow attack and wanted to know if changing the processor so it refuses to execute instruction that are not located in the code area can solve it? thanks

2
  • 1
    Nah. Just friggin' check your arrays. snprintf(), fgets() etc. and sizeof are your friends. Commented Jun 19, 2013 at 21:46
  • @userXXX if you really don't let anything go longer than it's supposed to go, then you're pretty much sorted, even without the write XOR execute trick (which all sane OSes do anyways, OS X and Linux included, but of course not Windows...) Commented Jun 19, 2013 at 21:51

1 Answer 1

1

This is typically done by setting the no-execute bit on a memory page or segment (the stack, for example), in modern CPUs. It helps against some stack-based overflows, but isn't a 100% fool-proof cure.

Check out http://en.wikipedia.org/wiki/No_execute

Sign up to request clarification or add additional context in comments.

1 Comment

Notably, this only prevents code injected into the stack from being executed. For instance, since the buffer overflow could rewrite a return pointer, the system is still vulnerable to a return into libc attack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.