Lightweight detection and classification of RISC-V hardware exploits using machine learning techniques
Abstract
This work proposes a hardware-assisted malware detection framework leveraging the HARPY-V-GEM5 dataset for RISC-V architectures. Using the GEM5 full-system simulator, we collect microarchitectural telemetry, specifically Hardware Performance Counters (HPC) and committed instruction mnemonics–from a balanced corpus of 32 benign and malicious applications. Unlike previous approaches relying on complex deep learning models or synthetic data augmentation, we employ a rigorous undersampling strategy to create a balanced dataset of 12,890 execution samples per program, collected at a fine-grained interval of 10,000 instructions. We evaluate supervised learning algorithms, demonstrating that Random Forest (RF) and Decision Tree (DT) classifiers achieve superior efficacy compared to Support Vector Machines (SVM) and Naive Bayes. The results show detection accuracies above 99.5% when using HPC features and 99.0% when using instruction-level features. We further evaluate zero-day resilience, showing that generalization to unseen programs is strongly attack-dependent: while some families remain reliably detectable, others exhibit very low detection rates. These findings indicate that the proposed lightweight models provide partial and selective zero-day robustness, rather than uniform generalization across all attack types.