Skip to main content
QUICK REVIEW

[Paper Review] Restricting Control Flow During Speculative Execution with Venkman

Zhuojia Shen, Jie Zhou|arXiv (Cornell University)|Mar 26, 2019
Security and Verification in ComputingComputer Science25 references5 citations
TL;DR

Venkman is a software-only defense that prevents Spectre attacks exploiting Branch Target Buffer (BTB) and Return Stack Buffer (RSB) poisoning by transforming code to align all control-flow targets to fixed-size bundles, ensuring speculative execution cannot skip protective instructions like fences or SFI checks. It achieves strong mitigation without BTB/RSB flushing or reduced sharing, with a 3.47× average performance overhead on SPEC benchmarks.

ABSTRACT

Side-channel attacks such as Spectre that utilize speculative execution to steal application secrets pose a significant threat to modern computing systems. While program transformations can mitigate some Spectre attacks, more advanced attacks can divert control flow speculatively to bypass these protective instructions, rendering existing defenses useless. In this paper, we present Venkman: a system that employs program transformation to completely thwart Spectre attacks that poison entries in the Branch Target Buffer (BTB) and the Return Stack Buffer (RSB). Venkman transforms code so that all valid targets of a control-flow transfer have an identical alignment in the virtual address space; it further transforms all branches to ensure that all entries added to the BTB and RSB are properly aligned. By transforming all code this way, Venkman ensures that, in any program wanting Spectre defenses, all control-flow transfers, including speculative ones, do not skip over protective instructions Venkman adds to the code segment to mitigate Spectre attacks. Unlike existing defenses, Venkman does not reduce sharing of the BTB and RSB and does not flush these structures, allowing safe sharing and reuse among programs while maintaining strong protection against Spectre attacks. We built a prototype of Venkman on an IBM POWER8 machine. Our evaluation on the SPEC benchmarks and selected applications shows that Venkman increases execution time to 3.47$ imes$ on average and increases code size to 1.94$ imes$ on average when it is used to ensure that fences are executed to mitigate Spectre attacks. Our evaluation also shows that Spectre-resistant Software Fault Isolation (SFI) built using Venkman incurs a geometric mean of 2.42$ imes$ space overhead and 1.68$ imes$ performance overhead.

Motivation & Objective

  • To address Spectre Variant-2 attacks that poison the BTB and RSB to bypass software mitigations like fences and SFI.
  • To design a software-only defense that fully mitigates BTB and RSB poisoning without requiring hardware microcode updates.
  • To ensure speculative execution cannot skip protective instructions by enforcing bundle-level alignment of all control-flow targets.
  • To maintain safe sharing of BTB and RSB across programs while preserving strong security guarantees.
  • To evaluate the performance and code size overhead of the defense on real-world workloads.

Proposed method

  • Transform all code on the system so that every control-flow target is aligned to the start of a fixed-size bundle, with all bundles aligned to a common power-of-two boundary.
  • Modify branches to align target addresses to the nearest bundle boundary before branching, ensuring all BTB and RSB entries point to bundle starts.
  • Insert protective instructions—such as fence instructions or SFI checks—into the same bundle as the instructions they protect, preventing speculative bypass.
  • Enforce that call and return instructions are placed at the end of bundles to ensure return addresses are also bundle-aligned.
  • Integrate with a system-wide compilation pipeline to ensure all binaries are transformed consistently, preventing untrusted code from poisoning the BTB or RSB.
  • Use a prototype on IBM POWER8 to evaluate performance and code size overhead on SPEC benchmarks and selected applications.

Experimental results

Research questions

  • RQ1Can a software-only defense prevent Spectre attacks that poison the BTB and RSB without relying on hardware microcode updates?
  • RQ2How can code transformation ensure that speculative execution cannot bypass security-critical instructions like fences or SFI checks?
  • RQ3Can BTB and RSB entries be safely shared across programs while still preventing speculative control-flow hijacking?
  • RQ4What is the performance and code size overhead of enforcing bundle-level alignment and protective instruction placement?
  • RQ5Can existing defenses like SFI or fences be made resilient to BTB/RSB poisoning through strategic code placement?

Key findings

  • Venkman increases average execution time by 3.47× when used to insert fences for Spectre Variant-1 mitigation on SPEC benchmarks.
  • The average code size increases by 1.94× due to bundle alignment and insertion of protective instructions.
  • Spectre-resistant Software Fault Isolation (SFI) built with Venkman incurs a geometric mean of 2.42× space overhead and 1.68× performance overhead.
  • Venkman ensures that all speculative control-flow transfers are restricted to bundle-aligned targets, preventing bypass of protective instructions.
  • The defense maintains safe sharing of BTB and RSB entries across programs, unlike solutions that require flushing or privilege-level isolation.
  • Venkman’s approach is effective on IBM POWER8 and is extensible to x86 and ARM, though porting is left for future work.

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.