Defending the Heap: Diagnosing Undefined Behavior in Dynamic Memory with jkmalloc

Jakob Knute Kaivo, Thomas Ryan Devine · 2023

Undefined behavior in C programs is a major cause of software vulnerabilities. While the literature contains a substantial amount of work using static analysis to diagnose syntactic undefined behavior, papers diagnosing undefined use of standard library functions are lacking. This paper introduces jkmalloc, a first step toward safe use of the C standard library, targeting the dynamic memory functions. Testing shows jkmalloc effectively inhibits seven types of undefined behavior related to dynamic memory by terminating the program, to prevent undesired execution, and reporting detailed information about the behavior, without requiring modification to existing programs.

Read the paper · More papers on PaperTik