TL;DR
ReFuzz is a novel hardware fuzzing framework that breaks the "start-from-scratch" cycle by intelligently reusing tests from previous processor generations. By employing contextual bandits, it learns which historical tests are most effective at different stages of a new design's verification, achieving a staggering 511x average coverage speedup and uncovering five new bugs in popular RISC-V cores.
What Problem Does This Paper Address?
Modern processor design is rarely a "blank slate" process; instead, it relies heavily on iterative modifications and the reuse of well-established modules. However, while design modules are reused, the testing knowledge often isn't.
Current hardware fuzzers—tools that bombard a processor-under-test (PUT) with random or mutated instruction sequences to find bugs—typically treat every new design as a brand-new entity. They fail to leverage the fact that if two processors share a similar architecture or specific modules (like a CSR unit), they likely share similar vulnerabilities. This lack of "generational memory" makes fuzzing inefficient, as tools spend massive amounts of compute time rediscovering known corner cases or failing to find variants of old bugs that have migrated to new designs.
Methods
The authors introduce ReFuzz, which treats test selection as a dynamic optimization problem. Its workflow consists of three main pillars:
- Test Minimization: Prior fuzzing campaigns generate massive amounts of data (e.g., 126,000 tests). ReFuzz uses Integer Linear Programming (ILP) to prune this down to a "greatest hits" collection. It identifies the smallest subset of tests that achieve the same total coverage as the original massive corpus, reducing the test pool by over 98% (down to about 1,500 tests).
- Contextual Bandits (CB): This is the core "intelligence" of the system. In reinforcement learning, a "bandit" algorithm tries to pick the best action (test) to get a reward (coverage increment). ReFuzz uses contextual bandits, where the "context" is the current coverage level of the processor (e.g., is the fuzzer at 50% coverage or 70%?). It learns that a test great for early-stage exploration might be useless for hitting deep corner cases later on.
- Adaptive Learning & Mutation: ReFuzz doesn't just replay old tests; it uses an Adaptive CB algorithm with an elimination function. If a test stops yielding new coverage, it's dropped. Furthermore, it integrates with existing mutation engines (like those in TheHuzz or Cascade) to "tweak" prior tests, allowing it to find new variants of old vulnerabilities.
Datasets
The researchers evaluated ReFuzz using a suite of popular open-source RISC-V processors:
- Training Cores: Rocket Core, BOOMV3, and CVA6.
- Testing Cores (PUTs): BOOMV4 (the next generation of BOOM) and RSD (a 32-bit out-of-order core).
- Baseline Fuzzers: The framework was integrated with and tested against TheHuzz and Cascade, two state-of-the-art hardware fuzzers.
Key Insights and Ideas
- Vulnerabilities are "Inherited": The paper demonstrates that design reuse is a double-edged sword. A bug in a shared module (like the
minstretregister logic) can propagate across three different processor families (Rocket, BOOMV3, BOOMV4). - Context is King: A test's value is not intrinsic; it’s relative to the current state of the fuzzer. By recognizing that "interesting" tests change as coverage increases, ReFuzz avoids the plateau effect common in random fuzzing.
- Efficiency through Sparsity: You don't need a million tests; you need the right thousand. The 98.76% reduction in the test corpus via ILP proves that most fuzzing data is redundant, and identifying the "minimal set" is key to speed.
Key Results
- Massive Speedup: ReFuzz achieved an average 511.23x coverage speedup compared to baseline fuzzers starting from scratch.
- Better Coverage: It didn't just find bugs faster; it found more of them, reaching up to 9.33% higher total coverage than existing tools.
- Real-World Impact: The tool uncovered three new security vulnerabilities and two functional bugs.
- One vulnerability involved a memory deadlock in the RSD processor that could be exploited for a Denial-of-Service (DoS) attack.
- Another bug (B1) showed how an error in the
minstretregister logic was propagated across Rocket Core, BOOMV3, and BOOMV4 due to shared code.
Limitations and Future Work
- ISA Mismatches: The authors noted that training on 64-bit processors and testing on a 32-bit processor (RSD) led to many "illegal instruction" errors, limiting effectiveness. Future versions could benefit from more diverse training sets.
- Scalability of Minimization: While ILP worked for their corpus, applying it to massive industrial-scale test suites (millions of tests) might encounter computational bottlenecks. The authors suggest hierarchical partitioning as a potential fix.
- Cross-ISA Potential: A promising future direction is "translating" tests between different ISAs (e.g., from ARM to RISC-V) to find common microarchitectural flaws that transcend specific instruction sets.
Summary updated