4 ms·
> ... -fno-stack-protector -z execstack Does anyone know how common stack protector is in the wild?
by amenod 11y ago
> ... -fno-stack-protector -z execstack
Does anyone know how common stack protector is in the wild?
- Liru 11y agoDepends on which distributions patch gcc to enable it by default. From what I'm aware, a lot of them do, though.
- nautical 11y agoFedora 20 comes with fstack-protector-strong .. so does ubuntu arch openbsd/freebsd etc .
- pm24601 11y agoFrom the responses to this stackoverflow question: http://stackoverflow.com/questions/1629685/when-and-how-to-use-gccs-stack-protection-feature http://stackoverflow.com/questions/1629685/when-and-how-to-u... The protection only protects under some circumstances not all. So this demo still seems valid. Also the protection comes at a cost of extra code (and extra execution time). This means to me that any IoT device probably does not have stack protection.
- 0x0539 11y agoActually, this demo would be stopped if the stack protector was on. The demo relies upon overwriting the return pointer that controls where the function jumps to upon returning. The stack protector acts as a guard against overwriting that value without knowing a key that is stored elsewhere in memory. You'd need some memory disclosure issue to get the key or brute force the key.