I'm trying to set option -fstack-protector-all
in GCC 3.4.3 compiler for enabling some stack smashing protection scenarios. However when compiling with this i got
error: unrecognized command line option "-fstack-protector-all"
. So seems this option isn't implemented in GCC 3.4.3 ?? or Am I missing something ?
If it is not implemented in older GCC compiler what is the best / easiest alternative to this ?
Or maybe some useful code pattern to implement stack-smashing protector in C code itself ?
Thanks
You seem to be only one minor version off a gcc version that seems to be able to provide you with this particular smash protection. I found this when googling:
http://www.research.ibm.com/trl/projects/security/ssp/
Maybe you could upgrade to that one (one minor number up) and still be compatible with your vendor?
Additionally, as at least for a number of years canary values are default set in gcc (no need to use the option you mention), have you looked at the disassembly of a simple program? If you see some storing/loading from a (gs) location near end of stack, it's already implemented.