NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Practical Approach for Adaptive Data Structure Layout Randomization

Ping Chen, Jun Xu, Zhiqiang Lin, Dongyan Xu, Bing Mao, Peng LiuESORICS 2015

Introduction

Modern software security relies heavily on randomization to thwart memory-corruption attacks. The most prevalent technique, Address Space Layout Randomization (ASLR), obscures the base addresses of memory segments. However, ASLR is increasingly vulnerable to memory content leakage. Once an attacker leaks a single pointer, they can often calculate the base address and exploit the fact that the internal layout of data structures—the specific offsets of fields like user IDs or function pointers—remains constant throughout the program's execution.

To address this, researchers have proposed SALADS (Self Adaptation of LAyout of Data Structures). SALADS is a compiler-based defense that introduces "cross-time diversity" by automatically and periodically reshuffling the internal layout of data structures at runtime, ensuring that any leaked memory "map" quickly becomes obsolete.

The Problem: Static Layouts and Memory Leakage

Existing "static" Data Structure Layout Randomization (DSLR) techniques randomize field offsets at compile-time. While this prevents a single exploit from working across all installations (solving the "mono-culture" problem), it does not protect a running process from a persistent attacker. If an attacker can reverse-engineer the layout of a running process once through side channels or memory leaks, they can exploit that specific instance indefinitely.

Figure 1: Attack scenario involving memory leakage and data structure reverse engineering.

As illustrated in the attack model above, exploits typically follow a chronological sequence: (1) leaking memory content, (2) inferring the data structure layout, and (3) manipulating specific fields. Static layouts, even if randomized at build-time, remain vulnerable because the information gained in step 2 remains valid for step 3.

The SALADS Framework

SALADS transforms standard C/C++ code into Data Structure Self-Randomizing (DSSR) programs using a modified GCC compiler (version 4.5.0). The system creates a moving target by making randomization adaptive and asynchronous.

Figure 2: The SALADS compiler-based transformation pipeline.

The framework consists of three primary components integrated into the compiler pipeline:

  1. Extraction Component: An AST-level pass identifies sensitive data structure definitions and tracks their usage across external or shared APIs.
  2. Randomization Component (GIMPLE Pass-1): This pass instruments the code to insert DSSR logic. Each sensitive object instance maintains a counter ($I_c$). When the counter reaches a predefined threshold ($W_m$), the program autonomously shuffles the fields of that specific instance in memory.
  3. De-randomization Component (GIMPLE Pass-2): To maintain compatibility with un-instrumented libraries (like libc), the system identifies "dangerous" operations, such as pointer casting or passing structs to external APIs. In these instances, SALADS restores the data structure to its original, predictable layout before the operation occurs.

Each object instance is supported by a "randomization record" that tracks current offsets, original offsets, and safety flags, ensuring that two different objects of the same struct type can have entirely different layouts simultaneously.

Evaluation and Results

SALADS was evaluated across applications (SPECInt2000, OpenSSH, OpenSSL), the Linux kernel (2.6.23.1), and the Xen hypervisor. The system successfully defeated real-world vulnerabilities (e.g., CVE-2001-0144) and 12 different rootkits by triggering re-randomization before attackers could complete their exploits.

Performance overhead remained manageable:

  • Applications: Average of 6.3% overhead when protecting 20% of data structures.
  • Linux Kernel: 16.7% overhead while protecting 23 high-security structs.
  • Xen Hypervisor: 4.5% overhead for 20 sensitive structs.

Memory overhead was consistently low, ranging from 0.7% to 8.6%. The authors determined that a re-randomization threshold ($W_m$) of 5 provided an optimal balance between security and performance.

Discussion and Future Work

While SALADS provides a robust defense against layout-dependent attacks, it faces certain limitations. The "randomization records" themselves are stored in memory; if an attacker can read these directly, the defense is bypassed. Future iterations could utilize hardware-based access control to protect this metadata. Additionally, while SALADS thwarts data-oriented attacks, it should be paired with Control Flow Integrity (CFI) to defend against code-reuse attacks that might target the randomization routines themselves. Currently, the selection of "security-sensitive" structures in complex environments like the kernel is a manual process, presenting an opportunity for future automation.

Summary updated

BibTeX
@inproceedings{chen2015practical,
  author = {Ping Chen and Jun Xu and Zhiqiang Lin and Dongyan Xu and Bing Mao and Peng Liu},
  title = {{A Practical Approach for Adaptive Data Structure Layout Randomization}},
  booktitle = {ESORICS},
  year = {2015},
  doi = {10.1007/978-3-319-24174-6\_4},
}
Figure