Skip to main content
QUICK REVIEW

[Paper Review] HardScope: Thwarting DOP with Hardware-assisted Run-time Scope Enforcement

Thomas Nyman, Ghada Dessouky|arXiv (Cornell University)|May 29, 2017
Security and Verification in ComputingComputer Science6 references17 citations
TL;DR

HardScope proposes hardware-assisted run-time scope enforcement (RSE) to prevent data-oriented programming (DOP) attacks in memory-unsafe languages like C and C++. By dynamically enforcing compile-time variable visibility rules at run-time using six new RISC-V instructions, HardScope mitigates all known DOP attacks with only 3.2% performance overhead in embedded benchmarks.

ABSTRACT

Widespread use of memory unsafe programming languages (e.g., C and C++) leaves many systems vulnerable to memory corruption attacks. A variety of defenses have been proposed to mitigate attacks that exploit memory errors to hijack the control flow of the code at run-time, e.g., (fine-grained) randomization or Control Flow Integrity. However, recent work on data-oriented programming (DOP) demonstrated highly expressive (Turing-complete) attacks, even in the presence of these state-of-the-art defenses. Although multiple real-world DOP attacks have been demonstrated, no efficient defenses are yet available. We propose run-time scope enforcement (RSE), a novel approach designed to efficiently mitigate all currently known DOP attacks by enforcing compile-time memory safety constraints (e.g., variable visibility rules) at run-time. We present HardScope, a proof-of-concept implementation of hardware-assisted RSE for the new RISC-V open instruction set architecture. We discuss our systematic empirical evaluation of HardScope which demonstrates that it can mitigate all currently known DOP attacks, and has a real-world performance overhead of 3.2% in embedded benchmarks.

Motivation & Objective

  • Address the growing threat of data-oriented programming (DOP) attacks, which bypass traditional control-flow defenses by corrupting data to achieve arbitrary computation.
  • Overcome the limitations of existing defenses, which either lack complete mediation of memory accesses or incur high performance and memory overhead.
  • Enable efficient, fine-grained memory isolation at run-time without requiring whole-program analysis or application-level re-engineering.
  • Demonstrate that run-time scope enforcement (RSE) can effectively prevent DOP attacks in typical programs by enforcing lexical scope rules dynamically.

Proposed method

  • Introduce a hardware-assisted RSE mechanism using six new RISC-V instructions to enforce memory access policies at run-time.
  • Instrument C programs via a GCC plugin to insert HardScope instructions that dynamically create and manage scope rules for memory access.
  • Store active scope rules as a stack, ensuring all applicable rules for the current execution context are at the top and can be checked efficiently.
  • Use on-chip caching of active rules to enable implicit, zero-overhead access checks during memory operations.
  • Design the system to support context-specific memory isolation, allowing different access policies across different invocations of the same function.
  • Leverage hardware support to minimize metadata storage and reduce runtime enforcement costs compared to software-only or static approaches.

Experimental results

Research questions

  • RQ1Can run-time scope enforcement (RSE) effectively prevent all known DOP attacks by enforcing lexical scope rules at run-time?
  • RQ2What is the performance overhead of hardware-assisted RSE when applied to real-world embedded workloads?
  • RQ3How does RSE compare to existing defenses in terms of overhead, scalability, and support for dynamic, context-specific access policies?
  • RQ4Can RSE be implemented efficiently with minimal hardware changes and without requiring application-level re-engineering?
  • RQ5Is it feasible to integrate RSE into a general-purpose RISC-V core with acceptable performance and memory footprint?

Key findings

  • HardScope successfully mitigates all currently known DOP attacks by enforcing lexical scope rules at run-time using hardware-assisted instruction set extensions.
  • The empirical evaluation shows a real-world performance overhead of only 3.2% on embedded benchmarks, significantly lower than prior software-based defenses.
  • HardScope reduces runtime metadata storage by focusing only on active execution contexts, enabling efficient on-chip caching of scope rules.
  • The system supports context-specific memory isolation, allowing different access policies across different invocations of the same function without recompilation.
  • Hardware-assisted enforcement enables implicit access checks with no measurable overhead, unlike software-based schemes that require explicit checks.
  • The approach is compatible with unmodified C programs and does not require whole-program analysis or application-level re-engineering, unlike CHERI or SoftBound.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.