Search code examples
rambuffer-overflow

Does ECC RAM help prevent buffer overflow attacks


Does having ECC RAM prevent against buffer overflow attacks? I can't find anything on the web, and am quite curious.


Solution

  • Nope! Not in the slightest.

    Ok, let's start with some definitions:

    Error correction code memory (ECC memory) is a type of computer data storage that uses an error correction code[a] (ECC) to detect and correct n-bit data corruption which occurs in memory. ECC memory is used in most computers where data corruption cannot be tolerated under any circumstances, like industrial control applications, critical databases, and infrastructural memory caches. (Source: wikipedia)

    In information security and programming, a buffer overflow, or buffer overrun, is an anomaly where a program, while writing data to a buffer, overruns the buffer's boundary and overwrites adjacent memory locations. (source: wikipedia

    Basically, what ECC is designed to do is fix corruption in memory from, for example, cosmic background radiation. It's a hardware-level technique that doesn't know anything about what the memory contains.

    Buffer overflows are a software-level technique where you exploit bad code to escape the boundaries of a particular variable and jump into other parts of memory. You're still writing valid bytes, they're just not where the program expects them to be.