This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch RFC] SH: -fstack-protector support


Joern Rennecke wrote:

The SHmedia test patterns can be improved by useing a sub or xor operation instead
of the compare and zeroing, and inverting the branch. If the comparison suceeds, nothing
is leaked. If it fails, not the value, but only the difference is leaked, so that's OK with the
letter of the description; it is also OK with the spirit of the description because the
miscompare already indicates a stack smash, so control is tranferred to the stack_protect_fail
code, and the difference won't leak to an attacker.


P.S.:
Sorry, my I got a thinko there. Since the SH is a load-store architecture, there are two registers
to overwrite, and the cmpeq already overwrites one of them.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]