SMA: Eliminate Memory Spatial Errors via Saturation Memory Access

Dongwei Chen, Daliang Xu, Dong Tong, Kang Sun, Xuetao Guan, Chun Yang, Xu ChengarXiv 2020

Abstract

Memory spatial errors, such as buffer overflows, typically trigger "fail-stop" responses that terminate programs, compromising system availability and enabling Denial-of-Service (DoS) attacks. This paper introduces Saturation Memory Access (SMA), a compiler-based mitigation that utilizes tagged pointers to redirect out-of-bounds memory accesses into safe padding regions. By "clamping" these accesses, SMA allows programs to survive memory errors and continue executing safely without termination. Our evaluation shows that SMA achieves robust security with significantly lower performance overhead than existing failure-oblivious methods, particularly when leveraging hardware features like ARMv8's Top Byte Ignore.

Introduction

Buffer overflows and related spatial memory errors remain a primary root cause of software vulnerabilities, often exploited for Return-Oriented Programming (ROP) or data exfiltration. Traditional deterministic defenses, such as AddressSanitizer, adopt a fail-stop strategy: they terminate the victim program upon detecting an illegal access. While effective at preventing exploitation, this approach destroys software availability. An attacker capable of triggering a bug can launch persistent DoS attacks.

Previous attempts to maintain availability, such as "failure-oblivious computing" or "Boundless memory," often incur prohibitive performance costs, making them impractical for resource-constrained environments like embedded systems. SMA addresses this gap by providing a low-overhead mechanism to neutralize memory errors without crashing the program.

Methodology

SMA is inspired by saturation arithmetic in digital signal processing. Rather than allowing an out-of-bounds (OOB) access to wrap around or trigger a segmentation fault, SMA "clamps" the access to the boundaries of the memory object.

Comparison of unrestricted memory access vs. SMA's saturation access mechanism.

Technical Components

  • Tagged Pointers: SMA stores object boundary metadata—specifically the size of the object as an exponent—directly within the unused high bits of a 64-bit pointer. This eliminates the need for expensive shadow memory lookups.
  • Power-of-2 Padding: Memory allocations are rounded up to the nearest power of 2, creating a natural padding area. SMA redirects OOB writes into this padding and clamps underflows to the base address.
  • Compiler Instrumentation: Implemented as an LLVM 10.0 pass, SMA inserts branchless bounds checks using conditional move (cmov) instructions before memory operations to minimize pipeline penalties.
  • Hardware Acceleration: On ARMv8, SMA leverages the Address Tagging (Top Byte Ignore) feature, allowing the CPU to ignore metadata tags during translation, thereby reducing software overhead.

Experimental Evaluation

The effectiveness of SMA was evaluated using standard benchmarks including MiBench, SPEC CPU2017, RIPE, and BugBench.

Performance and Security Results

On the MiBench suite (x86-64), SMA incurred an average performance overhead of 78%. While notable, this is significantly lower than predecessors like SoftBound. On ARMv8, hardware support further reduced overhead by 11% to 16%. In terms of security, SMA successfully blocked 95.13% of the 1,334 attack forms in the RIPE benchmark.

Error Tolerance

Testing against real-world vulnerable applications in BugBench demonstrated that SMA successfully intercepted segmentation faults, clamped the erroneous memory accesses, and allowed the programs to complete their execution and exit normally.

Discussion and Limitations

The core philosophy of SMA is that benign program logic does not intentionally rely on OOB accesses. By redirecting OOB writes to padding, SMA neutralizes attack payloads without interfering with intended functionality.

However, SMA has limitations. It currently fails to block sub-object overflows (e.g., within a struct) because it tracks base allocation sizes rather than internal boundaries. Additionally, power-of-2 rounding introduces internal memory fragmentation, and interacting with uninstrumented libraries requires manual tag stripping.

Conclusion

SMA offers a novel approach to memory safety by prioritizing system availability. By transforming fatal memory errors into harmless saturated accesses, it provides a robust defense against DoS attacks and exploits. Future work will focus on integrating type-layout information to support sub-object bounds and exploring deeper ISA support to further reduce instrumentation latency.

Summary updated

BibTeX
@misc{chen2020sma,
  author = {Dongwei Chen and Daliang Xu and Dong Tong and Kang Sun and Xuetao Guan and Chun Yang and Xu Cheng},
  title = {{SMA: Eliminate Memory Spatial Errors via Saturation Memory Access}},
  year = {2020},
  eprint = {2002.02831},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.02831},
}
Figure