* Posts by MikeInCanada

1 post • joined 18 Jul 2019

Rust in peace: Memory bugs in C and C++ code cause security issues so Microsoft is considering alternatives once again


Maybe just a stack change?

One of the biggest problem I have seen is copying data on the stack and not checking the size. Because the stack goes from Higher to lower address, but the data copying goes from lower to higher, any overrun corrupts data on the stack from programs that called you.

A technically simple solution is have stack space be assigned the other direction (from lower to higher address) thus any overruns does not impact prior functions on the stack. This would prevent MANY crashes and actually avoid the security holes caused by stack overruns.

For most applications it would only mean a re-compile assuming you could work out the hardware requirements.


Biting the hand that feeds IT © 1998–2020