Table of Contents
Fetching ...

CleanStack: A New Dual-Stack for Defending Against Stack-Based Memory Corruption Attacks

Lei Chong

TL;DR

CleanStack addresses stack-based memory corruption by combining tainted-stack object separation with static randomization in a novel TSOS dual-stack architecture. Implemented within LLVM/Clang and evaluated on SPEC CPU2017, Nginx, and other real-world apps, it achieves an average runtime overhead of 1.73% and memory overhead of 0.04%, while providing protection against ROP/DOP and related data-only attacks. The approach relies on tainted data identification via static analysis and heuristics, plus guard pages and canaries to provide layered defense; its empirical and statistical analyses show reduced exploitability in practice. Overall, CleanStack offers a practical, highly compatible, and comprehensive stack protection solution with strong defense guarantees and deployability across architectures and OSes.

Abstract

Stack-based memory corruption vulnerabilities have long been exploited by attackers to execute arbitrary code or perform unauthorized memory operations. Various defense mechanisms have been introduced to mitigate stack memory errors, but they typically focus on specific attack types, incur substantial performance overhead, or suffer from compatibility limitations.In this paper, we present CleanStack, an efficient, highly compatible, and comprehensive stack protection mech anism. CleanStack isolates stack objects influenced by external input from other safe stack objects, thereby preventing attackers from modifying return addresses via controlled stack objects. Additionally, by randomizing the placement of tainted stack objects within the Unclean Stack, CleanStack mitigates non control data attacks by preventing attackers from predicting the stack layout.A key component of CleanStack is the identifica tion of tainted stack objects. We analyze both static program analysis and heuristic methods for this purpose. To maximize compatibility, we adopt a heuristic approach and implement CleanStack within the LLVM compiler framework, applying it to SPEC CPU2017 benchmarks and a real-world application.Our security evaluation demonstrates that CleanStack significantly reduces the exploitability of stack-based memory errors by providing a dual-stack system with isolation and randomization. Performance evaluation results indicate that CleanStack incurs an execution overhead of only 1.73% on the SPEC CPU2017 benchmark while introducing a minimal memory overhead of just 0.04%. Compared to existing stack protection techniques, CleanStack achieves an optimal balance between protection coverage, runtime overhead, and compatibility, making it one of the most comprehensive and efficient stack security solutions to date.

CleanStack: A New Dual-Stack for Defending Against Stack-Based Memory Corruption Attacks

TL;DR

CleanStack addresses stack-based memory corruption by combining tainted-stack object separation with static randomization in a novel TSOS dual-stack architecture. Implemented within LLVM/Clang and evaluated on SPEC CPU2017, Nginx, and other real-world apps, it achieves an average runtime overhead of 1.73% and memory overhead of 0.04%, while providing protection against ROP/DOP and related data-only attacks. The approach relies on tainted data identification via static analysis and heuristics, plus guard pages and canaries to provide layered defense; its empirical and statistical analyses show reduced exploitability in practice. Overall, CleanStack offers a practical, highly compatible, and comprehensive stack protection solution with strong defense guarantees and deployability across architectures and OSes.

Abstract

Stack-based memory corruption vulnerabilities have long been exploited by attackers to execute arbitrary code or perform unauthorized memory operations. Various defense mechanisms have been introduced to mitigate stack memory errors, but they typically focus on specific attack types, incur substantial performance overhead, or suffer from compatibility limitations.In this paper, we present CleanStack, an efficient, highly compatible, and comprehensive stack protection mech anism. CleanStack isolates stack objects influenced by external input from other safe stack objects, thereby preventing attackers from modifying return addresses via controlled stack objects. Additionally, by randomizing the placement of tainted stack objects within the Unclean Stack, CleanStack mitigates non control data attacks by preventing attackers from predicting the stack layout.A key component of CleanStack is the identifica tion of tainted stack objects. We analyze both static program analysis and heuristic methods for this purpose. To maximize compatibility, we adopt a heuristic approach and implement CleanStack within the LLVM compiler framework, applying it to SPEC CPU2017 benchmarks and a real-world application.Our security evaluation demonstrates that CleanStack significantly reduces the exploitability of stack-based memory errors by providing a dual-stack system with isolation and randomization. Performance evaluation results indicate that CleanStack incurs an execution overhead of only 1.73% on the SPEC CPU2017 benchmark while introducing a minimal memory overhead of just 0.04%. Compared to existing stack protection techniques, CleanStack achieves an optimal balance between protection coverage, runtime overhead, and compatibility, making it one of the most comprehensive and efficient stack security solutions to date.

Paper Structure

This paper contains 25 sections, 2 equations, 2 figures, 3 tables.

Figures (2)

  • Figure 1: Illustration of CleanStack’s workflow.
  • Figure 2: CleanStack’s Model.