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
1 Answer
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
1 Comment
Joshua Taylor
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.
snprintf(),fgets()etc. andsizeofare your friends.