Skip to main content
QUICK REVIEW

[Paper Review] LazyFP: Leaking FPU Register State using Microarchitectural Side-Channels

Julian Stecklina, Thomas Prescher|arXiv (Cornell University)|Jun 19, 2018
Security and Verification in ComputingComputer Science2 references66 citations
TL;DR

The paper demonstrates practical attacks that leak FPU/SIMD register state across process/VM boundaries by abusing lazy FPU context switching and microarchitectural side channels, using fault-based, TSX-based, or retpoline-based exception suppression.

ABSTRACT

Modern processors utilize an increasingly large register set to facilitate efficient floating point and SIMD computation. This large register set is a burden for operating systems, as its content needs to be saved and restored when the operating system context switches between tasks. As an optimization, the operating system can defer the context switch of the FPU and SIMD register set until the first instruction is executed that needs access to these registers. Meanwhile, the old content is left in place with the hope that the current task might not use these registers at all. This optimization is commonly called lazy FPU context switching. To make it possible, a processor offers the ability to toggle the availability of instructions utilizing floating point and SIMD registers. If the instructions are turned off, any attempt of executing them will generate a fault. In this paper, we present an attack that exploits lazy FPU context switching and allows an adversary to recover the FPU and SIMD register set of arbitrary processes or VMs. The attack works on processors that transiently execute FPU or SIMD instructions that follow an instruction generating the fault indicating the first use of FPU or SIMD instructions. On operating systems using lazy FPU context switching, the FPU and SIMD register content of other processes or virtual machines can then be reconstructed via cache side effects. With SIMD registers not only being used for cryptographic computation, but also increasingly for simple operations, such as copying memory, we argue that lazy FPU context switching is a dangerous optimization that needs to be turned off in all operating systems, if there is a chance that they run on affected processors.

Motivation & Objective

  • Explain how lazy FPU context switching enables cross-boundary FPU state leakage.
  • Characterize multiple attack variants that reuse speculative execution to read FPU/SIMD registers.
  • Evaluate practicality and performance of different exception suppression methods.
  • Assess impact on cryptographic primitives like AES-NI and discuss mitigations.
  • Provide guidance for operating systems to improve security by avoiding lazy FPU context switching.

Proposed method

  • Describe the lazy FPU context switching mechanism and how the #NM exception signals FPU usage.
  • Develop one-bit and full-register leaks by exploiting speculative execution and cache side effects.
  • Propose three attack variants: page fault-based suppression, Intel TSX-based suppression, and retpoline-based suppression.
  • Show practical leakage of an entire AVX register set within a scheduling time slice.
  • Analyze impact on AES-NI key material and provide mitigation recommendations.

Experimental results

Research questions

  • RQ1Can lazy FPU context switching be exploited to recover the victim's FPU/SIMD register state via speculative execution?
  • RQ2What are the practical attack variants that suppress or evade OS exception handling to leak FPU registers?
  • RQ3How does the attack performance vary with different exception-suppression mechanisms (page fault, TSX, retpoline)?
  • RQ4What is the impact of leaked FPU state on cryptographic primitives like AES-NI?

Key findings

  • A simple one-bit leak uses speculative execution to infer bits of the victim's FPU registers by cache effects.
  • Suppressing the NM fault via page faults, TSX, or retpoline enables a full snapshot of the FPU state within a scheduling time slice.
  • Tabled results show substantial speedups when using TSX or retpoline over the page fault method for leaking a 256-bit AVX register.
  • Leak variants can expose AES-NI related registers, potentially compromising cryptographic keys kept in SSE registers.
  • Mitigation by switching from lazy to eager FPU context switching reduces leakage risk; Linux parameter eagerfpu=on provides a workaround in some kernels.
  • The vulnerability CVE-2018-3665 (INTEL-SA-00145) was publicly disclosed by the authors.

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.