We examine the problem of containing buffer overflow attacks in a safe and efficient manner. Briefly, we dynamically augment source code to catch stack and heap-based buffer overflow and underflow attacks, and recover from them by allowing the program to continue execution. Our hypothesis is that we can treat each code function as a transaction that can be aborted when an attack is detected, without affecting the application's ability to correctly execute. Furthermore, our approach allows us to ...