GCC's Stack Protector Option and Higher CPU Usage -


does know if gcc's -fstack-protector cause program use larger amount of cpu cycles? description here mentions

-fstack-protector emit code check buffer overflows, such stack smashing attacks. done adding guard variable functions vulnerable objects. includes functions call alloca, , functions buffers larger 8 bytes. guards initialized when function entered , checked when function exits. if guard check fails, error message printed , program exits.

also, better writing code @ start of functions check buffer pointers , sizes?

it should not cause significant increase in cpu use. description states, stack protection involves putting particular value on stack @ function entry , validating hasn't changed @ function exit. typically functions lot more writing , reading 1 value, should not constitute significant overhead.

stack protection should used in conjunction writing code correctly. can't catch every mistake , can worked around attackers, since automatically applied every function can detect accidental or intentional overflows sooner.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -