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.
翻译:RISC-V -- -- 一个开放源码的IRSC-V -- -- 一个开放源码的IRSC-V -- -- 的广受欢迎,针对特定防御需要的定制硬件安全解决方案越来越受欢迎。这些解决方案往往需要专业的编纂者,能够将元数据(所谓的标签)插入生成的二进制版本,和(或)以新的指令扩展RISC-V ISA。开发这类汇编者可能是一个乏味和耗时的过程。在本文中,我们介绍COGENT,一个用于RISC-V架构的通用指导标签生成器。COGENT能够将一个可配置和不同宽度(1至20位)的标签标记与每项指令联系起来。这些解决方案还能够发布对实施控制流完整性解决方案至关重要的标签。 CoGENT将所有标签编码为无源指令,从而提供完全落后的兼容性。 在SPEC CPEC PCUPU2017基准套件中,我们对一组程序进行了评估,并报告最低和最高标签覆盖度(1至20位的宽度(1至20位) 和18.27 %。此外,我们还执行了CO-TRICC-C-D-C-D-D-C-C-D-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-C-