部分x86 CPU存在硬件后门:可绕过内核权限
部分x86 CPU存在硬件后门
project:rosenbridge
项目:rosenbridge
: hardware backdoors in x86 CPUs
:x86 CPU 中的硬件后门
github.com/xoreaxeaxeax/rosenbridge // domas // @xoreaxeaxeax
github.com/xoreaxeaxeax/rosenbridge // domas // @xoreaxeaxeax
Overview
概述
project:rosenbridge reveals a hardware backdoor in some desktop, laptop, and embedded x86 processors.
项目:rosenbridge 揭示了一些台式机、笔记本电脑和嵌入式 x86 处理器中的硬件后门。
The backdoor allows ring 3 (userland) code to circumvent processor protections to freely read and write ring 0 (kernel) data. While the backdoor is typically disabled (requiring ring 0 execution to enable it), we have found that it is enabled by default on some systems.
该后门允许 ring 3(用户态)代码绕过处理器保护,自由读写 ring 0(内核态)数据。虽然该后门通常被禁用(需要 ring 0 执行才能启用),但我们发现它在某些系统上默认启用。
This repository contains utilities to check if your processor is affected, close the backdoor if it is present, and the research and tools used to discover and analyze the backdoor.
此仓库包含用于检查您的处理器是否受影响、如果存在后门则将其关闭的实用程序,以及用于发现和分析该后门的研究和工具。
The Backdoor
后门
The rosenbridge backdoor is a small, non-x86 core embedded alongside the main x86 core in the CPU. It is enabled by a model-specific-register control bit, and then toggled with a launch-instruction. The embedded core is then fed commands, wrapped in a specially formatted x86 instruction. The core executes these commands (which we call the 'deeply embedded instruction set'), bypassing all memory protections and privilege checks.
rosenbridge 后门是一个小型、非 x86 核心,嵌入在 CPU 的主 x86 核心旁边。它通过一个模型特定寄存器控制位启用,然后通过一条启动指令触发。然后,嵌入式核心接收命令,这些命令包装在特殊格式的 x86 指令中。该核心执行这些命令(我们称之为“深度嵌入指令集”),绕过所有内存保护和特权检查。
While the backdoor should require kernel level access to activate, it has been observed to be enabled by default on some systems, allowing any unprivileged code to modify the kernel.
虽然该后门需要内核级访问权限才能激活,但已观察到在某些系统上默认启用,允许任何非特权代码修改内核。
The rosenbridge backdoor is entirely distinct from other publicly known coprocessors on x86 CPUs, such as the Management Engine or Platform Security Processor; it is more deeply embedded than any known coprocessor, having access to not only all of the CPU's memory, but its register file and execution pipeline as well.
rosenbridge 后门与 x86 CPU 上其他公开已知的协处理器(如管理引擎或平台安全处理器)完全不同;它比任何已知协处理器嵌入得更深,不仅能够访问 CPU 的所有内存,还能访问其寄存器文件和执行流水线。
Affected Systems
受影响的系统
It is thought that only VIA C3 CPUs are affected by this issue. The C-series processors are marketed towards industrial automation, point-of-sale, ATM, and healthcare hardware, as well as a variety of consumer desktop and laptop computers.
据认为,只有 VIA C3 CPU 受此问题影响。C 系列处理器面向工业自动化、销售点、ATM 和医疗硬件,以及各种消费类台式机和笔记本电脑。
Looking Forward
展望未来
The scope of this vulnerability is limited; generations of CPUs after the C3 no longer contain this feature.
此漏洞的范围有限;C3 之后的几代 CPU 不再包含此功能。
This work is released as a case study and thought experiment, illustrating how backdoors might arise in increasingly complex processors, and how researchers and end-users might identify such features. The tools and research offered here provide the starting point for ever-deeper processor vulnerability research.
这项工作作为案例研究和思想实验发布,说明了后门如何在日益复杂的处理器中出现,以及研究人员和最终用户如何识别此类功能。这里提供的工具和研究为更深入的处理器漏洞研究提供了起点。
Checking your CPU
检查您的 CPU
To check if your CPU is affected:
要检查您的 CPU 是否受影响:
git clone https://github.com/xoreaxeaxeax/rosenbridge
cd rosenbridge/util
make
sudo modprobe msr
sudo ./bin/checkgit clone https://github.com/xoreaxeaxeax/rosenbridge
cd rosenbridge/util
make
sudo modprobe msr
sudo ./bin/checkThe provided utility must be run on baremetal (not in a virtual-machine), and is in an alpha state. It may crash, panic, or hang systems not containing the backdoor.
所提供的工具必须在裸机(而非虚拟机)上运行,且处于 alpha 状态。它可能会导致不含后门的系统崩溃、死机或挂起。
The utilities provided here are designed around a specific processor family and core; unfortunately, the tools will miss the backdoor if it has been even slightly modified from the researched form.
这里提供的工具是针对特定处理器系列和核心设计的;不幸的是,如果后门与所研究的形态有丝毫差异,这些工具将无法检测到它。
Closing the Backdoor
关闭后门
Some systems have the backdoor enabled by default, allowing unprivileged code to gain kernel level access without permission. If the steps in 'Checking your CPU' indicate that your CPU is vulnerable, you can install a script to close the backdoor early in the boot process:
某些系统默认启用了后门,允许无特权代码未经许可获得内核级访问权限。如果“检查你的 CPU”中的步骤表明你的 CPU 易受攻击,你可以安装一个脚本,在启动过程的早期关闭后门:
cd fix
make
sudo make install
rebootcd fix
make
sudo make install
rebootNote that, even with this, an attacker with kernel level access can still re-enable the backdoor. This script is provided as an outline for correcting the issue during the boot process, but will require adaptation for different systems.
请注意,即使如此,具有内核级访问权限的攻击者仍然可以重新启用后门。此脚本作为在启动过程中纠正问题的概要提供,但需要针对不同系统进行调整。
Tools and Techniques
工具与技术
The sandsifter utility is used extensively in this research for uncovering unknown instructions.
sandsifter 工具在此研究中被广泛用于发现未知指令。
- asm
- An assembler for the Deeply Embedded Instruction Set (DEIS). It converts programs written in the custom rosenbridge assembly into x86 instructions, which, when executed following the launch-instruction, will send the commands to the hidden CPU core.
- esc
- A proof-of-concept of using the rosenbridge backdoor for privilege escalation.
- fix
- A rough outline for closing the vulnerability on affected systems, to the extent possible through model-specific-register updates.
- fuzz
- A collection of utilities used to fuzz both the x86 and rosenbridge cores, in order to isolate the unknown launch-instruction and bridge-instruction, and resolve the instruction format of the rosenbridge core.
- deis
- The fuzzer used to explore the effects and capabilities of the hidden CPU core.
- exit
- It is thought that, on some processors, an exit sequence is needed to switch back to the x86 core at the end of a DEIS sequence. This directory contains the utilities used to search for the exit sequence in early stages of the research, but was abandoned when a processor was found not requiring any such sequence.
- manager
- A collection of python utilities designed to monitor and manage fuzzing tasks distributed across a network of workers.
- wrap
- A stripped down version of the sandsifter fuzzer, used to identify the bridge-instruction that will send commands from the x86 core to the hidden rosenbridge core.
- kern
- A collection of helper utilities used to monitor kernel memory and registers for changes caused by fuzzed DEIS instructions.
- lock
- Utilities to lock or unlock the rosenbridge backdoor.
- proc
- A tool to identify patterns from the fuzzing logs to identify classes of DEIS instruction behaviors.
- test
- A tool used early in the research, to attempt to identify the hidden core's architecture by executing known RISC instructions.
- util
- An alpha-state tool to detect whether or not a processor is affected by rosenbridge.
- asm
- 一种用于深度嵌入式指令集(DEIS)的汇编器。它将用自定义的 rosenbridge 汇编语言编写的程序转换为 x86 指令,这些指令在启动指令之后执行时,会将命令发送到隐藏的 CPU 核心。
- esc
- 一个使用 rosenbridge 后门进行权限提升的概念验证。
- fix
- 一个粗略的概要,用于在受影响的系统上尽可能通过模型特定寄存器更新来关闭漏洞。
- fuzz
- 一组用于模糊测试 x86 和 rosenbridge 核心的工具,以隔离未知的启动指令和桥接指令,并解析 rosenbridge 核心的指令格式。
- deis
- 用于探索隐藏 CPU 核心的效果和能力的模糊测试器。
- exit
- 据认为,在某些处理器上,需要在 DEIS 序列结束时使用退出序列来切换回 x86 核心。此目录包含在早期研究阶段用于搜索退出序列的工具,但在发现某个处理器不需要此类序列后被放弃。
- manager
- 一组 Python 工具,用于监控和管理分布在网络上的工作节点上的模糊测试任务。
- wrap
- sandsifter 模糊测试器的精简版本,用于识别将命令从 x86 核心发送到隐藏的 rosenbridge 核心的桥接指令。
- kern
- 一组辅助工具,用于监控内核内存和寄存器,以检测由模糊测试的DEIS指令引起的变化。
- lock
- 用于锁定或解锁rosenbridge后门的工具。
- proc
- 一种从模糊测试日志中识别模式,以确定DEIS指令行为类别的工具。
- test
- 研究早期使用的一种工具,通过执行已知的RISC指令来尝试识别隐藏核心的架构。
- util
- 一个alpha状态的工具,用于检测处理器是否受到rosenbridge的影响。
References
参考资料
(TODO: link to whitepaper)
(待办:链接到白皮书)
(TODO: link to slides)
(待办:链接到幻灯片)
Disclaimer
免责声明
The details and implications presented in this work are the authors’ inferences and opinions, derived from the research described. The research is performed and provided with the goal of identifying and fixing a perceived security vulnerability on the described CPUs. VIA processors are renowned for their low power usage and excellence in embedded designs; we believe that the functionality described was created in good faith as a useful feature for the embedded market, and was unintentionally left enabled on some early generations of the processor. No malicious intent is implied.
本工作中提出的细节和影响是作者根据所述研究得出的推断和观点。进行并提供这项研究的目的是识别和修复所描述CPU上感知到的安全漏洞。VIA处理器以其低功耗和嵌入式设计的卓越性而闻名;我们相信所描述的功能是出于善意创建的,作为嵌入式市场的一个有用特性,并且无意中在早期几代处理器上保持启用。不暗示任何恶意意图。
Author
作者
project:rosenbridge is a research effort from Christopher Domas (@xoreaxeaxeax).
project:rosenbridge是Christopher Domas(@xoreaxeaxeax)的一项研究工作。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力