"Strong" stack protection for GCC
"Strong" stack protection for GCC
Posted Feb 13, 2014 19:37 UTC (Thu) by Pc5Y9sbv (guest, #41328)In reply to: "Strong" stack protection for GCC by jtc
Parent article: "Strong" stack protection for GCC
These canaries can be untouched by buggy code that happens to stride over the canary when writing, whether due to a per-iteration stride or due to some other constant or computed offset introduced by the buggy, unchecked access logic.
Even much more expensive per-access checks, like Purify, cannot catch 100% of array errors in a language like C using typical ABIs. It is not enough to just test whether an accessed address is a valid structure/variable, but you must reconstitute a triplet of info for the check: base address of pointer, offset from base, and size of object at base address; an access is wrong if the offset takes it beyond the object's size, regardless of whether this takes it to another valid object. But this triplet of information is not readily available in a program when general pointer arithmetic is allowed, and everything is reduced to machine addresses in the ABI.
