SpectreShield: Design and Analysis of Spectre Countermeasures on RISC-V Using gem5

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Speculative execution attacks like Spectre exploit microarchitectural side effects to leak sensitive data during transient execution. While various software and hardware countermeasures have been proposed for x86 and ARM architectures, their effectiveness and microarchitectural impact remain underexplored on RISC-V platforms. To study such attacks and evaluate these countermeasures, simulation tools like the gem5 simulator provide detailed insights into microarchitectural state changes during speculation. In this paper, we present the first comprehensive evaluation of Spectre-v1 countermeasures on the RISC-V architecture using the gem5 full-system simulator. We implement and assess four Spectre-v1 mitigations: index masking (CM1), randomized offset (CM2), fence-based serialization (CM3), and bitwise selection (CM4). Our experiments reveal that, in the absence of mitigations, Spectre-v1 enables 100% secret key recovery. In contrast, all proposed countermeasures reduce the recovery rate to below 1%, with branch mispredictions decreasing by 41.7%-46.3%. The paper analyzes the securityperformance trade-offs of each approach. Beyond demonstrating their effectiveness, we quantify their microarchitectural impact, measuring reductions in squashed instructions, DRAM latency variability, and return address stack mispredictions. This paper provides a practical framework for evaluating transient execution defenses and advances secure-by-design RISC-V processors.

Original languageEnglish
Title of host publicationProceedings of the 2025 IEEE International Conference on Cyber Security and Resilience, CSR 2025
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages1008-1015
Number of pages8
ISBN (Electronic)9798331535919
DOIs
Publication statusPublished - 1 Jan 2025
Event5th IEEE International Conference on Cyber Security and Resilience, CSR 2025 - Chania, Greece
Duration: 4 Aug 20256 Aug 2025

Publication series

NameProceedings of the 2025 IEEE International Conference on Cyber Security and Resilience, CSR 2025

Conference

Conference5th IEEE International Conference on Cyber Security and Resilience, CSR 2025
Country/TerritoryGreece
CityChania
Period4/08/256/08/25

Keywords

  • Microarchitectural side-channels
  • RISC-V
  • Spectre
  • attacks
  • countermeasures
  • gem5
  • security

Fingerprint

Dive into the research topics of 'SpectreShield: Design and Analysis of Spectre Countermeasures on RISC-V Using gem5'. Together they form a unique fingerprint.

Cite this