Data memory prefetchers secured to prevent secret leaks with minimal slowdown

SecDMP: Provably Secure Data Memory-Dependent Prefetching (Extended Version)

Cryptography and Security

Summary

Modern computer processors try to speed things up by guessing what data they will need next, a method called data memory-dependent prefetching (DMP). However, these guesses can accidentally reveal secret information through side channels, even in programs designed to avoid such leaks. The authors found current protections either slow down the computer significantly or don't stop all leaks. They created SecDMP, a new hardware method that marks secret data and prevents DMP from exposing it, while keeping the speed benefits for non-secret data. Their tests show SecDMP stops all secret leaks from DMP with little impact on performance.

What this means in practice

  • For cpu designers: Design CPUs that include SecDMP to securely prefetch data without leaking secrets, preserving performance for common code.
  • For hardware security engineers: Integrate SecDMP as part of a hardware security toolbox to defend constant-time cryptographic code against advanced microarchitectural leaks.

Authors

Jens Sprengers, Marton Bognar, Lesly-Ann Daniel, Frank Piessens

Abstract

Data memory-dependent prefetchers (DMPs) are a microarchitectural optimization recently introduced in mainstream desktop and server CPUs. Although DMPs offer performance improvements, they have been shown to enable side-channel leakage of secrets, even from constant-time code that has been hardened against Spectre attacks. Unfortunately, existing defenses either incur significant performance overhead or, as we show, fail to prevent all DMP leakage. In this work, we address this gap by designing a defense that is both secure and efficient. First, we propose a classification of DMP leakage, categorize existing and novel attacks, and analyze which leakage classes are mitigated by existing defenses. We validate this analysis empirically by implementing the first open-source DMPs on a RISC-V processor, showing that the only existing defense that aims to preserve DMP performance fails to protect against entire leakage classes. Next, we propose SecDMP, a provably secure and efficient hardware-based defense. SecDMP requires secrets to be marked in memory and ensures that DMPs never encode these secrets in the microarchitecture---without compromising performance for public data. We formally prove that SecDMP introduces no leakage beyond a baseline semantics without DMPs. Notably, when combined with speculative-execution defenses, SecDMP restores complete microarchitectural security for constant-time code. Finally, our empirical evaluation shows that SecDMP prevents all DMP leakage while incurring minimal performance overhead and hardware cost.