4 ms·
There are other features you can use if you're willing to accept a bit of overhead in the name of robustness, namely the code instrumentation feature ('-finstru
by TickleSteve 10y ago
There are other features you can use if you're willing to accept a bit of overhead in the name of robustness, namely the code instrumentation feature ('-finstrument-functions')
Using that option, you can provide relatively strong stack protection and even a permissions system to restrict parts of your code from accessing others.
For even more robustness, you can do random stack offsetting, return value checking, return opcode checking, per-task stack bounds checking, heap metadata protection, heap bounds-check, etc.
All this does come at a price tho, every function is instrumented on entry and exit so its not the most performant. It does provide pretty good protection against buffer and stack smashing exploits.
Also, since this is an embedded system with a well-defined memory map, you can perform very strong pointer-checks (not simply NULL checks) against exactly the allowed ranges (a simple NULL check has a 1 in 4.2 billion chance of catching an issue).
- JoachimSchipper 10y agoDo you have a writeup somewhere? And/or a rough estimate of the overhead of your scheme?
- TickleSteve 10y agoI have docs... but not in a publishable format currently. I have been considering doing a series of posts about the techniques tho as they are widely applicable and do significantly increase robustness. Currently you do pay a performance (and hence power-usage) overhead of ~5% depending on how many 'domains' you wish to protect but that can be optimised and tuned to your particular application. Certainly for some applications the robustness and protection from malicious message payloads is well worth the performance hit.