逆向工程x86处理器微码
Reverse Engineering x86 Processor Microcode
摘要:
微码是CPU物理组件之上的抽象层,目前存在于大多数通用CPU中。除了促进复杂和庞大的指令集,它还提供了一种更新机制,允许CPU在不需要任何特殊硬件的情况下就地打补丁。虽然众所周知CPU会定期使用此机制进行更新,但由于微码和更新机制是专有的,因此对其内部工作原理知之甚少,尚未进行彻底分析。本文以AMD的K8和K10微体系结构为例,对传统COTS CPU的微码语义及其更新机制的内部工作原理进行了逆向工程。此外,我们还演示了如何开发自定义微码更新。我们描述的微码语义,并另外提出了一组微程序,证明了这种技术所提供的可能性。为此,我们的微程序范围从CPU辅助检测到微编码木马,甚至可以从Web浏览器中访问,并实现远程代码执行和加密实现攻击。
英文摘要:
Microcode is an abstraction layer on top of the physical components of a CPU and present in most general-purpose CPUs today. In addition to facilitate complex and vast instruction sets, it also provides an update mechanism that allows CPUs to be patched in-place without requiring any special hardware. While it is well-known that CPUs are regularly updated with this mechanism, very little is known about its inner workings given that microcode and the update mechanism are proprietary and have not been throughly analyzed yet. In this paper, we reverse engineer the microcode semantics and inner workings of its update mechanism of conventional COTS CPUs on the example of AMD's K8 and K10 microarchitectures. Furthermore, we demonstrate how to develop custom microcode updates. We describe the microcode semantics and additionally present a set of microprograms that demonstrate the possibilities offered by this technology. To this end, our microprograms range from CPU-assisted instrumentation to microcoded Trojans that can even be reached from within a web browser and enable remote code execution and cryptographic implementation attacks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。