What's the problem with memory anyway?
The introductory paragraphs at the start of this chapter informed you of the annoying fact that though programming in C is like having a superpower (at least for your typical OS/driver/embedded domains), it's a double-edged sword: we humans inadvertently create defects and bugs. Memory bugs, especially, are simply all too common.
In fact, in Chapter 2, Approaches to Kernel Debugging, in the Types of bugs – the memory view section, we mentioned that among the different ways of classifying bug types is the memory view. For easy recollection – and to stress its importance here – I reproduce the short list of common memory corruption bug types:
- Incorrect memory accesses:
- Using variables uninitialized, aka Uninitalized Memory Read (UMR) bugs
- Out-Of-Bounds (OOB) memory accesses (read/write underflow/overflow bugs)
- Use-After-Free (UAF) and Use-After-Return (UAR) (aka out-of-scope) bugs
- Double-free bugs
- Memory...