This is an archive of the discontinued LLVM Phabricator instance.

Initial Syringe Prototype
AbandonedPublic

Authored by paulkirth on Sep 11 2018, 5:12 PM.

Details

Summary

This patch contains a simple prototype for Syringe, an LLVM based framework for behavior injection. The goal of this work is to allow developers to change how a program can behave at runtime by allowing them to dynamically change how targeted functions behave. We accomplish this by modifying a targeted function's body to make an indirect call through a runtime controlled implementation pointer, which can point to either the original function body or to an alternate function determined at compile time. This allows us to dynamically enable and disable different functionality as the program runs, without limiting the variety of new behaviors supported by our tool. We add new annotations to mark the targets for injection, and their alternate behaviors. Additionally, we support configuration through YAML files, to avoid changing existing source code. One nice aspect of our approach is that injection sites(targets for new behaviors), and injection payloads(the new behaviors) can exist in separate translation units, and have their interactions codified at link time. While Syringe is designed to be somewhat general, its main use case is for supporting out of production use for activities like dynamic fault injection.

See the RFC on CFE-dev for more information: http://lists.llvm.org/pipermail/cfe-dev/2018-September/059260.html

Diff Detail

Event Timeline

paulkirth created this revision.Sep 11 2018, 5:12 PM
paulkirth updated this revision to Diff 165398.Sep 13 2018, 3:48 PM

I've added support to Syringe for dispatching injected behaviors using direct calls, which follows the advice of Kostya Serebryany on CFE-dev http://lists.llvm.org/pipermail/cfe-dev/2018-September/059312.html

This approach requires some extra code, since we now must manipulate LLVM IR ourselves rather than relying on ORC to handle all the transforms on our behalf.

paulkirth abandoned this revision.Mar 29 2022, 10:45 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript