论文标题
FastSpec:使用神经嵌入的幽灵小工具的可扩展生成和检测
FastSpec: Scalable Generation and Detection of Spectre Gadgets Using Neural Embeddings
论文作者
论文摘要
已经提出了几种技术来检测广泛部署的商业软件中脆弱的幽灵小工具。不幸的是,到目前为止,提出的检测技术取决于手写规则,这些规则涵盖了已知的幽灵小工具的细微变化,并且需要大量时间来分析软件中的每个条件分支。此外,检测工具评估仅基于这些小工具的少数几个,因为它需要艰苦的努力来手动制作新的小工具。 在这项工作中,我们采用模糊和深度学习技术来自动化幽灵小工具的产生和检测。我们首先通过向已知小工具引入扰动来创建一套各种Spectre-V1小工具。使用突变模糊,我们生产一个具有超过100万个Spectre-V1小工具的数据集,这是迄今为止构建的最大的幽灵小工具数据集。接下来,我们在没有任何人类相互作用的情况下进行了对汇编代码生成的背景下对生成对抗网络(GAN)进行首次经验可用性研究。我们介绍了Spectregan,该Spectregan利用遮盖剂的实现来学习小工具结构和生成新的小工具。这提供了第一个可扩展的解决方案,以扩展各种幽灵小工具。 最后,我们提出了FastSpec,该FastSpec基于新型的高维神经嵌入技术(BERT)来构建与生成的幽灵小工具的分类器。在案例研究中,我们证明了FastSpec在OpenSSL库和Phoronix基准中发现了具有很高成功率的潜在小工具。此外,与现有工具相比,FastSpec提供了更大的灵活性和与时间相关的性能增长,因此可以用于大规模软件中的小工具检测。
Several techniques have been proposed to detect vulnerable Spectre gadgets in widely deployed commercial software. Unfortunately, detection techniques proposed so far rely on hand-written rules which fall short in covering subtle variations of known Spectre gadgets as well as demand a huge amount of time to analyze each conditional branch in software. Moreover, detection tool evaluations are based only on a handful of these gadgets, as it requires arduous effort to craft new gadgets manually. In this work, we employ both fuzzing and deep learning techniques to automate the generation and detection of Spectre gadgets. We first create a diverse set of Spectre-V1 gadgets by introducing perturbations to the known gadgets. Using mutational fuzzing, we produce a data set with more than 1 million Spectre-V1 gadgets which is the largest Spectre gadget data set built to date. Next, we conduct the first empirical usability study of Generative Adversarial Networks (GANs) in the context of assembly code generation without any human interaction. We introduce SpectreGAN which leverages masking implementation of GANs for both learning the gadget structures and generating new gadgets. This provides the first scalable solution to extend the variety of Spectre gadgets. Finally, we propose FastSpec which builds a classifier with the generated Spectre gadgets based on a novel high dimensional Neural Embeddings technique (BERT). For the case studies, we demonstrate that FastSpec discovers potential gadgets with a high success rate in OpenSSL libraries and Phoronix benchmarks. Further, FastSpec offers much greater flexibility and time-related performance gain compared to the existing tools and therefore can be used for gadget detection in large-scale software.