论文标题
RISC-V二进制文件的通用标记
Generic Tagging for RISC-V Binaries
论文作者
论文摘要
随着RISC-V(开源ISA)的广泛流行,针对特定防御需求的定制硬件安全解决方案正在越来越受欢迎。这些解决方案通常需要专门的编译器,这些编译器可以将元数据(称为标签)插入生成的二进制文件中,和/或使用新指令扩展RISC-V ISA。开发此类编译器可能是一个乏味且耗时的过程。在本文中,我们提出了Cogent,这是RISC-V架构的通用指令标签生成器。 Cogent能够将可配置和不同宽度(1至20位)的标签与每个说明相关联。它还能够发出对于实施控制流完整性(CFI)解决方案的核心的标签。 cogent将所有标签和标签编码为NOP指令,从而提供完整的向后兼容性。 我们评估了Spec CPU2017基准套件的一部分程序的Cogent,并报告二进制规模的增加为29.3%和18.27%,分别为最低和最高标签覆盖率。此外,我们在COTS RISC-V未修改硬件上执行了标记的程序,并发现执行时间开销(相对于向后兼容性)分别为13.4%和5.72%,分别为最低和最高的覆盖率水平。最后,使用案例研究,我们介绍了可以应用凝胶的可能用例情况。
With the widespread popularity of RISC-V -- an open-source ISA -- custom hardware security solutions targeting specific defense needs are gaining popularity. These solutions often require specialized compilers that can insert metadata (called tags) into the generated binaries, and/or extend the RISC-V ISA with new instructions. Developing such compilers can be a tedious and time-consuming process. In this paper, we present COGENT, a generic instruction tag generator for RISC-V architecture. COGENT is capable of associating a tag of configurable and varying widths (1 to 20 bits) to each instruction. It is also capable of emitting labels that are central to the implementation of control-flow integrity (CFI) solutions. COGENT encodes all tags and labels as nop instructions thereby providing full backward compatibility. We evaluate COGENT on a subset of programs from the SPEC CPU2017 benchmark suite and report the binary size increase to be 29.3% and 18.27% for the lowest and highest tag coverage levels respectively. Additionally, we executed tagged programs on COTS RISC-V unmodified hardware and found the execution time overhead (with respect to backward compatibility) to be 13.4% and 5.72% for the lowest and highest coverage levels respectively. Finally, using a case study, we present possible use case scenarios where COGENT can be applied.