This paper provides the first analysis on the feasibility of Return-Oriented Programming (ROP) on RISC-V, a new instruction set architecture targeting embedded systems. We show the existence of a new class of gadgets, using several Linear Code Sequences And Jumps (LCSAJ), undetected by current Galileo-based ROP gadget searching tools. We argue that this class of gadgets is rich enough on RISC-V to mount complex ROP attacks, bypassing traditional mitigation like DEP, ASLR, stack canaries, G-Free, as well as some compiler-based backward-edge CFI, by jumping over any guard inserted by a compiler to protect indirect jump instructions. We provide examples of such gadgets, as well as a proof-of-concept ROP chain, using C code injection to leverage a privilege escalation attack on two standard Linux operating systems. Additionally, we discuss some of the required mitigations to prevent such attacks and provide a new ROP gadget finder algorithm that handles this new class of gadgets.
翻译:本文首次分析了RISC-V(一个针对嵌入系统的新的指令设置架构)回归导向程序(ROP)的可行性。 我们用多个线性代码序列和跳跃(LCSAJ)来显示新一类的装置的存在, 目前以伽利略为基础的 ROP 工具无法检测到这些装置。 我们争论说, 该类装置在RISC-V上足够丰富,足以发动复杂的ROP攻击,绕过传统的缓解方法,如DEP、ASLR、堆叠罐、G-Free以及一些基于编译器的后方CFI, 跳过编译器插入的任何保护间接跳跃指令的卫兵。 我们提供了这些装置的例子,以及概念ROP链的校准。 我们用C码注入来利用两个标准的Linux操作系统进行特权升级攻击。 此外,我们讨论了一些必要的缓解方法,以防止这类攻击,并提供新的ROP 工具包的算法。