• https://doi.org/10.1145/3129743.3129746Copy DOI Icon

Protecting dynamic code

  • Mar 1, 2018
  • Gang Tan +1 more
Show More
  • Abstract
  • Literature Map
  • Similar Papers
Abstract

One important aspect of making Control-Flow Integrity (CFI) practical is to support modularity. In the context of CFI, modularity refers to the ability to perform instrumentation of modules of an application separately, without considering other modules, and to link instrumented modules into an executable on demand. Modularity support is of crucial importance for accommodating dynamic linking, which loads libraries at runtime and is frequently used in modern software systems since it allows different software vendors to work on or update modules independently. Just-In-Time (JIT) compilation also requires modularity support because a piece of newly generated code by a JIT compiler can be considered a module, which is to be with the JIT compiler. In both dynamic linking and JIT compilation, not all code is available statically. The code of a dynamically linked library is available only after the library has been loaded at runtime, which may happen during the middle of a program execution; in JIT compilation, the binary code of a function is available only after the function has been compiled on the fly. We call this kind of code dynamic code since it is available only after a runtime event. Unfortunately, many CFI systems require all modules of an application, including libraries, to be available at the static instrumentation time. They perform a global analysis on all code to construct a global Control-Flow Graph (CFG). Instrumentation schemes in many CFI systems also assume global code properties. For instance, instrumentation in the classic CFI [Abadi et al. 2005a] inserts identifiers (representing a class of indirect branches and targets) before branch targets and inserts checks before indirect branches to make sure the right identifiers according to the CFG are at the targets. The identifiers are embedded as instructions in code and cannot appear in the rest of the code. However, this property cannot be guaranteed without inspecting the whole program. Many other CFI instrumentation techniques also do not support modularity; the reasons for this are discussed in Section 2.5. In this chapter, we present a modular CFI system that extends CFI to support dynamic code.We start with an overview of the main challenges and solutions when dealing with dynamic code in Section 2.1. In Section 2.2, we present a compilerassisted, type-based scheme that allows efficient CFG construction in the presence of dynamic code. In Section 2.3, we present a modular CFI system that supports dynamic libraries by adopting the type-based CFG construction process and a technique for supporting multi-threading. In Section 2.4, we show that, with some adjustments, the modular CFI system can support JIT compilation. We discuss related work in Section 2.5 and conclude in Section 2.6. The main results of this chapter were published in previous conference papers [Niu and Tan 2014a, Niu and Tan 2014b] and in a Ph.D. dissertation [Niu 2015]. In this chapter, we streamline the presentation by integrating the previous papers and by highlighting the most important ideas and messages that are of interest to future CFI research. Certain details are omitted and interested readers are referred to the previous papers. Furthermore, experimental results included in this chapter may be different from those in the conference publications because we have made improvements since their publication.

Similar Papers
  • Conference Article
  • Citations13

CFG Construction Soundness in Control-Flow Integrity

  • Oct 30, 2017
  • Gang Tan +1
  • Conference Article
  • Citations22

Adaptive Call-Site Sensitive Control Flow Integrity

  • Jun 01, 2019
  • Mustakimur Khandaker +5
  • Research Article
  • Citations76

Modular control-flow integrity

  • Jun 05, 2014
  • ACM SIGPLAN Notices
  • Ben Niu +1
  • Conference Article
  • Citations2

MazeRunner: Evaluating the Attack Surface of Control-Flow Integrity Policies

  • Oct 01, 2021
  • Dongrui Zeng +2
  • Research Article
  • Citations1

SCFI: Efficient forward fine-grained control flow integrity based on coarse-grained ISA extensions

  • Mar 08, 2024
  • Computers & Security
  • Cairui She +3
  • PDF
  • Book Chapter

Wrangling in the Power of Code Pointers with ProxyCFI

  • Jan 01, 2019
  • Misiker Tadesse Aga +2
  • Book Chapter

A CCFI Verification Scheme Based on the RISC-V Trace Encoder

  • Jan 01, 2023
  • Anthony Zgheib +3
  • Conference Article
  • Citations97

HCFI

  • Mar 09, 2016
  • Nick Christoulakis +3
  • Research Article
  • Citations2

MagBox: Keep the risk functions running safely in a magic box

  • Nov 04, 2022
  • Future Generation Computer Systems
  • Yonggang Li +5
  • Conference Article
  • Citations43

The Devil is in the Constants: Bypassing Defenses in Browser JIT Engines

  • Jan 01, 2015
  • Michalis Athanasakis +4
  • Conference Article
  • Citations1

ML-Driven Prediction of Optimal Control Flow Graph Traversal Algorithm in Modern Applications

  • Jun 09, 2025
  • Milan Čugurović +5
  • PDF
  • Research Article
  • Citations8

Bratter: An Instruction Set Extension for Forward Control-Flow Integrity in RISC-V

  • Feb 11, 2022
  • Sensors (Basel, Switzerland)
  • Seonghwan Park +3
  • Research Article
  • Citations78

Java runtime systems: characterization and architectural implications

  • Jan 01, 2001
  • IEEE Transactions on Computers
  • R Radhakrishnan +5
  • Conference Article
  • Citations47

Generalized just-in-time trace compilation using a parallel task farm in a dynamic binary translator

  • Jun 04, 2011
  • Igor Böhm +4
  • Conference Article
  • Citations7

DTT

  • May 20, 2014
  • Ning Jia +3
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.