论文标题
安全分支预测变量的轻巧隔离机制
A Lightweight Isolation Mechanism for Secure Branch Predictors
论文作者
论文摘要
最近,暴露的漏洞揭示了提高分支预测因子安全性的必要性。分支预测记录有关执行不同程序的历史记录,以及来自不同过程的此类信息存储在相同的结构中,因此可以彼此访问。这给攻击者带来了恶意训练和恶意感知的机会。我们希望通过使用随机化进行一些轻巧的处理,而不是基于冲洗或物理隔离硬件资源。 (1)内容编码。我们建议使用基于硬件的线程私有随机数来编码我们称为XOR-BP的分支预测表(方向和目标历史记录)的内容。具体而言,数据由XOR操作用键编码,然后在表格中写入表格,并在从表格中读取后进行解码。这种机制混淆了信息,这增加了在交叉过程或跨特威格水平分析和感知方面的困难。它达到了逻辑隔离的类似效果,但在空间或时间开销方面几乎没有增加。 (2)索引编码。我们提出了分支预测因子(噪声-XOR-BP)的随机索引机制。与XOR-BP相似,另一个线程私有的随机数与分支指令地址一起使用,作为计算分支预测器索引的输入。这种随机的索引机制破坏了分支指令地址和分支预测器输入之间的对应关系,从而增加了恶意感知攻击的噪声。我们使用基于FPGA的RISC-V处理器原型和其他辅助模拟进行的分析表明,所提出的机制在提供强大保护的同时产生了很小的性能成本。
Recently exposed vulnerabilities reveal the necessity to improve the security of branch predictors. Branch predictors record history about the execution of different programs, and such information from different processes are stored in the same structure and thus accessible to each other. This leaves the attackers with the opportunities for malicious training and malicious perception. Instead of flush-based or physical isolation of hardware resources, we want to achieve isolation of the content in these hardware tables with some lightweight processing using randomization as follows. (1) Content encoding. We propose to use hardware-based thread-private random numbers to encode the contents of the branch predictor tables (both direction and destination histories) which we call XOR-BP. Specifically, the data is encoded by XOR operation with the key before written in the table and decoded after read from the table. Such a mechanism obfuscates the information adding difficulties to cross-process or cross-privilege level analysis and perception. It achieves a similar effect of logical isolation but adds little in terms of space or time overheads. (2) Index encoding. We propose a randomized index mechanism of the branch predictor (Noisy-XOR-BP). Similar to the XOR-BP, another thread-private random number is used together with the branch instruction address as the input to compute the index of the branch predictor. This randomized indexing mechanism disrupts the correspondence between the branch instruction address and the branch predictor entry, thus increases the noise for malicious perception attacks. Our analyses using an FPGA-based RISC-V processor prototype and additional auxiliary simulations suggest that the proposed mechanisms incur a very small performance cost while providing strong protection.