Value-Based Constraint Control Flow Integrity

Dongjae Jung, Minsu Kim, Jinsoo Jang, Brent ByungHoon KangIEEE Access 2020

Introduction

Control-flow hijacking remains a persistent threat in software security. Traditional Control Flow Integrity (CFI) mechanisms aim to prevent these attacks by ensuring that indirect branches—such as function calls via pointers—only jump to a set of statically determined "legitimate" targets. However, standard CFI often relies on an incomplete threat model: it assumes attackers only manipulate "control data" (the pointers themselves).

In practice, attackers can bypass these defenses by corrupting "non-control data"—variables like boolean flags or array indices that influence the logic leading up to a branch. By manipulating this "condition data," an attacker can "bend" the control flow to unintended but technically "legitimate" targets without violating traditional CFI rules. Furthermore, many modern CFI solutions are tied to specific hardware features (e.g., Intel LBR or Processor Trace), limiting their portability. This paper introduces vCFI (Value-Based Constraint CFI), a compiler-based approach that closes these gaps by protecting the data values that constrain control flow.

Methodology

The vCFI system is implemented as an LLVM-based compiler extension that operates in two primary phases: static analysis and runtime enforcement.

Static Analysis

The analysis phase identifies all data that materially affects control flow decisions. It builds a Control Flow Graph (CFG) and performs dependency analysis to map how values propagate through the program. The system categorizes data into four distinct types:

  1. Control Data: Direct pointers used in indirect branches.
  2. Control Dependency Data: Data that determines which control data is used.
  3. Condition Data: Variables used in conditional statements (e.g., if, while) that steer the execution path toward specific branches.
  4. Condition Dependency Data: Data that influences the values of condition data.

Runtime Enforcement

To protect these critical values, vCFI instruments the program to use a secure shadow memory region.

  • Shadow Memory: A region of memory, hidden from the attacker via randomization, stores mirrored copies of critical control-related data.
  • Instrumentation: The compiler inserts setValue and getValue primitives. When a critical variable is modified in main memory, its value is simultaneously updated in the shadow memory. Before a control flow decision is made, the program retrieves the "trusted" value from the shadow memory rather than the potentially corrupted main memory.

To maintain performance, vCFI employs selective protection. It only instruments data involved in memory operations, as attackers typically cannot directly modify CPU registers through standard memory corruption vulnerabilities.

Evaluation

The authors evaluated vCFI using the SPEC CPU2006 benchmark suite, covering a diverse range of C/C++ workloads including gcc, bzip2, and povray.

Security and Precision

A key finding of the study is that traditional "control data" accounts for only 0.67% of the data affecting control flow, leaving a massive attack surface. By protecting the broader set of constraint values, vCFI significantly improves precision. In "Full Condition Analysis" mode, the system successfully reduced the number of allowed targets for indirect branches to exactly 1 in many cases, effectively neutralizing control-flow bending attacks.

Performance and Overhead

The average runtime overhead across the SPEC CPU2006 suite was 13.6%. While higher than some "coarse-grained" CFI implementations, this is a competitive trade-off for the significantly higher security guarantees provided. Memory overhead remained low, averaging 4.3% for full analysis and dropping to 1.7% with one-time optimizations. Static analysis for large-scale applications like gcc took approximately 9 hours, a reasonable cost for a one-time hardening step during compilation.

Discussion and Future Work

While vCFI provides robust protection, its current reliance on randomized shadow memory addresses presents a potential vulnerability if an attacker can leak the address or use brute force. Future work could leverage hardware features like Intel MPX (Memory Protection Extensions) or TSX (Transactional Synchronization Extensions) to further isolate the shadow memory. Additionally, further refinements in static analysis could reduce the instrumentation footprint, potentially lowering the 13.6% runtime overhead.

Conclusion

vCFI addresses a critical weakness in traditional CFI by recognizing that non-control data is a primary vector for control-flow hijacking. By identifying and protecting the values that constrain branch targets, vCFI provides a hardware-independent, high-precision defense with manageable performance costs, significantly reducing the available "gadgets" for modern exploits.

Summary updated

BibTeX
@article{jung2020value,
  author = {Dongjae Jung and Minsu Kim and Jinsoo Jang and Brent ByungHoon Kang},
  title = {{Value-Based Constraint Control Flow Integrity}},
  journal = {IEEE Access},
  year = {2020},
  doi = {10.1109/access.2020.2980026},
}
Figure