Abstract
Microarchitectural timing channels enable unwanted information flow across security boundaries, violating fundamental security assumptions. They leverage timing variations of several state-holding microarchitectural components and have been demonstrated across instruction set architectures and hardware implementations. Analogously to memory protection, Ge et al. have proposed time protection for preventing information leakage via timing channels. They also showed that time protection calls for hardware support. This work leverages the open and extensible RISC-V instruction set architecture (ISA) to introduce the temporal fence instruction fence.t, which provides the required mechanisms by clearing vulnerable microarchitectural state and guaranteeing a history-independent context-switch latency. We propose and discuss three different implementations of fence.t and implement them on an experimental version of the seL4 microkernel and CVA6, an open-source, in-order, application class, 64-bit RISC-V core. We find that a complete, systematic, ISA-supported erasure of all non-architectural core components is the most effective implementation while featuring a low implementation effort, a minimal performance overhead of approximately 2%, and negligible hardware costs.
Introduction: The Microarchitectural Timing Channel Problem
Modern security relies on the assumption that operating systems can isolate applications. However, even with perfect memory protection, applications share physical hardware resources. A malicious "Trojan" application can influence the state of shared components—such as caches, branch predictors, or internal buffers—and a "Spy" application can later measure the execution time of its own operations to infer the Trojan's activity. These microarchitectural timing channels bypass traditional software-level security boundaries.
Current processors lack a reliable mechanism to "wipe the slate clean" during context switches. Software-only mitigations are often incomplete or rely on undocumented hardware behaviors, leading to a "whack-a-mole" scenario where new leaky buffers are discovered as hardware evolves. The authors argue that a new hardware-software contract—time protection—is required to complement traditional memory protection.
Proposed Solution: Time Protection via fence.t and MICRORESET
The authors propose a multi-layered approach to enforce temporal partitioning on a 64-bit RISC-V core (CVA6):
- The
fence.tInstruction: A new ISA extension that triggers the clearing of all microarchitectural state that could influence future timing. - MICRORESET: Instead of manually flushing specific buffers, the authors implemented a "deny-by-default" approach. They created a "clear" signal for nearly every flip-flop in the design, whitelisting only the architectural state (e.g., General Purpose Registers and Control and Status Registers) that must be preserved for program continuity. This ensures that even hidden components, like replacement policy bits or arbiters, are reset.
- Time Padding: To prevent the duration of the flush itself from becoming a side channel (e.g., due to varying numbers of dirty cache lines), the authors introduced a
cspadregister. This mechanism stalls the processor until a fixed, worst-case execution time is reached, ensuring context-switch latency is history-independent.
Evaluation and Results
The implementation was integrated into the seL4 microkernel and evaluated using CHANNEL BENCH (to measure information leakage) and Splash-2 (to measure performance overhead).
- Security Effectiveness: MICRORESET successfully closed all tested timing channels. For instance, L1 Data Cache leakage dropped from over 1.6 bits per iteration to below the noise floor (the "Zero Leakage Upper Bound").
- Performance Impact: For a standard 10ms OS timeslice, the performance overhead was less than 1%. Even under aggressive context switching (every 10 million cycles), the average slowdown across Splash-2 benchmarks remained a minimal 0.7%.
- Hardware Overhead: The modifications added only 0.13% area overhead to the CVA6 core and did not impact the maximum clock frequency.
Conclusion
Systematic, ISA-supported erasure of non-architectural core components via fence.t and MICRORESET provides a robust defense against on-core timing channels. This approach is highly effective, features low implementation effort, and incurs negligible hardware and performance costs. While this work focuses on in-order cores, the principles of full temporal partitioning provide a foundation for securing more complex out-of-order architectures and addressing off-core leakage in future research.
Summary updated