Replace Your Exploit-Ridden Firmware with Linux - Ronald Minnich, Google

Replace Your Exploit-Ridden Firmware with Linux - Ronald Minnich, Google — The Linux Foundation

The Linux Foundation

AI-assisted summary of Replace Your Exploit-Ridden Firmware with Linux - Ronald Minnich, Google — original source. Check the original for full context.

Source published:

Key ideas

  • Google developed NERF (Non-Extensible Reduced Firmware) to replace bloated UEFI runtimes and Driver Execution Environment (DXE) modules with a compact Linux kernel and Go-based initramfs, dropping boot times on Open Compute Project server nodes from eight minutes to twenty seconds. (0:00)
  • Modern x86 hardware runs multiple hidden operating systems below Ring 0—including Minix 3 on the Intel Management Engine (Ring -3) and UEFI/SMM (Ring -2)—operating duplicate IP stacks, disk drivers, and web servers that persist across hard drive wipes. (1:46)
  • By deploying the `me_cleaner` script to strip unsigned partitions down to the signed BringUP (BUP) module and toggling Intel's High Assurance Platform (HAP) bit, researchers can neutralize Management Engine network bloat without tripping the hardware 30-minute watchdog shutdown. (13:09)
  • The project pairs Linux with u-root, an initramfs written in Go that compiles utilities on demand in roughly 200 ms or bundles an entire userland into a sub-2 MB BusyBox-style binary, bypassing standard bash-scripting overhead and legacy EFI signature models. (23:23)

Detailed notes

## Background Published by The Linux Foundation on YouTube on October 27, 2017, this presentation features Google software engineer Ronald Minnich discussing the security vulnerabilities exposed by proprietary UEFI firmware following the Vault 7 disclosures. The session details NERF (Non-Extensible Reduced Firmware), an open-source initiative developed at Google that replaces vulnerable UEFI runtime environments with a minimal Linux kernel and a Go-based u-root initramfs.

## TL;DR Ronald Minnich outlines how modern x86 platforms harbor hidden, proprietary operating systems beneath Ring 0—specifically UEFI in Ring -2 and the Intel Management Engine running Minix 3 in Ring -3—that pose severe persistence and exploit risks. To eliminate this attack surface, Google's NERF architecture trims the Management Engine with tools like me_cleaner, neutralizes or redirects System Management Mode (SMM), and halts the UEFI boot process immediately after early hardware initialization. NERF replaces the bloated Driver Execution Environment (DXE) and boot manager with a battle-tested Linux kernel and a memory-safe Go userland (u-root), reducing server boot times from eight minutes to twenty seconds while establishing platform auditability where coreboot is blocked.

## Atmosphere & style The presentation carries a blend of dry hacker humor and genuine technical alarm, punctuated by Minnich's wry one-liners like proclaiming it 'the year of Minix on the desktop' due to ubiquitous Intel ME chips. Speaking candidly against harsh stage lights, Minnich shares battle-tested engineering war stories from Los Alamos to Chromebooks, treating the audience of systems programmers as peers who know the pains of low-level firmware all too well. The energy shifts seamlessly from sobering revelations about unpatchable hardware cloaking mechanisms to an empowering, pragmatic showcase of reclaiming control over physical machines using Linux and Go.

## Bulletin - [00:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=0s) Google developed NERF (Non-Extensible Reduced Firmware) to replace bloated UEFI runtimes and Driver Execution Environment (DXE) modules with a compact Linux kernel and Go-based initramfs, dropping boot times on Open Compute Project server nodes from eight minutes to twenty seconds. - [01:46](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=106s) Modern x86 hardware runs multiple hidden operating systems below Ring 0—including Minix 3 on the Intel Management Engine (Ring -3) and UEFI/SMM (Ring -2)—operating duplicate IP stacks, disk drivers, and web servers that persist across hard drive wipes. - [13:09](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=789s) By deploying the `me_cleaner` script to strip unsigned partitions down to the signed BringUP (BUP) module and toggling Intel's High Assurance Platform (HAP) bit, researchers can neutralize Management Engine network bloat without tripping the hardware 30-minute watchdog shutdown. - [23:23](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1403s) The project pairs Linux with u-root, an initramfs written in Go that compiles utilities on demand in roughly 200 ms or bundles an entire userland into a sub-2 MB BusyBox-style binary, bypassing standard bash-scripting overhead and legacy EFI signature models.

## Key takeaways - [01:34](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=94s) Modern x86 systems undermine host OS sovereignty by running at least two and a half full proprietary kernels beneath Ring 0 in Ring -1, Ring -2, and Ring -3. - [02:10](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=130s) Compromised firmware achieves deep flash persistence that hard drive reformatting cannot resolve, leaving physical destruction in a shredder as the ultimate remediation. - [02:46](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=166s) The Intel Management Engine (ME) runs Minix 3 alongside co-processors like the Integrated Sensor Hub, maintaining out-of-band networking and disk control even when the machine is powered off. - [04:57](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=297s) Decades of software bloat inside the Management Engine—such as Small Business Technology and remote-management servers—have exposed machines to zero-length password vulnerabilities and millions of unpatched flaws. - [06:26](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=386s) System Management Mode (SMM) acts as a hardware cloaking device that locks away physical RAM and executes unstoppable 16-bit code outside OS visibility. - [07:59](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=479s) UEFI self-update capsules are fundamentally flawed because an entrenched in-flash exploit can simply intercept updates, report success, and maintain persistence. - [09:48](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=588s) AMD architectures do not escape closed firmware risks because Ryzen relies on the proprietary Platform Security Processor (PSP) for mandatory DRAM training. - [11:13](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=673s) NERF treats firmware extensibility as harmful, seeking to strip all post-boot runtime components from UEFI and the Management Engine. - [13:09](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=789s) Excising the Intel ME completely triggers a hardcoded 30-minute watchdog shutdown, but `me_cleaner` bypasses this by shrinking ME firmware from 5 MB down to ~300 KB by preserving only the signed BUP module. - [15:40](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=940s) Production deployments across over 100,000 Linux Networx servers historically proved that x86 hardware operates reliably with SMM completely disabled. - [17:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1020s) Because vendors keep Pre-EFI Initialization (PEI) proprietary, NERF targets the well-defined boundary between PEI and the Driver Execution Environment (DXE), directly replacing DXE and boot managers with Linux. - [23:23](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1403s) The u-root Go userland provides memory-safe system utilities in either an on-demand dynamic compilation mode (5.9 MB) or an AST-multiplexed single binary under 2 MB. - [26:49](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1609s) Unlike standard PCs using UEFI Secure Boot signature hierarchies, NERF looks toward hardware root-of-trust models anchored in the TPM similar to ChromeOS and Heads. - [28:24](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1704s) Coreboot has struggled on modern server platforms for 12 years due to locked Intel QuickPath Interconnect (QPI) specifications, making NERF a practical alternative for enterprise hardware. - [29:20](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1760s) Silicon initialization requires microcode patches to execute billions of instructions during DRAM training, making early microcode loading an unavoidable hardware dependency. - [29:52](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1792s) Replacing UEFI with Linux relies on a battle-tested kernel and compiler validated 24/7 across millions of production nodes, mirroring production strategies like IBM POWER9 firmware. - [35:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=2100s) Modern Intel architectures (Skylake and later) transitioned the ME to an x86 core running Minix 3, which can be disabled post-bringup using the High Assurance Platform (HAP) bit.

## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=0s) Introduction and Dramatic Boot-Time Reductions

Squinting against the stage lighting, Ronald Minnich opens by introducing his work at Google and clarifying a common misconception. For over a decade, whenever he discussed firmware, audiences reflexively assumed he was wearing his coreboot hat. He emphasizes immediately that this talk is entirely different: “I am not wearing my coreboot hat today; this is very much not a coreboot talk.” He acknowledges collaborators in the audience and across industry partners, including Jean-Marie Verdun, Guillaume, several Google teammates, Trammell Hudson from Two Sigma, and Andrey Mirtchovski at Cisco, who assisted extensively with the Go programming language components.

Minnich dives straight into the operational results, highlighting an Open Compute Project (OCP) Facebook compute node on display in their booth. By substituting standard proprietary firmware with their new architecture, the team slashed the machine's boot time from an agonizing eight minutes down to just twenty seconds. Yet Minnich downplays this dramatic metric, noting that to his way of thinking, the speedup is perhaps the single least important outcome. The real transformation lies in security, reliability, and architectural control: placing a Linux kernel and an initramfs directly inside motherboard flash, with an entirely Go-based userland (including init). This replaces legacy firmware with trusted open-source code and strips away all post-boot activities normally carried out by UEFI and Intel's Management Engine.

- **OCP node benchmark:** Boot time plummeted from 8 minutes down to 20 seconds. - **Embedded stack components:** A compact Linux kernel and initramfs stored directly in motherboard flash memory. - **Userland architecture:** Entire userland, including `init`, written purely in Go. - **Key objective:** Total elimination of post-boot UEFI runtime services and Management Engine interference.

[01:34](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=94s) The Hidden Operating Systems Beneath Ring 0

Reflecting on the early days of Linux in the 1990s, Minnich recalls when the kernel held absolute authority over classic Intel x86 hardware (like the Pentium/586). That sovereignty has vanished. Modern x86 architecture inserts at least two and a half full, proprietary operating system kernels underneath Linux. Because these subterranean systems operate at higher privilege levels than ring 0, they can arbitrarily manipulate, spy on, or control the host operating system. Minnich observes that their closed, proprietary design makes them extraordinarily exploit-friendly.

Worst of all, compromises within these lower rings achieve deep persistence. Unlike standard disk-based malware that can be eliminated simply by wiping or reformatting a hard drive, exploits targeting these low-level environments write directly to the motherboard flash. Once entrenched, an attacker cannot be easily dislodged, leaving system owners with catastrophic remediation costs. Minnich recalls an older presentation title that sums up the grim reality: “I used to give this talk and the title was 'If you trust your computer, you're crazy.'” When firmware becomes compromised beyond recovery, “maybe one of your options is you shred your motherboard because there's just no other way out of the problem.”

```mermaid flowchart TD accTitle: The Privilege Ring Hierarchy of Modern x86 Systems accDescr: Diagram illustrating the modern privilege architecture from user space down to the Intel Management Engine in Ring -3.

subgraph OS["Visible Operating Space"] R3["Ring 3: User Applications"] R0["Ring 0: Linux / Host OS Kernel"] R3 --> R0 end

subgraph Hyp["Virtualization Layer"] RMinus1["Ring -1: Hypervisor (KVM, Xen, ESXi)"] R0 --> RMinus1 end

subgraph Hidden["Hidden Firmware Layers"] RMinus2["Ring -2: SMM (System Management Mode) & UEFI Kernel"] RMinus3["Ring -3: Intel Management Engine (Minix 3 on ARC / x86)"] RMinus1 --> RMinus2 RMinus2 --> RMinus3 end ```

- **Ring 0 vs. lower rings:** Linux runs in ring 0, but ring -1 (hypervisors), ring -2 (SMM/UEFI), and ring -3 (Management Engine) hold superior system authority. - **Disk vs. flash persistence:** Disk formatting cannot remediate flash-resident firmware compromises. - **Ultimate recovery option:** Physical destruction of the motherboard in a shredder.

[02:46](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=166s) The Subterranean Hierarchy: SMM, UEFI, and Minix 3 in Ring -3

Minnich unpacks the confusing terminology of the lower rings, noting that as engineers added layers behind traditional rings, they simply ran out of numbers and adopted negative designations. Ring -2 consists of a full UEFI kernel running in 64-bit page mode alongside what Minnich categorizes as a "half kernel": System Management Mode (SMM). SMM is an ancient execution environment that halts all normal OS operations and drops the main processor into real-mode-like 16-bit 8086 code whenever triggered (such as when closing a laptop lid), completely bypassing Linux memory protections.

Deeper still sits Ring -3, the zone generating the deepest panic in modern security circles. Die-level integration on Intel platforms regularly includes three separate auxiliary microcontrollers: the Integrated Sensor Hub, the Innovation Engine (“I just every time I say that I kind of have to laugh a little”), and the Intel Management Engine (ME). The ME runs Minix 3, giving rise to Minnich's dry running joke: “and that's why this is the year of Minix on the desktop because if you add up all the nodes running Windows and all the nodes running Linux that's less than all the nodes running Minix 3.” Ring -2 and Ring -3 operate duplicate, uncoordinated implementations of complete software stacks, including distinct IP networking stacks, file systems, disk drivers, and full USB mouse/keyboard drivers. The ME possesses independent file systems and network capabilities specifically so it can reach across the network and silently re-image a workstation while it sits powered down, so long as the power cord and Ethernet cable remain attached.

- **Sub-core hardware:** Intel silicon often includes three co-processors running alongside the main x86 cores (Management Engine, Integrated Sensor Hub, Innovation Engine). - **Embedded OS deployment:** Intel ME runs the Minix 3 operating system across hundreds of millions of manufactured chipsets. - **Duplicate stacks:** Ring -2 and Ring -3 run independent networking, USB, and file system stacks completely invisible to Linux. - **Out-of-band power:** ME maintains network connectivity and disk control even when the host system is powered off.

[04:57](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=297s) The Threat Landscape: ME Bloat and Decades of Vulnerabilities

Minnich reviews the bizarre assortment of software modules bundled inside the Management Engine binary blob. These include distinct flavors of network manageability, Small Business Technology, the "Outbreak Containment Heuristic" (a moniker that Minnich quips sounds like a Hollywood thriller), and the Protected Audio Video Path (PAVP), which provides hardware-enforced DRM. Regarding Small Business Technology, Minnich notes that its original implementation ten years earlier sidestepped credential setup entirely: “what Small Business Technology meant originally about 10 years ago is it's really inconvenient to set up passwords, so we just don't have a password for the ME.”

This software bloat produces catastrophic vulnerabilities. Minnich cites Vasilis Pappas's comprehensive master's thesis written a decade earlier that documented widespread, systemic vulnerabilities across ME modules, many of which lingered unfixed. More recently, Intel had to patch an egregious remote-access flaw that permitted unauthenticated administrative control via a zero-length password string sent to the ME's internal web server. A basic search for "Intel ME exploit" surfaces over 50 million results, with Minnich pointing to a *Wired* headline reporting that Intel had finally resolved an issue that persisted unpatched for seven years. Affecting up to a billion machines, the nominal vendor remediation is simply telling consumers to update their firmware. Minnich expresses total disbelief that any meaningful fraction of that hardware has actually received updates: “How many people want to believe that a billion machines have been refreshed since last spring with new firmware to fix this bug? I certainly don't believe it.”

- **Unauthenticated access:** Multiple ME iterations allowed full out-of-band administrative takeover using null or zero-length passwords. - **Legacy bloat:** Includes enterprise and small-business management utilities, DRM paths (PAVP), and mysterious outbreak heuristics. - **Industry patch rates:** Despite impacting an estimated billion devices worldwide, practical firmware patch rates among end-users and data centers remain negligible.

[06:26](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=386s) System Management Mode (SMM) as a Hardware Cloaking Device

Turning his attention to the "half OS" in Ring -2, Minnich explains that System Management Mode originated with Intel 486-era laptops to handle basic hardware power management. When a user running MS-DOS shut their laptop lid, the operating system had no native power-management logic to put the machine to sleep; engineers created SMM to seize control of the machine behind the OS's back using System Management Interrupts (SMIs). Over time, vendors exploited this mechanism for all manner of silent background tasks, such as injecting transparent USB mouse emulation into older operating systems lacking native USB stacks.

The fatal architectural flaw of SMM is its irreversibility and opacity. Once enabled during the initial boot sequence, the platform sets a hardware configuration bit (such as SMRAM lock) that permanently walls off a large chunk of physical memory, rendering it completely invisible and inaccessible to Ring 0. Minnich describes this hidden RAM segment as an unstoppable hardware cloaking device: “so it kind of it's a cloaking device, right? It just vanishes this memory with its stuff in it, so you kind of can't really know what it's going to do, you can't disable it, you can't turn it off, and it's hidden.” Because software running in Ring 0 cannot audit, modify, or terminate code running in SMM, hardware vendors retain permanent, unaccountable control over the execution state of the processor.

- **Origin:** Introduced on the Intel 486 to provide OS-agnostic power management for primitive environments like MS-DOS. - **Trigger mechanism:** System Management Interrupts (SMIs) suspend host CPU execution instantly. - **Cloaked memory (SMRAM):** Hardware locking bits render the SMM RAM region invisible to ring 0 Linux and host introspection tools. - **Unstoppable execution:** Once initialized at boot, SMM cannot be switched off or audited by the host operating system.

[07:59](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=479s) The Complexity and Unpatchable Trap of UEFI

Minnich addresses the other half of Ring -2: the Unified Extensible Firmware Interface (UEFI) environment executing on the main CPU. UEFI represents an immense, highly complex operating system kernel. Firmware engineers working for board manufacturers and third-party vendors are tasked with writing drivers against this arcane framework without fully understanding its labyrinthine architectural rules, inevitably introducing severe security flaws: “and the result is that there are big giant holes that people can drive exploits through.” When surveying the conference room, Minnich asks how many attendees have authored UEFI code. Seeing a substantial show of hands, he asks if they enjoyed the experience; reading their faces, he chuckles, “Okay, so I never liked it personally.”

The foundational security failure of UEFI centers on its flawed self-update paradigm. The design operates on the naïve assumption that the firmware environment is completely trustworthy and intelligent enough to safely update itself: a host kernel drops an update payload into RAM, trips a notification, and expects UEFI to parse and flash the new code bug-free. Minnich points out that if a machine has already been compromised by an in-flash UEFI rootkit, requesting an update accomplishes nothing. The malicious UEFI binary merely returns success while preserving the exploit intact in flash: “so the worry has been that you can make an exploit that can't ever be removed and again the only remediation is a shredder.” Examining the component manifest of even a stripped-down OCP compute node reveals a sprawling attack surface loaded with redundant IP stacks, USB stacks, and obsolete legacy drivers like ISA bus support that have no place in a modern production server.

| UEFI Component Category | Embedded Implementation | Architectural Risk Identified by Minnich | |:--- |:--- |:--- | | **Network Protocols** | Dual IPv4 and IPv6 stacks | Unaudited, network-facing attack surface executing before and underneath the operating system. | | **Bus Drivers** | Legacy ISA bus support | Superfluous legacy code shipped by default on modern data-center compute nodes. | | **I/O Protocols** | Proprietary USB stack | Independent peripheral parsing running with root-level privileges; vulnerability to malicious USB payloads. | | **Self-Update Framework** | In-band capsule / runtime flash updater | Once compromised, rogue firmware can intercept update hooks, report success, and persist forever. |

[09:48](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=588s) The Threat of Hidden OSs and the Myth of AMD Safety

Firmware environments like UEFI are bloated with primitive drivers—legacy IDE support, polling I/O routines, and artificial delays—which Minnich points to as the primary reason machines boot so terribly slowly. Compounding the latency, modern systems harbor roughly "two and a half hidden OSs" running beneath the user's control. These hidden layers possess independent network stacks, embedded web servers, and self-modifying code that survives power cycles and operating system reinstalls. They are prone to security bugs, have full visibility into the running OS, and have already been subject to documented real-world exploits. In earlier versions of his presentation, Minnich would conclude right here with a stark warning: “If you're not scared yet maybe I didn't explain it very well because I sure am scared.”

```mermaid flowchart TD accTitle: Two and a Half Hidden Operating Systems accDescr: Diagram illustrating hidden firmware layers that control and persist beneath the main operating system. subgraph Host ["Visible Host System"] OS["Linux / User OS"] end

subgraph Hidden ["Hidden Firmware Layers"] SMM["Ring -2: System Management Mode (SMM)"] ME["Ring -3: Intel Management Engine (ME) / Minix 3"] UEFI["UEFI Runtime / Driver Execution Environment"] end

ME -->|"Controls clocks, reset vector, DRAM"| Host SMM -->|"Traps execution, inspects memory"| OS UEFI -->|"Persists across reboots, runs alongside OS"| OS ```

When addressing how to remedy this architecture, Minnich refutes the common community belief that switching to AMD hardware solves the problem. While AMD was more open in past eras, modern architectures like Ryzen cannot simply be dropped in as an open alternative. AMD moved the obscure, sensitive initialization tasks formerly in EFI over to the Platform Security Processor (PSP). It is the PSP—not the main x86 CPU—that initializes DRAM, and AMD will never release the proprietary PSP code required for that memory training. While AMD might offer open interfaces in certain areas, Minnich summarizes the reality bluntly: “Kind of AMD is more open in the things that are open, but it's not open in a sense of things closed on Intel are still things closed on AMD if that makes any sense.”

- UEFI contains archaic, polling-driven drivers full of hardcoded delays that severely degrade boot performance. - Hidden firmware operating systems run independent IP stacks, host web servers, and persist malicious code across drive wipes and power cycles. - AMD Ryzen systems rely on the proprietary Platform Security Processor (PSP) to bring up DRAM, keeping key boot stages completely closed.

---

[11:13](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=673s) Introducing NERF: Non-Extensible Reduced Firmware

Focusing primarily on Intel x86 due to personal use and server ubiquity—while noting the concepts transfer over to AMD architectures outside of the Management Engine—Minnich introduces the NERF project. While UEFI stands for Unified Extensible Firmware Interface, Minnich and his team hold that extensibility in firmware is an active hazard: “We consider extensibility harmful, so NERF stands for Non-Extensible Reduced Firmware.” The mission of NERF is to severely reduce the attack surface of firmware, strip out runtime components from both the Intel Management Engine (ME) and UEFI, eliminate network stacks and web servers, and completely revoke firmware's ability to reflash itself.

Firmware flashing should be mediated by the primary operating system, exactly as proven by Google's Chromebook ecosystem. With upwards of 30 million Chromebooks in active use, firmware updates are applied directly by Linux itself, eliminating the machine-bricking bugs historically seen when UEFI handled flash routines. The architectural blueprint of NERF comprises four distinct layers: a de-blobbed Intel ME ROM, a UEFI ROM stripped to its bare initialization minimums, the elimination or vectoring of System Management Mode (SMM) into Linux, a tiny Linux boot kernel, and a lightweight userland written in Go. Minnich invites Go developers to contribute, highlighting that participating in NERF does not strictly require deep firmware or kernel expertise due to the substantial Go-based userland effort.

- **NERF definition:** Non-Extensible Reduced Firmware, designed to eliminate hidden runtimes and firmware attack surfaces. - **Flashing safety:** Proves firmware should be written by Linux; Chromebooks deploy Linux-managed bios reflashing across 30+ million devices without UEFI-style bricking incidents. - **Four core pillars:** 1. De-blobbed Intel ME ROM image. 2. Minimalist UEFI hardware-init foundation. 3. SMM disabled or trapped directly to the Linux kernel. 4. Linux kernel paired with a Go userland (u-root).

---

[13:09](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=789s) Taming the Intel Management Engine with `me_cleaner`

Eliminating the Intel Management Engine entirely is an engineering impossibility because it is hardwired into the silicon die. When system power is applied, the ME engine powers on first, starts the hardware clocks, and supplies the reset vector to the main x86 CPU. If an administrator deletes the ME firmware wholesale, the board will refuse to boot or will shut down after exactly 30 minutes—a watchdog timeout triggered by the ME when it detects its firmware is broken and assumes it has granted a recovery window. However, investigative work sparked by Trammell Hudson and later expanded by Nicola Corna with the Python utility `me_cleaner` cracked the firmware structure open.

On compact platforms like the $159 MinnowBoard MAX, the onboard 8 MB SPI flash allocates 5 MB exclusively to the Intel ME. Running `me_cleaner` against this image strips that 5 MB footprint down to a mere 300 KB, removing the internal web servers and networking code while retaining just enough initialization logic to start clocks and boot Linux. Minnich cautions that server platforms present unique hurdles; running `me_cleaner` on Open Compute Project (OCP) server nodes breaks boot. Analyzing the partitions reveals that while the MinnowBoard only needs a single partition (such as `BUP`, the boot-up kernel likely running Minix 3 alongside partitions like `POLICY`, `RSA`, and `FPM`), OCP server firmware contains duplicate `BUP` modules where `me_cleaner` strips critical dependencies after the initial boot stage.

```mermaid flowchart LR accTitle: me_cleaner Flash Footprint Reduction accDescr: Visual comparison showing how me_cleaner reduces a 5MB ME partition down to 300KB on a MinnowBoard MAX. subgraph Original ["Original 8MB SPI Flash"] A["Intel ME Firmware: 5.0 MB (Web server, IP stack, BUP, RSA)"] B["UEFI / Host Code: 3.0 MB"] end

subgraph Cleaned ["Cleaned Flash via me_cleaner"] C["Minimal ME (BUP): ~300 KB"] D["Freed Flash Space: ~4.7 MB"] E["UEFI / NERF Payload: 3.0 MB"] end

Original -->|"me_cleaner processing"| Cleaned ```

- Completely excising ME bricks the platform or triggers an unskippable 30-minute hardware watchdog power-down. - On the MinnowBoard MAX, `me_cleaner` slashes Intel ME firmware from 5 MB down to ~300 KB. - Cleans out known high-risk zero-day targets including the ME's internal RSA routines and networking implementations. - OCP server boards fail to boot under current `me_cleaner` logic due to multi-stage `BUP` modules, marking an ongoing engineering focus.

---

[15:40](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=940s) Defeating System Management Mode (SMM)

System Management Mode (SMM) is another privileged execution ring that Minnich targets for neutralization. If a replacement operating system enters execution early enough in the boot flow, it can disable SMM locks entirely. Countering vendor claims about SMM's absolute necessity, Minnich recalls running high-performance clusters without SMM decades ago during the LinuxBIOS era at Los Alamos National Laboratory: “We had a nice conversation once with an x86 vendor who claimed that it was impossible to run a server node with SMM turned off, and we said, 'Well, you'll have to talk to Linux Networx about their 100,000 servers they've sold with SMM turned off and explain to them that it can't work, but it's working fine for us too.'”

Vendors primarily utilize SMM to implement proprietary "value-add" features that effectively enforce vendor lock-in. For edge cases where a motherboard truly depends on SMM—such as specific hardware error handling like Single Error Correction / Double Error Detection (SECDED) interrupts—Minnich built alternative hooks to redirect the System Management Interrupt (SMI) directly into the Linux kernel. Rather than disappearing into opaque, chipset-level black-box code, SMIs can be handled like standard hardware interrupts directly inside Linux, ensuring that the primary kernel maintains absolute authority over the machine.

- SMM is not mandatory for stable x86 server operations, as proven by 100,000+ Linux Networx production cluster nodes. - Vendor defenses of SMM often boil down to proprietary differentiators and hardware lock-in mechanisms. - NERF either disables SMM completely during early handoff or vectors SMIs into standard Linux kernel interrupt handlers.

---

[17:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1020s) Replacing the UEFI Driver Execution Environment (DXE) with Linux

UEFI is so vast and intricate that its codebase forms a substantial operating system in its own right, loaded with curious artifacts (including internal sensors humorously mislabeled as a "digital thermometer"). Under a standard boot flow, UEFI executes a proprietary Security (SEC) and Pre-EFI Initialization (PEI) phase in 16-bit mode to train the CPU, chipsets, and motherboard. Minnich acknowledges that vendors guard this early phase tightly and will not open it. However, the interface between PEI and the next stage—the Driver Execution Environment (DXE)—is rigorously defined and uniformly implemented across the industry.

```mermaid flowchart TD accTitle: Standard UEFI vs. NERF Boot Execution Flow accDescr: Comparison of standard UEFI DXE phase loading OS-present runtime versus NERF swapping the boot manager for Linux. subgraph EarlyPhase ["Proprietary Hardware Bring-Up"] SEC["Security (SEC) Phase: 16-bit entry"] --> PEI["Pre-EFI Initialization (PEI): CPU/Chipset/Board Init"] end

subgraph StandardDXE ["Standard UEFI Architecture"] PEI -->|"Well-Defined Interface"| DXE["DXE Drivers (Network, Storage, IDE)"] DXE --> BM["Boot Manager (e.g., GRUB / Windows Loader)"] BM --> OS1["Target OS (Linux / Windows)"] DXE -.->|"Persists in background"| Runtime["UEFI OS-Present Runtime (Ring -2)"] end

subgraph NERFDXE ["NERF Architecture"] PEI -->|"Same Well-Defined Interface"| LinuxKernel["Linux Kernel + u-root (Go Initramfs)"] LinuxKernel -->|"Replaces DXE, Boot Manager & Runtime"| FinalOS["Kexec to Final Target OS"] end ```

In standard UEFI, the PEI phase hands off to numerous DXE drivers (network stacks, disk drivers, display protocols) that loop back and forth until the Boot Manager (such as GRUB) is invoked. Critically, standard UEFI retains an active runtime payload that lingers in memory alongside the operating system—a permanent Ring -2 hypervisor that Minnich rejects: “When Linux is running, EFI is running, and that's the thing we don't like; that's the thing we're trying to get rid of.” Because the DXE boot manager matches a clearly documented specification, NERF exploits this exact seam: it compiles an actual Linux kernel to match that well-defined handoff interface, strips out the DXE drivers and boot managers, and replaces the BIOS payload directly with Linux.

- UEFI contains a kernel codebase that rivals the Linux kernel in volume and complexity. - Early initialization (SEC and PEI phases) remains locked behind vendor NDAs, but exposes a strict, clean handoff into DXE. - Standard UEFI DXEs launch an "OS-present runtime" that continues executing concurrently with Linux post-boot. - NERF replaces the entire DXE driver loop and boot manager with a tailor-made Linux kernel that boots directly from the PEI interface.

[19:46](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1186s) Slashing Boot Times and Transitioning from UEFI to Linux

Most users recognize the conventional PC boot process by the familiar configuration screen prompting for boot device selection and system time. In NERF, that entire phase is superseded by launching directly into a Linux kernel. On the test node Ron Minnich evaluated, this transition takes roughly 20 seconds—a figure re-timed just the day prior—replacing vendor boot cycles that previously dragged on for eight minutes. Once inside the Linux kernel, system initialization drops into a Go-based user space. Its default sequence executes `dhclient`, retrieves the target kernel image via `wget`, and immediately executes `kexec`. This entire userland network boot cycle takes roughly three seconds over a 100-megabit connection linked to a Raspberry Pi.

```mermaid flowchart TD accTitle: NERF Boot Flow from Hardware Initialization to Final OS accDescr: Flowchart illustrating the early Pei and Dxe core initialization leading directly into a small Linux kernel and Go userland before kexec.

subgraph EarlyStage["Early Firmware (PEI Core)"] A["Hardware Init & Memory Training"] B["Basic Silicon Init"] A --> B end

subgraph NERFStage["NERF Execution"] C["Cut off DXE Drivers & UEFI Runtime"] D["Boot Tiny Linux Kernel (20s)"] E["u-root Initramfs (Go Userspace)"] F["Run dhclient & wget Kernel (~3s)"] B --> C C --> D D --> E E --> F end

subgraph TargetOS["Operating System"] G["kexec into Production Kernel"] F --> G end ```

Minnich explains that pressure and feedback from Trammell Hudson substantially altered the direction of his presentation compared to just a week earlier. Hudson pointed out that parts of the DXE core exist in open-source form and could be swapped out directly. Consequently, the team decided to adopt an open-source DXE replacement, lightly modified to initialize hardware and jump into Linux even faster, aiming to reduce the 20-second setup down to a fraction of that duration. While acknowledging that early initialization stages like PEI (Pre-EFI Initialization) cannot be rewritten—just as modern coreboot on Chromebooks still requires proprietary binary blobs—Minnich emphasizes drawing the line directly across the DXE core:

> “So as I said we can fix this problem partially, but partial is better than nothing and we can get rid of all the runtime components that come with EFI and that’s really the goal.”

[21:36](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1296s) Automating Firmware Builds with Heads and Generic Board Support

To make firmware construction manageable across varied hardware, NERF adopts automation concepts developed by Hudson for the Heads project. Hudson engineered a series of Makefiles and scripts that automate image creation, which NERF leverages to assemble customized images for specific motherboards. The team has already validated this build framework with positive results across hardware platforms ranging from small MinnowBoards (referred to as Minimax) and Dell PowerEdge R630 servers to large Open Compute Project (OCP) server nodes.

Working at the Linux layer also mitigates the chronic hardware fragmentation that plagues low-level firmware engineering. Minnich recalls working on five successive board revisions from a single AMD vendor where every iteration used a different GPIO pin on the I/O bridge just to toggle system memory power, creating constant maintenance headaches. In contrast, once standard x86 execution reaches Linux, the platform hardware interface is consistent and functional. While the team originally anticipated having to maintain fine-tuned kernel configurations for each unique board, experience demonstrated that a single generic kernel runs equally well on both a small MinnowBoard and a massive multi-socket OCP server node. A prior complication involving vendor-tied ACPI tables highlighted by collaborator Ryan O'Leary is also receding as architecture plans evolve.

[23:23](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1403s) Building Go-Based User Space with u-root: Dynamic Mode vs. BusyBox Model

For NERF's userland, Minnich relies on `u-root`, an initiative he founded roughly six years prior after growing exasperated with repeated build breakage and tangled configuration scripts in Buildroot and BusyBox. Security teams at Google strongly favor Go over C because of its memory-safety guarantees. `u-root` supports two distinct operational modes designed to fit different constraints:

```mermaid flowchart LR accTitle: u-root Operational Modes accDescr: Flowchart comparing the dynamically compiled source mode and the AST-rewritten single binary BusyBox mode in u-root.

subgraph SourceMode["Mode 1: Dynamic Compilation (5.9 MB)"] S1["Go Toolchain + Command Sources"] S2["Boot into RAM"] S3["Compile on Demand (~200ms per binary)"] S1 --> S2 --> S3 end

subgraph BinaryMode["Mode 2: AST Multiplexed Binary (2 MB)"] B1["Go AST parses command packages"] B2["Rewrite 'package main' to 'package pkg'"] B3["Compile single binary + symlinks (~15s)"] B1 --> B2 --> B3 end ```

The first mode packages the complete Go toolchain, dependent libraries, and command source files inside an LZMA-compressed initramfs image totaling roughly 5.9 megabytes. When the system boots, commands are compiled on the fly in memory:

- On-demand compilation takes approximately 200 milliseconds for a tool like `bin/date`, after which execution from the ramfs is instantaneous. - Security auditors favor this dynamic mode because all operational source code remains inspectable on the booted target machine.

However, flash storage limits and slower processors (such as ARM chips) make a 5.9-megabyte payload and JIT compilation impractical. For those environments, `u-root` provides a BusyBox-style multiplexed mode: - The Go abstract syntax tree (`go/ast`) package inspects utilities written as `package main` (such as `ls`) and rewrites them into standalone internal subpackages (e.g., `package ls`). - All tools are compiled together into a single multi-call binary dispatched by checking `os.Args[0]`, driven by symlinks. - A 15-second build produces a stripped payload under 2 megabytes, completely eliminating cross-compilation toolchain hassles because the Go compiler natively targets any foreign architecture simply by specifying `GOARCH`.

This architecture collapses complex SysV or systemd startup configurations into one or two readable Go binaries. Boot times drop precipitously; Minnich notes a separate Chromebook experimental build using this architecture that boots all the way into an X11 desktop and web browser in just five seconds. For systems scripting, Minnich remarks:

> “I stopped writing bash scripts years ago I just write go programs it’s actually easier and more reliable.”

Looking ahead to 2018, the project aims to partner with enterprise vendors to ship commercial server nodes pre-equipped with NERF, satisfying demands for firmware that is auditable, secure, and fast.

[26:49](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1609s) Q&A: TPM, Verified Boot, and Heads Integration

Fielding an audience question regarding security verification, Minnich clarifies that NERF explicitly rejects UEFI Secure Boot mechanisms in favor of alternative platform trust designs. Instead, the initiative looks toward the hardware root-of-trust models deployed in ChromeOS:

- While `u-root` includes an experimental verified boot implementation written in Go, Minnich candidly notes that it is currently non-functional. - Production designs will prioritize the Google Chromebook methodology for anchoring trust inside the TPM rather than legacy EFI signature chains. - Minnich admits his own limitations regarding measured boot cryptography, deferring platform measurement strategies to Hudson's work on Heads:

> “Tram is very concerned about this, Heads is part of a secure environment that he’s building, and he really has a much better understanding of measured boots than I do so to some extent I’m going to follow his lead.”

[28:24](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1704s) Q&A: NERF vs. coreboot and the Reality of Intel Microcode

An attendee questions the absence of coreboot in the presented architecture. Minnich underscores that coreboot remains his platform of choice whenever feasible, noting that he continues to run coreboot on hardware platforms like the MinnowBoard. However, modern enterprise silicon architecture has systematically locked independent firmware out:

> “Coreboot has not been on server platforms for 12 years because of this problem, because we couldn’t get the information on how to turn on QuickPath.”

Because proprietary interconnects like Intel QuickPath Interconnect (QPI) lack public programming specifications, porting native coreboot to enterprise motherboards has been completely blocked. NERF bypasses this impasse by reusing existing vendor hardware initialization while reclaiming the upper firmware layers:

- If coreboot is supported on a system, operators should use coreboot; if locked into restrictive server platforms, NERF provides the practical open-source alternative. - Addressing a final question regarding Intel microcode updates, Minnich clarifies that silicon constraints enforce vendor microcode loads during the PEI stage. On modern processors, basic DDR DRAM initialization and bus training require roughly one billion processor instructions and fail to function unless CPU microcode patches are applied beforehand, making early microcode loading an unavoidable silicon requirement.

[29:52](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1792s) Microcode Limitations and Vendor Implementations of UEFI

Ron Minnich wraps up a point about early hardware bring-up, noting that DRAM initialization must happen correctly before entering the DXE (Driver Execution Environment) stage, meaning there is simply nothing that can be done about CPU microcode in this context. Opening the floor to questions, an audience member challenges Minnich's critique of UEFI. The attendee points out that many of the egregious firmware issues Minnich complained about are not part of the core EFI specification itself, but rather stem from sub-optimal or outright horrific vendor practices—such as misusing System Management Mode (SMM) for tasks that should never live in SMM, or bloating vendor EDK II builds with countless unnecessary modules when the majority of them can be compiled out.

```mermaid flowchart TD accTitle: Vendor Firmware versus NERF Linux Strategy accDescr: Comparison between standard vendor EDK II firmware builds and Google's NERF approach of booting directly into Linux.

subgraph VendorFirmware["Traditional Vendor EDK II Firmware"] VF1["Proprietary DXE Modules<br>(Closed network, storage blobs)"] VF2["Bloated Drivers & SMM Handlers<br>(Infrequently tested at scale)"] end

subgraph NERFPath["NERF Alternative Approach"] NF1["Open Source PEI Stage"] NF2["Tiny DXE Core & Minimal Drivers"] NF3["Linux Kernel & u-root Initramfs<br>(Tested 24/7 across millions of nodes)"] end

VF1 --> VF2 NF1 --> NF2 --> NF3 ```

Minnich acknowledges that while you can compile out open-source DXE drivers, proprietary vendor-supplied binary blobs—such as closed-source network card drivers—leave developers completely stuck when source code is denied. More fundamentally, Minnich defends the philosophy of replacing UEFI with Linux by looking at battle-tested scale. At a company like Google, with at least a million production machines in its fleet, the Linux kernel and its compiler are exercised and tested continuously 24/7. In contrast, standard EFI code executes only during infrequent reboots, leaving it far less rigorously validated. Minnich points out that using Linux as firmware is not unprecedented; IBM's POWER9 architecture boots Linux straight from firmware. As Minnich emphasizes: “So I think there's a really strong case to say that that kernel that is so heavily tested and made performant should be the thing I put in firmware that that's my argument here and I've had good results for that since 1999 so I'm buying that argument.”

- Vendor builds often abuse SMM and pack in unnecessary EDK II modules, but without vendor source code for hardware like NICs, users cannot compile those DXEs out. - Google’s fleet of over a million machines subjects the Linux kernel and toolchain to massive, round-the-clock testing that EFI boot code never receives. - Booting Linux directly from firmware is an established pattern outside x86, notably employed on IBM POWER9 systems.

---

[31:52](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1912s) Open-Source EDK II Packages vs. Booting Linux Post-PEI

An audience member asks about Minnich’s firmware repository and whether the team has collaborated with the EDK II Open Platform Package, which works to upstream open-source platform enablement for various ARM and x86 architectures. Minnich clarifies that while several companies and even colleagues within Google engage with that project, his personal view diverges regarding the optimal handoff point. He credits Intel for releasing TianoCore, noting that NERF actively repurposes components of it, including the DXE core and two utility programs. However, Minnich stresses that the ultimate objective is to terminate the UEFI environment as early as possible—right at the end of the PEI (Pre-EFI Initialization) stage—and transition directly into Linux rather than sustaining an extended UEFI environment.

- TianoCore open-source components, specifically the DXE core and certain utilities, are utilized within NERF. - Rather than maintaining an elaborate UEFI runtime ecosystem, NERF aims to cut over to the Linux kernel immediately following the PEI phase.

---

[32:57](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1977s) Running NERF and ME Cleaner on Everyday Notebooks

A notebook user in the audience asks whether an ordinary end user can adopt NERF without access to proprietary UEFI source code or Intel Management Engine (ME) firmware sources. Minnich confirms enthusiastically that researcher Trammell Hudson is specifically targeting laptops with this work. Users do not need vendor source code for UEFI, nor can anyone obtain Intel ME source code. Minnich explains that Intel ME firmware begins with a cryptographically signed BringUP (`BUP`) module, which cannot be modified without bricking the machine. However, the subsequent modules trailing the `BUP` module are unsigned. Tools like Nicola Corna's `me_cleaner` strip out these extraneous unsigned modules, leaving only the initial signed `BUP`.

Over the preceding two years, researchers discovered that running with only the `BUP` present allows the platform to boot and remain operational without triggering Intel's automatic 30-minute watchdog shutdown. Minnich notes that while Trammell Hudson previously faced steep obstacles attempting to port coreboot to locked-down commercial laptops due to closely held hardware specifications, the NERF approach of modifying the existing UEFI image proves much more practical and accessible. However, Minnich cautions users that the project is still in its early stages and carries the risk of bricking devices: “Now if you're going to do it make sure you're okay with the idea of turning your laptop into a brick and recovering from that because it's still early days right and anytime you do this stuff that can happen.”

```mermaid flowchart LR accTitle: Intel Management Engine Stripping with me_cleaner accDescr: Pipeline showing Intel ME partitions, identifying the signed BUP module kept by me_cleaner while removing extraneous unsigned modules.

subgraph StockME["Full Intel ME Firmware"] direction TB BUP["Signed BUP Module<br>(BringUP / Bootstrapping)"] EXTRA["Unsigned Modules<br>(Embedded Web Server, AMT, Network Stacks)"] end

subgraph CleanedME["Cleaned ME Firmware"] direction TB KEEP["Retained BUP Module<br>(Valid signature prevents watchdog halt)"] STRIP["Stripped Space<br>(All server & tracking code removed)"] end

StockME -->|"me_cleaner processing"| CleanedME ```

- Intel ME source code is completely unavailable, but users do not need it to sanitize their firmware. - The signed `BUP` (BringUP) module must be preserved to satisfy hardware signature checks, while unauthenticated trailing modules can be safely removed. - Retaining only the `BUP` bypasses the notorious 30-minute Intel power-down failsafe while eliminating higher-level ME services. - Trammell Hudson found NERF significantly easier to bring up on commercial laptops than full coreboot ports.

---

[35:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=2100s) Purism, High Assurance Platform (HAP) Mode, and Modern Chipsets

An audience member brings up Purism's announcement claiming they disabled Intel ME on their Librem notebooks, asking if that genuinely eliminates the embedded web server Minnich described. Minnich confirms this and explains the relationship between the projects: `me_cleaner` deletes the actual executable code responsible for the web server, whereas Purism went further by setting Intel's High Assurance Platform (HAP) bit—a configuration mechanism originally introduced for US government and military systems that instructs the ME to halt shortly after initialization. Minnich emphasizes that Purism's breakthrough should not be viewed in isolation, but rather as another milestone in a continuous community effort over the last two years to progressively excavate and disable Intel ME functionality.

When asked whether `me_cleaner` works on the latest Intel CPU generations, Minnich notes that firmware research progresses so rapidly that breakthroughs occur on a weekly basis, changing the technical landscape constantly. Another attendee steps up to clarify the architectural differences across processor generations. Older ME revisions operated on an obscure ARC-based RISC architecture. Beginning with Skylake and Kaby Lake, Intel shifted the ME to an x86 core running an operating system based on a Minix 3 kernel. Reverse-engineering of these newer x86 images revealed that flipping the built-in HAP disablement bit allows users to shut down the ME completely once the initial boot-up sequence concludes. With time expiring, Minnich receives the cut-off signal from the session moderators, thanks the audience, and invites the community to get involved in the open-source project: “I just I just got told in no uncertain terms to stop thanks all for attending and we again appreciate anything you want to do for this project thanks.”

| Intel ME Architecture Era | Underlying Core Architecture | Operating System | Disablement Technique | |:--- |:--- |:--- |:--- | | **Pre-Skylake** | Proprietary ARC RISC core | ThreadX / proprietary RTOS | Byte carving via `me_cleaner` to remove unsigned partitions while retaining the base signed `BUP` | | **Skylake / Kaby Lake** | x86 core | Minix 3-derived OS | Setting the High Assurance Platform (HAP) disablement bit to shut down the ME engine post-boot |

- Purism leveraged the High Assurance Platform (HAP) bit to disable ME execution post-bring-up, building upon the partition-stripping techniques of `me_cleaner`. - Starting with the Skylake microarchitecture, Intel ME transitioned to an x86 core executing a Minix-based operating system. - Security researchers analyzing the Minix-based ME discovered that setting the HAP bit shuts down ME operation immediately after system bootstrapping, successfully preventing background runtime execution.

## Notable quotes > [11:13](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=673s) We consider extensibility harmful, so NERF stands for Non-Extensible Reduced Firmware. — Ronald Minnich

> [17:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1020s) When Linux is running, EFI is running, and that's the thing we don't like; that's the thing we're trying to get rid of. — Ronald Minnich

## Mentioned Ronald Minnich, Google, Linux Foundation, WikiLeaks, UEFI, NERF, u-root, Go, FreeBSD, Plan 9, Blue Gene, coreboot, Harvey operating system, ChromeOS, Open Compute Project, Facebook, Jean-Marie Verdun, Guillaume, Trammell Hudson, Two Sigma, Andrey Mirtchovski, Cisco, Intel Management Engine, Minix 3, SMM, Integrated Sensor Hub, Innovation Engine, Vasilis Pappas, Wired, AMD, Ryzen, Platform Security Processor, Nicola Corna, me_cleaner, MinnowBoard MAX, Linux Networx, Los Alamos National Laboratory, Dell PowerEdge R630, Ryan O'Leary, Buildroot, BusyBox, Raspberry Pi, Heads, EDK II, IBM POWER9, TianoCore, Purism, Librem

## Video description Replace Your Exploit-Ridden Firmware with Linux - Ronald Minnich, Google

With the WikiLeaks release of the vault7 material, the security of the UEFI (Unified Extensible Firmware Interface) firmware used in most PCs and laptops is once again a concern. UEFI is a proprietary and closed-source operating system, with a codebase almost as large as the Linux kernel, that runs when the system is powered on and continues to run after it boots the OS (hence its designation as a “Ring -2 hypervisor"). It is a great place to hide exploits since it never stops running, and these exploits are undetectable by kernels and programs.

Our answer to this is NERF (Non-Extensible Reduced Firmware), an open source software system developed at Google to replace almost all of UEFI firmware with a tiny Linux kernel and initramfs. The initramfs file system contains an init and command line utilities from the u-root project (http://u-root.tk/), which are written in the Go language.

About Ronald G. Minnich Ron Minnich is a Software Engineer at Google. He has contributed to many open source projects in the last several decades, including the Linux kernel (9p file system); the FreeBSD kernel (rfork); and Plan 9 (many different areas). He directed the team that ported Plan 9 to the Blue Gene supercomputers. He invented LinuxBIOS (now called coreboot) in 1999. He is one of the core contributors to the Harvey operating system. His most recent Linux Foundation talk was on how to build your own signed version of ChromeOS and resign your Chromebook with your personal keys in 2016.

[Source](https://www.youtube.com/watch?v=iffTJ1vPCSo)

中文简报

用Linux替换漏洞百出的固件 - Google Ronald Minnich Ronald Minnich阐述了现代x86平台如何在Ring 0底层潜藏着隐蔽的专有操作系统——特别是位于Ring -2的UEFI以及在Ring -3运行Minix 3的Intel管理引擎(ME),这些系统带来了严重的驻留和利用风险。为了消除这一攻击面,Google的NERF架构使用me_cleaner等工具精简管理引擎,消除或重定向系统管理模式(SMM),并在早期硬件初始化完成后立即中止UEFI启动流程。NERF用经过实战检验的Linux内核与内存安全的Go语言用户态系统(u-root)替换了臃肿的驱动执行环境(DXE)及启动管理器,在coreboot受阻的情况下不仅建立了平台可审计性,还将服务器启动时间从八分钟缩减至二十秒。 Google开发了NERF(非可扩展精简固件),使用精简的Linux内核和基于Go的initramfs取代臃肿的UEFI运行时及驱动执行环境(DXE)模块,将开放计算项目(OCP)服务器节点的启动时间从八分钟缩短至二十秒。 (0:00) 现代x86硬件在Ring 0之下运行着多个隐藏的操作系统——包括位于Ring -3的Intel管理引擎上运行的Minix 3以及位于Ring -2的UEFI/SMM——它们运行着重复的IP协议栈、磁盘驱动和Web服务器,即使清空硬盘也能持续驻留。 (1:46) 通过使用me_cleaner脚本剥离未签名分区,仅保留签名的BringUP(BUP)模块,并启用Intel的高保障平台(HAP)位,研究人员能够在不触发硬件30分钟看门狗关机机制的情况下,消除管理引擎中臃肿的网络组件。 (13:09) 该项目将Linux与u-root相结合,后者是一个用Go编写的initramfs,它能在约200毫秒内按需编译实用程序,或将整个用户态环境打包为一个小于2 MB的类BusyBox二进制文件,从而绕过了标准的bash脚本开销及传统EFI签名机制。 (23:23)

Reading summary

Ronald Minnich of Google argues that modern x86 systems harbor insecure, proprietary operating systems beneath Ring 0, which can be mitigated by replacing bloated UEFI runtimes and Intel Management Engine components with a minimalist Linux kernel and Go userland. Hidden Operating Systems Beneath Ring 0 (1:34) Modern x86 hardware executes multiple layers of proprietary code beneath the host operating system. Linux runs in Ring 0, but it is subordinated to hypervisors in Ring -1, System Management Mode (SMM) and UEFI kernels in Ring -2, and the Intel Management Engine (ME) in Ring -3. Running Minix 3 on dedicated microcontrollers, the ME operates independently of the host CPU, retaining full memory access, independent IP networking stacks, and out-of-band management capabilities even when the machine is powered off. Minnich highlights that compromises in these lower environments persist directly in motherboard flash memory, rendering disk reformatting useless and leaving physical board destruction as the only certain recovery method. System Management Mode functions as an opaque execution environment dating back to Intel 486-era power management. Triggered by System Management Interrupts (SMIs), SMM halts the CPU and executes code out of a hardware-locked RAM segment (SMRAM) that Ring 0 cannot inspect or disable. In parallel, standard UEFI environments carry millions of lines of complex code, legacy bus drivers, and flawed self-update mechanisms. If an attacker achieves persistence in UEFI flash, update routines can falsely report success while retaining rootkits. Neutralizing Firmware Bloat with NERF and me_cleaner (11:13) To counter these risks, Minnich presents Non-Extensible Reduced Firmware (NERF). Rejecting firmware extensibility as an architectural hazard, NERF strips out runtime components from both the Intel ME and UEFI, revokes the firmware's ability to flash itself, and vectors hardware maintenance back into Linux. Complete excision of the Intel ME is physically impossible because it manages the reset vector and system clocks, tripping an unskippable 30-minute watchdog power-down if entirely absent. However, using tools like Nicola Corna's me_cleaner, developers can strip ME images down to the cryptographically signed BringUP (BUP) module—reducing its footprint on devices like the MinnowBoard MAX from 5 MB to 300 KB and removing embedded web servers and network stacks. On newer Skylake and Kaby Lake systems where the ME executes on an x86 core, researchers and vendors like Purism have leveraged the High Assurance Platform (HAP) configuration bit to halt ME execution immediately after bootstrapping. For Ring -2, NERF demonstrates that SMM is not mandatory for stable operations, citing over 100,000 production servers previously run by Linux Networx without SMM. Where hardware error handling like SECDED is required, NERF redirects SMIs directly into standard Linux interrupt handlers rather than proprietary black-box code. Replacing the UEFI DXE Stage with Linux and Go (17:00) NERF reclaims control of system execution by targeting the boundary between early hardware training and driver loading. While early Security (SEC) and Pre-EFI Initialization (PEI) phases remain proprietary and vendor-locked to train DRAM and chipsets, the interface between PEI and the Driver Execution Environment (DXE) is standardized. NERF intercepts this seam by replacing proprietary DXE drivers, network stacks, and persistent OS runtimes with a lean, tailor-made Linux boot kernel. On an Open Compute Project test node, this substitution dropped system boot times from eight minutes down to twenty seconds, though Minnich considers operational security and the removal of runtime EFI services far more significant than raw speed. Once the boot kernel initializes, it launches u-root, an initramfs user space written entirely in Go to leverage memory safety over C. u-root functions in two configurations: a 5.9 MB dynamic compilation mode that packages the Go toolchain to compile userland utilities on demand in roughly 200 milliseconds, and an AST-rewritten multiplexed binary mode that packs utilities into a single BusyBox-style executable under 2 MB. The default userland sequence executes dhclient, downloads a production OS image over the network, and transitions execution instantly via kexec. Hardware Constraints and Alternative Silicon (9:48) Minnich dispels the assumption that switching to AMD hardware eliminates closed firmware vulnerabilities. Modern AMD platforms shift obscure initialization routines and memory training into the proprietary Platform Security Processor (PSP), leaving critical early boot stages just as closed as Intel platforms. Furthermore, silicon-level requirements dictate that modern x86 memory training requires roughly one billion instructions and fails unless vendor CPU microcode patches are loaded during the PEI stage, making microcode blobs an unavoidable dependency across all x86 platforms. While coreboot remains Minnich's preferred firmware implementation, proprietary interconnect specifications like Intel QuickPath Interconnect (QPI) have locked coreboot out of multi-socket enterprise server motherboards for over a decade. NERF circumvents this barrier by accepting vendor PEI initialization while terminating the firmware stack immediately afterward. Minnich defends running Linux in firmware by pointing out that hyper-scale fleets test the Linux kernel continuously 24/7, making it vastly more dependable than rarely executed vendor UEFI modules. While NERF successfully eliminates UEFI runtimes and slashes the Intel ME attack surface on supported hardware, server-grade deployments face ongoing hurdles, including me_cleaner incompatibilities with multi-stage server partitions. The project continues to rely on community efforts and tools like Heads to refine measured boot trust models and establish commercial vendor adoption.

精炼阅读摘要

Google 工程师 Ronald Minnich 指出,现代 x86 固件中潜藏着 Ring -2 与 Ring -3 等具有超级特权且极易遭受攻击的专有操作系统;他提议通过 NERF 项目以精简 Linux 内核和 Go 语言用户空间直接替代庞杂脆弱的 UEFI 运行时和大部分管理引擎代码。 潜藏在特权底层的安全危机 (1:34) Minnich 回顾指出,Linux 诞生之初内核能完全控制硬件,但现代 x86 系统在 Ring 0 之下插入了至少两个半专有操作系统内核。在 Ring -2 层,UEFI 完整内核与系统管理模式(SMM)并存,其中 SMM 可利用系统管理中断(SMI)冻结主 CPU 并切换到不可审计的 16 位实模式,更通过锁定硬件配置位(SMRAM lock)使特定物理内存对操作系统彻底隐形;而在 Ring -3 层,Intel 管理引擎(ME)在独立的协处理器上运行 Minix 3 操作系统,即使主机处于关机状态,只要通电并连接网线即可独立访问网络和磁盘。这些底层固件自建了未受监管的网络栈、文件系统与外设驱动,并曾出现诸如空密码即可获取管理权限等重大漏洞。 由于底层固件直接驻留在主板的 SPI 闪存中,攻击者一旦将恶意代码植入闪存,格式化或擦除磁盘完全无法将其清除。恶意固件甚至可以在接收到系统更新指令时伪报成功,导致设备永久沦陷。Minnich 强调,受此类深层攻击影响的硬件设备规模估计达数亿乃至数十亿台,而在实际生产环境中,绝大多数设备根本未打补丁,其最终且唯一的彻底修复方案甚至只能是将受害主板直接送进粉碎机物理销毁。 NERF 架构:以 Linux 替代 UEFI (11:13) 针对 UEFI 代码臃肿、驱动使用轮询与人为延迟导致启动极慢且安全性差的问题,Minnich 团队推出了 NERF(Non-Extensible Reduced Firmware)项目。该项目认为固件的“可扩展性”反而是安全隐患,主张将固件功能缩减至最低限度,剥离所有开机后依然常驻内存的 UEFI 运行时服务,并将固件更新权限完全收归主操作系统管理,正如 Google 在数千万台 Chromebook 上所实践的那样。NERF 的核心由四大支柱构成:精简后的 Intel ME 镜像、仅保留基础硬件初始化的 UEFI PEI 层、彻底禁用或重定向至 Linux 的 SMM,以及直接烧录在主板闪存内的微型 Linux 内核和 Go 语言用户空间。 在标准 UEFI 启动流程中,专有的 SEC 和 PEI 阶段完成内存与芯片组初始化后,会通过规范定义的接口交接到驱动执行环境(DXE),进而加载繁复的驱动和常驻运行库。NERF 利用这一固定的分界点,在 PEI 完成硬件带电自检后,直接将执行权切入微型 Linux 内核。此举不仅彻底清除了 DXE 阶段的私有网络栈和遗留驱动,还将 Open Compute Project(OCP)服务器节点的开机引导时间从 8 分钟大幅削减至 20 秒,随后的 Go 用户空间通过网络获取完整生产镜像并执行 kexec 仅需约 3 秒。 清洗管理引擎与解除 SMM 锁定 (13:09) 由于 Intel ME 在硬件通电时最先启动并为主 CPU 提供复位向量和时钟信号,彻底从物理闪存中删除 ME 会触发硬件看门狗在 30 分钟后强制关机。针对这一限制,开源社区采用 Nicola Corna 开发的 `me_cleaner` 工具对 ME 固件进行修剪。例如在 MinnowBoard MAX 的 8 MB 闪存中,`me_cleaner` 将原先占用 5 MB 的 ME 固件精简至约 300 KB,去除了内部的 Web 服务器和网络模块,仅保留带数字签名的 BUP(启动)分区以规避关机保护;在较新的 Skylake 等 x86 架构芯片上,社区则利用 Intel 预留的高保障平台(HAP)标志位,在硬件完成初始引导后彻底关闭 ME 运行引擎。 对于长期被芯片厂商视为不可或缺的 SMM 机制,Minnich 指出厂商常利用其实现专有功能的锁定。事实上,早年 LinuxBIOS 时代已有数十万台生产集群节点在完全关闭 SMM 的状态下稳定运行。NERF 在系统启动初期夺取控制权,直接阻止 SMM 锁定硬件寄存器;对于确实依赖 SMM 触发硬件纠错(如 SECDED)的主板,NERF 则通过底层补丁将 SMI 中断直接重定向为 Linux 内核的原生中断处理,确保底层系统的控制权完全由操作系统内核掌控。 基于 u-root 的 Go 用户空间与固件生态 (23:23) 在内核之上的用户环境构建上,NERF 摒弃了难以维护的 BusyBox 与 Buildroot 体系,采用由 Minnich 发起的 `u-root` 项目。该项目完全基于具备内存安全特性的 Go 语言构建,并提供两种运行模式:一种是将完整的 Go 编译器源码包压缩入约 5.9 MB 的内存盘镜像中,启动后根据需求在 200 毫秒内即时编译工具;另一种则是面向空间极度受限环境,通过 Go 抽象语法树(`go/ast`)解析所有命令源码,将其整合编译为一个单一的多调用二进制文件,在 15 秒内构建出小于 2 MB 的极小用户环境。两套模式均摆脱了跨平台交叉编译链的繁琐配置,极大简化了初始化服务逻辑。 在生产适配与生态合作上,NERF 借鉴了 Trammell Hudson 在 Heads 项目中的固件构建自动化脚本,并成功在 Dell R630、OCP 节点以及 MinnowBoard 等不同形态硬件上验证了通用 Linux 内核的可用性。面对 UEFI 支持者的质疑,Minnich 强调厂商闭源网络模块常驻内存且缺乏检验,而 Linux 内核在 Google 数百万台机器上经过全年无休的大规模测试,其成熟度与健壮性远超仅在开机时零星运行的 EFI 代码。此外,IBM POWER9 平台直接从固件引导 Linux 的工业实践,也印证了这一技术路线的可行性。 NERF 展示了以精简开源 Linux 内核替代脆弱固件的全新路径,但当前在 OCP 服务器上的多阶段 ME 清洗逻辑、Go 语言实现的硬件验证引导等环节仍处在演进与完善阶段;此外,由于企业级主板核心互连规范(如 QPI)受阻于硬件厂商的保密协议,通用服务器尚无法彻底摆脱前期的专有微码与 PEI 初始化二进制模块。

Detailed notes — zh

## Background 该视频由 The Linux Foundation 于 2017 年 10 月 27 日发布在 YouTube 平台上,主讲人为来自 Google 的资深工程师 Ronald Minnich。视频简介指出,随着维基解密 Vault 7 文件的披露,运行在 PC 与笔记本底层的专有 UEFI 固件安全隐患再度引发关注;为此 Google 主导开发了开源的 NERF(Non-Extensible Reduced Firmware)方案,旨在用极简的 Linux 内核与基于 Go 语言的 u-root 用户空间替换几乎全部 UEFI 固件,彻底消除潜伏在系统底层的安全威胁。 ## TL;DR Ronald Minnich 深入揭示了现代 x86 架构中潜藏在操作系统之下的“两个半内核”(Ring -2 的 SMM/UEFI 与 Ring -3 的 Intel ME),抨击了其臃肿、闭源且充满无法修补的安全后门现状。为彻底扭转固件危机,Google 联手开源社区推出了 NERF 项目,通过 `me_cleaner` 剔除 Intel ME 的高危网络服务,并在 UEFI 的 DXE 阶段切断厂商专有运行时驱动,直接拉起经由实战检验的 Linux 内核。配合纯 Go 语言编写的轻量级用户空间 u-root,该方案不仅将服务器节点的冷启动耗时从 8 分钟大幅压缩至 20 秒,更达成了在操作系统启动后彻底终止底层隐形特权代码运行、重构系统安全根基的目标。 ## Atmosphere & style 整场演讲充满硬核黑客的技术锋芒与自嘲式的黑色幽默。Minnich 登台即展现出老练从容的极客气场,用诸如“今年是 Minix 桌面年”以及“受感染固件唯一的补救方案是粉碎机”等辛辣包袱引得全场心照不宣地爆笑。面对 UEFI 与 ME 的深层安全漏洞,台下情绪先是在直面现实的压抑与恐慌中紧绷,随后又在 NERF 架构干脆利落的破解方案与社区最新进展中迎来解脱与振奋,问答环节互动极其紧凑火热,展现出底层系统工程师群体特有的求真与务实。 ## Bulletin - [00:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=0s) Google 联合多家机构推出开源项目 NERF,旨在用精简的 Linux 内核与基于 Go 编写的 u-root 用户空间替换专有闭源的 UEFI,成功将 Facebook OCP 节点的启动时间从 8 分钟大幅削减至 20 秒。 - [01:34](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=94s) 现代 x86 平台在硬件与操作系统之间隐藏着“两个半内核”(Intel ME、UEFI 和 SMM),拥有独立的 TCP/IP 协议栈和 Web 服务器等高危组件,一旦 Flash 遭恶意篡改,格式化硬盘完全无效,物理粉碎主板甚至成了唯一救济手段。 - [13:09](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=789s) 针对 Intel ME,社区利用 me_cleaner 成功将 5MB 的固件裁剪至仅需保留签名校验的 300KB BUP 模块,打破了无 ME 运行 30 分钟强制关机的限制,并结合 HAP 标志位实现了引导后彻底禁用 ME。 - [26:49](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1609s) 由于硬件厂商长期封锁 QPI 等互连技术文档,导致 coreboot 在服务器领域缺席超过 12 年;NERF 选择在 DXE 阶段切断 UEFI 运行时组件并切入 Linux,为现代服务器固件开源化开辟了务实的替代路径。 ## Key takeaways - [01:34](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=94s) 现代计算机架构在硬件和操作系统之间塞入了专有且特权更高的隐藏操作系统(Ring -2 的 UEFI/SMM 与 Ring -3 的 Intel ME),构成了极大的持久化安全漏洞隐患。 - [02:46](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=166s) Ring -3 的 Intel ME 内部运行着 Minix 3 操作系统和独立 Web 服务器,曾爆发向该端口发送空密码即可直接接管整台机器控制权的严重漏洞(CVE-2017-5689)。 - [06:26](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=386s) 系统管理模式(SMM)作为 16 位实模式下的“半内核”,会在内存中划定操作系统无法感知的屏蔽区域(隐形斗篷),且无法在 OS 启动后被轻易关闭。 - [06:26](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=386s) UEFI 的自更新模型存在逻辑悖论:一旦低层固件被植入恶意后门,固件可以伪造更新成功的假象而拒绝真正刷写,导致恶意代码永久驻留。 - [09:48](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=588s) 换用 AMD 处理器并不能彻底摆脱固件黑盒问题,AMD 同样将核心的 DRAM 初始化代码移至闭源的平台安全处理器(PSP)中运行。 - [11:30](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=690s) NERF 秉持“在固件层即可扩展性有害(extensibility harmful)”的理念,彻底剥离固件的运行时常驻组件与自更新能力,将硬件维护完全交还给 Linux。 - [13:09](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=789s) 直接物理抹除 ME 会触发硬件保护导致系统无法开机或在 30 分钟后强制硬关机;通过保留签名的 BUP 模块即可规避该看门狗机制。 - [15:40](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=940s) 针对 SMM 隐患,NERF 采取早期彻底禁用或将 SMI 系统管理中断向量化转交给 Linux 内核统一透明管理的策略。 - [17:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1020s) NERF 的核心战术是在规范明确的 DXE 阶段切入,伪装为 Boot Manager 驱动,用极简 Linux 内核替换掉冗余的 UEFI 驱动与运行时环境。 - [23:23](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1403s) u-root 提供了基于 AST 源码重写的单二进制打包模式(类似于 BusyBox),可在跨平台编译的同时将 initramfs 体积压缩至 2MB,完美适配小容量 Flash。 - [26:49](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1609s) DRAM 控制器初始化和复杂的内存训练需要执行近十亿条指令,微代码(Microcode)打补丁的步骤在物理机制上必须硬性保留在 DXE 之前的早期阶段完成。 - [29:52](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1792s) 相比启动期间仅运行数秒且闭源缺乏测试的 UEFI,Linux 内核在超大规模生产环境中历经数以百万计服务器的 7x24 小时高强度实战验证,将其置于固件层可靠性更强。 - [32:57](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1977s) 普通用户改造笔记本固件无需原厂提供源码,借助开源社区的 me_cleaner 脚本处理 BIOS 镜像即可完成部署,但早期阶段需做好刷砖救砖的准备。 - [35:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=2100s) 自 Skylake 起 Intel ME 转用 x86 架构并运行 Minix 3,安全研究人员通过翻转保留的 HAP 模式位,成功实现了在系统完成硬件引导后让 ME 彻底停止运行。 ## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=0s) 用 Linux 替换满身漏洞的固件 演讲一开始,来自 Google 的 Ron Minnich 眯着眼睛调侃台上的灯光实在太刺眼。他向台下听众明确表示,过去十年来只要他登台谈固件,大家都会理所当然地认为他戴着那顶经典的 coreboot 帽子(“coreboot hat”),但今天完全不同,这绝不是一场关于 coreboot 的演讲。这项工作有多方合作伙伴共同参与,包括现场听众中的 Jean-Marie Verdun、Guillaume,以及来自 Google 的多位同事、来自 Two Sigma 的 Trammell Hudson,还有帮助实现了 Go 语言部分的关键人物——思科(Cisco)的 Andrey Mirtchovski。 Ron 首先亮出了令人惊叹的成果:在 Google 展台里有一台 Facebook 的计算节点(OCP 节点),团队成功将其开机时间从 8 分钟大幅削减到了仅剩 20 秒。但他随即话锋一转,直言以他的思考方式来看,“boot time from 8 minutes to 20 seconds and to be honest to my way of thinking that's the maybe the single least important part about this work”(把启动时间从 8 分钟缩短到 20 秒,老实说,照我的想法来看,这大概是这项工作里最无足轻重的一部分)。 真正关键的核心在于架构的彻底革新:所有的用户态完全用 Go 语言编写。主板 Flash 芯片中存放着一个 Linux 内核以及一个 initramfs,而这个 initramfs 里的整个用户空间——包括 init 进程本身——全部是用 Go 写的。这项方案不仅将 Linux 级别的卓越性能、稳定可靠性以及安全性引入到了固件世界,更达成了终极目标:彻底消除了 UEFI 和 Intel ME(Management Engine)在操作系统启动后的所有后台常驻活动。 - **核心成果**:Facebook OCP 节点启动时间从 8 分钟缩减至 20 秒。 - **软件栈构成**:烧录在 Flash 中的极简 Linux 内核 + 纯 Go 语言编写的用户空间与 init(基于 u-root)。 - **根本目标**:斩断 UEFI 与 ME 在 OS 引导完成后的一切后台常驻操作。 --- ### [01:34](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=94s) 固件危机:潜伏在硬件与 Linux 之间的“两个半内核” 回溯历史,上世纪 90 年代大家投身 Linux 时,Linux 掌控着经典的 Intel 586 平台硬件的绝对控制权。然而演变到今天,情况急转直下:在 Linux 与底层硬件之间,硬生生塞进了“至少两个半内核”(at least two and a half kernels)。这些内核完全是专有且闭源的,正如预料的那样,它们对漏洞极其“友好”(exploit friendly),攻击者可以轻而易举地针对这些未知操作系统编写漏洞利用程序。 更恐怖的是特权级的倒挂:这些隐形内核运行在比 Linux 拥有更高特权的特权级别之上,能够肆意操控和篡改上层的 Linux。磁盘上的普通恶意软件尚且可以通过格式化硬盘清除,但这类固件漏洞直接写入主板的 Flash 存储器,一旦扎根就永远无法彻底清除。Ron 指出,面对这种被彻底持久化感染的系统,甚至唯一的解决办法就是把主板直接丢进粉碎机。他戏称自己以前做这个分享时标题叫《如果你相信你的电脑,那你一定是疯了》(*If you trust your computer, you're crazy*),而今天提出的方案,就是为了让大家能够摆脱疯狂、找回理智。 ```mermaid flowchart TD accTitle: x86 Privilege Rings Architecture accDescr: Diagram illustrating the security privilege rings from Ring 3 down to Ring minus 3 in modern x86 systems. subgraph UserOS["常规系统层 (Visible to OS)"] R3["Ring 3: 用户态应用程序 (Apps)"] R0["Ring 0: Linux / Windows 内核"] R3 --> R0 end subgraph Hypervisor["虚拟化层"] Rm1["Ring -1: 虚拟机监视器 (KVM / Xen / Hyper-V)"] R0 --> Rm1 end subgraph FirmwareRings["固件特权层 (Hidden & Uncontrollable)"] direction TB subgraph RingMinus2["Ring -2: 两个半内核之一与半个内核"] SMM["SMM (System Management Mode)<br/>半内核: 陷阱至 16 位实模式"] UEFI["UEFI 内核<br/>64 位分页模式 / 极其庞大复杂"] end subgraph RingMinus3["Ring -3: 独立协处理器"] ME["Intel ME (Management Engine)<br/>运行 Minix 3 / 8086 架构"] end Rm1 --> SMM Rm1 --> UEFI UEFI --> ME end ``` - **持久性威胁**:Flash 芯片被篡改后,重装系统或格式化硬盘完全无效。 - **终极处置方式**:由于缺乏受信任的固件刷新机制,受感染硬件的最终归宿往往只有物理销毁(粉碎主板)。 --- ### [02:46](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=166s) 剖析特权环:Ring -2 与最令人胆寒的 Ring -3 Ron 详细拆解了现代 PC 中荒诞的特权环层级。除了大家熟悉的 Ring 0(Linux)和常被称为 Ring -1 的虚拟机监视器层(Hypervisor,由于 Ring 号不够用而生造的名词),更深层则是 Ring -2 和 Ring -3。处于 Ring -2 的内核和一个“半内核”掌控着 CPU 的一切。Ron 把系统管理模式(SMM, System Management Mode)称为“半内核”:每当你合上笔记本盖子时,它就会强行把 CPU 陷阱拦截回经典的 8086 16位模式。“That should make you happy right? No protections at all in that mode”(这应该能让你感到高兴对吧?那个模式下根本没有任何保护机制)。与此同时,UEFI 内核运行在 64 位分页模式下,有时硬件事件陷阱进入 SMM 后又会弹出进入 UEFI 执行,此时 Linux 完全被挂起,根本不知情。 真正让整个安全界极度恐慌的是 Ring -3。在一颗现代 Intel 处理器芯片内部,通常集成了三个独立的 8086 架构 CPU 内核:一个是臭名昭著的 ME(管理引擎),另一个是集成传感器中枢(Integrated Sensor Hub),还有一个名字让 Ron 每次念出来都忍不住发笑的“创新引擎”(Innovation Engine)。 其中 ME 运行的是 Minix 3 操作系统。Ron 幽默地调侃道:“The ME though runs Minix 3 and that's why this is the year of Minix on the desktop because if you add up all the nodes running Windows and all the nodes running Linux that's less than all the nodes running minix 3”(ME 运行着 Minix 3,这就是为什么今年是 Minix 桌面年——因为如果你把所有运行 Windows 的节点和所有运行 Linux 的节点加在一起,总数都没运行 Minix 3 的节点多;我想安迪·塔能鲍姆教授大概很想知道这事)。 Ring -2 和 Ring -3 中塞满了大量未与 Linux 共享任何代码的独立软件栈:独立的 IP 协议栈、文件系统、USB 和鼠标驱动程序。ME 之所以需要独立的文件系统,是因为它拥有即使在关机状态下也给机器重新刷写系统镜像(re-image)的权限。甚至在 Ring -3 的 Minix 系统里还运行着一个完整的 Web 服务器。此前闹得沸沸扬扬的严重安全漏洞,就是攻击者通过给该 Web 服务器发送一个长度为 0 的空密码,就能直接获得整台机器的完全管理员权限。只要电脑插上电源并接上网线,即使处于关机状态,这套隐形系统也能神不知鬼不觉地把你的工作站彻底重做系统。 - **内置协处理器**:包含 Management Engine (ME)、Integrated Sensor Hub 和 Innovation Engine。 - **Minix 3 统治桌面**:每一颗出厂的现代 Intel 芯片都默默运行着 Minix 3。 - **高危内置服务**:包含独立 TCP/IP 栈、独立文件系统驱动、USB 驱动以及 Web 服务器。 - **空密码漏洞(CVE-2017-5689)**:向 ME 的内部 Web 端口发送长度为 0 的密码即可绕过身份验证,获取完整硬件控制权。 --- ### [04:57](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=297s) ME 的复杂组件与流传十年的漏洞历史 Ron 展现了 Management Engine 内部极其繁琐的组件列表,坦言自己也无法理解为何它既需要“Full Network Manageability”,又需要“Regular Network Manageability”,还要塞进一个“Manageability”。至于里面的“Small Business Technology”,十年前其设计初衷令人啼笑皆非——仅仅是因为小企业觉得配密码太麻烦,所以干脆给 ME 留了个无需密码的后门通道。此外,ME 组件中还包括所谓的“Outbreak Containment Heuristic”(爆发遏制启发式,Ron 吐槽不知道是不是从哪部灾难电影里偷来的词)以及用于音视频版权数字权利管理(DRM)的“Protected Audio Video Path”。 十年前,安全研究员 Vassilios Ververis 曾完成过一篇极其出色的硕士论文,系统性分析了 Intel ME 的安全缺陷。那篇论文读起来让人十分沮丧,因为几乎每一个暴露的面都能被攻击者攻破,而许多历史漏洞至今仍未得到有效修复。Ron 建议大家可以去 Google 搜一下“Intel ME exploit”,足足能搜出 5000 万条结果。当年《连线》(*Wired*)杂志登出过一条极具讽刺意味的标题:《Intel 终于修复了一个潜伏了整整七年该死的严重 Bug》(*Intel fixes a critical bug that lingered for seven dang years*)。 按受影响的设备规模推算,这涵盖了大约十亿台机器。而官方给出的修复方案轻描淡写:请刷新主板固件。面对这个方案,Ron 发出了灵魂拷问:“How many people want to believe that a billion machines have been refetched since last spring with new firmware to fix this bug? I certainly don't believe it”(有多少人愿意相信,从去年春天到现在,真有十亿台机器都重新刷了新固件来修复这个漏洞?我反正是绝对不信)。这意味着成千上万台设备的 Web 服务器至今仍然裸奔在网络上,任何人只要敲一个空密码就能将其完全掌控。 - **Vassilios Ververis 经典研究**:十年前的硕士论文就已经证明 ME 的攻击面无处不在。 - **十亿级设备隐患**:长达七年的致命安全漏洞,绝大多数出厂设备因缺乏固件升级维护而处于永久易受攻击状态。 --- ### [06:26](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=386s) SMM 与 UEFI:无法关闭的隐形斗篷与不可信的自更新 追溯 Ring -2 的半内核——系统管理模式(SMM)的起源,它是随着 Intel 486 处理器引入的,起初纯粹是为了解决电源管理问题。当时的痛点非常典型:在 486 笔记本上运行 DOS 系统,用户合上屏幕盖子期望机器睡眠休眠,但老旧的 DOS 系统根本不具备这种能力。于是 Intel 硬件工程师引入了高于 Ring 0 的高特权执行模式。一旦特定硬件事件触发“系统管理中断”(SMI),硬件就会强行介入并掌控全局。 久而久之,各类复杂代码都被塞进了这个黑盒。在早期操作系统内核还不支持 USB 的时代,如果你把 USB 鼠标插入电脑却能正常工作,背后就是 SMM 中运行着一套完全独立的完整 USB 协议栈。一旦某些鼠标不兼容,也就是因为这个孤立的 SMM USB 栈没有适配它。然而,SMM 存在严重的架构缺陷:一旦系统启动时启用了 SMM,硬件上就会锁死一个配置位,将物理内存(RAM)中的一大块区域彻底屏蔽,使其他所有运行模式都对其完全不可见。Ron 将其形容为一个“隐形斗篷”(cloaking device):内存就这么凭空消失了,你既无法透视它究竟在执行什么,也无法在操作系统启动后禁用它或把它关掉,这成了硬件厂商对机器维持绝对控制权的坚固堡垒。 ```mermaid flowchart LR accTitle: UEFI Self-Update Trust Cycle Vulnerability accDescr: Cycle of a kernel attempting to patch UEFI firmware when UEFI itself is already compromised. A["OS 内核在内存中放置更新固件"] --> B["调用 UEFI 固件更新接口"] B --> C{"当前 UEFI 是否已被植入后门?"} C -- "是" --> D["伪造更新成功响应<br/>拒绝真正刷写"] D --> E["恶意固件永久驻留 Flash<br/>唯一救济方案: 物理粉碎机"] C -- "否" --> F["成功刷入新固件"] ``` 更上一层的 Ring -2 则是与 SMM 共同运行在主 CPU 上的 UEFI。这是一个极其繁杂的操作系统级固件,大量的漏洞根源在于各家硬件 OEM/ODM 厂商的工程师被迫在这个怪异复杂的环境下写代码,却对其中的规则一知半解,写出的代码破绽百出,“The result is that there are big giant holes that people can drive exploits through”(其结果就是留下一个个巨大的窟窿,攻击者可以开着漏洞利用的大卡车直接碾压过去)。现场调研时,不少听众举手表示写过 UEFI 代码,Ron 追问大家写得开不开心,引发现场一阵心照不宣的苦笑。 更危险的在于 UEFI 的自更新信任模型。UEFI 假设自己足够聪明,内核只要把一段更新数据丢到内存里拉动触发更新链,UEFI 就能完美无瑕地刷新自身。这种模型在现实中漏洞百出。Ron 表达了极大的忧虑:当一台机器的 UEFI 已经被恶意软件利用感染后,用户即便尝试通过软件下发升级补丁,恶意 UEFI 也可以在表面上假装“好的,我已经更新完毕了”,背地里却根本不写入 Flash。“The worry has been that you can make an exploit that can't ever be removed and again the only remediation is a shredder”(令人担忧的一直是,你可以制造出一个永远无法被移除的漏洞利用,而唯一的补救措施再次只剩下了粉碎机)。 在展示 Facebook OCP 节点的 UEFI 固件剖析时,这个原本功能极其有限的服务器节点上,固件镜像内部竟然包含了成百上千个杂乱组件,不仅内置了 USB 栈、IPv6 和 IPv4 协议栈,甚至为了向远古硬件兼容,依然赫然保留着 ISA 总线驱动支持。Ron 忍不住向全场调侃:“现在这里还有谁的机器上装着 ISA 总线吗?” - **SMM 的隐形机制**:SMM 激活后通过硬件锁定位开辟独占 RAM,形成操作系统完全无法探测的盲区。 - **UEFI 架构包袱**:现代 OCP 数据中心节点固件中,充斥着网络协议栈、USB 甚至早已淘汰的 ISA 总线驱动。 - **自更新悖论**:一旦低层固件被攻陷,依赖其自身执行的软件固件升级将变得完全不可信。 ### [09:48](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=588s) 隐藏操作系统的威胁与 AMD 的迷思 现代 x86 固件内部塞满了大量古老而简陋的代码,例如仍采用轮询 I/O(polling I/O)机制的 IDE 驱动,内置了无数的人工延时,驱动质量极其原始,这也是系统开机引导极其缓慢的关键原因。更严重的是,系统底层潜伏着“两个半”隐藏操作系统(Intel ME、UEFI 以及 SMM),它们拥有完整的网络协议栈、独立的 Web 服务器,能够运行跨电源周期和系统重装依然驻留的自修改代码,甚至能够完全控制上层的 Linux。 面对这种系统底层满是漏洞、甚至频频遭遇实际利用的局面,以往的技术演讲往往只能以恐慌收尾。针对部分人提出“改用 AMD 就能解决问题”的观点,Ron Minnich 明确指出这完全是对事实的误解。虽然曾经有一段时间 AMD 相对开放,但现状并非如此。有人宣称 Ryzen 处理器彻底开源,但实际情况是,AMD 将 EFI 中许多怪异且封闭的组件转移到了平台安全处理器(Platform Security Processor, 简称 PSP)中;更关键的是,初始化 DRAM 的代码正是由 PSP 负责执行,且这套代码永远不会对外公开。Intel 上封闭的东西,在 AMD 上同样是封闭的。 > “如果你们现在还不觉得害怕,那可能是我刚才讲得还不够清楚,因为我确实被吓到了,我认为眼下的处境非常糟糕。”(Ron Minnich) - **AMD 架构现状**:硬件初始化流程转向 PSP,虽然开放的部分看起来更多,但核心的 DRAM 内存初始化代码依旧闭源。 - **项目重心**:NERF 优先以 Intel x86 架构为突破口(部分源于作者自身的使用偏好),但除了 Management Engine(ME)特有的部分外,大部分理念和技术同样适用于 AMD。 --- ### [11:30](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=690s) NERF 诞生:把可扩展性从固件中剥离 为了解决底层固件不可控的困局,Google 启动了名为 NERF(Non-Extensible Reduced Firmware)的开源项目。UEFI 中的“E”代表可扩展(Extensible),但团队认为在固件层面,**可扩展性有害无益(extensibility harmful)**,因此 NERF 的核心目标就是通过精简和移除不必要的能力,削弱固件造成破坏的潜在空间,并让底层运行的所有行为彻底透明化。 NERF 的核心思路是彻底干掉 Intel ME 和 UEFI 中的运行时常驻组件(Runtime Components),剥夺它们内置的 Web 服务器和 IP 协议栈,并剥离固件的自刷新(reflash)能力。硬件的维护和刷新工作理应交给 Linux 本身接管。Chromebook 就是最好的成功案例:市面上超过 3000 万台 Chromebook 在更新 BIOS 时均由 Linux 执行刷写,从未出现过传统 EFI 试图引导 Linux 时频繁将机器变砖(brick)的灾难性事故。 ```mermaid flowchart TD accTitle: NERF Architecture Components accDescr: Diagram showing the replacement of proprietary firmware layers with NERF components. subgraph Proprietary["传统固件风险层"] ME_Bloat["Intel ME (内置 Web 服务器/IP 协议栈)"] SMM_Risk["SMM (Ring -2 隐藏特权模式)"] UEFI_Bloat["UEFI DXE/Runtime (臃肿且可扩展)"] end subgraph NERF["NERF 替代架构"] ME_Clean["Deblobbed ME (裁剪至 ~300KB)"] SMM_Handle["禁用 SMM 或向量化投递至 Linux"] Linux_Payload["精简 UEFI + Linux 内核 Payload"] Go_Userland["u-root (Go 语言编写的 Userland)"] end ME_Bloat -.->|"me_cleaner 剔除"| ME_Clean SMM_Risk -.->|"拦截接管"| SMM_Handle UEFI_Bloat -.->|"替换引导接口"| Linux_Payload Linux_Payload --> Go_Userland ``` - **NERF 架构四大组成部分**: 1. 剔除私有二进制块(de-blobbed)的精简 ME ROM。 2. 精简至仅剩最基础硬件启动部件的 UEFI ROM。 3. 彻底禁用系统管理模式(SMM),或将其产生的中断直接向量化(vector)转交给 Linux 内核处理。 4. 一个嵌入固件的 Linux 内核,以及由 Go 语言编写的用户空间环境(基于 u-root 项目)。 - **社区参与契机**:贡献 NERF 并不要求开发者必须精通内核或底层固件,庞大的 Go 用户空间开发极度欢迎纯应用层开发者的加入。 --- ### [13:09](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=789s) 驯服 Intel ME 与规避 30 分钟硬关机 直接在硬件上剔除 Intel ME 固件在技术上是行不通的。ME 位于芯片硬件管芯(die)上,是设备通电后最先苏醒的部件,负责拉起所有硬件时钟,甚至在较新的处理器上,主 CPU 获取第一条指令重置向量(Reset Vector)时也是由 ME 喂给 CPU 的。如果强行抹除 ME 固件,机器将直接无法开机;或者触发硬件看门狗,在运行整整 30 分钟后自动断电,因为 ME 认为固件损坏并只预留 30 分钟供用户修复。 突破口来自于逆向工程的进展。大约两年半前,Trammell Hudson 开始深入分析 ME 固件,随后 Nicola Corna 用 Python 开发了名为 `me_cleaner` 的工具。以售价 159 美元的 MinnowMax 开发板为例,其板载 8MB Flash 中有整整 5MB 都被 ME 固件独占;而运行 `me_cleaner` 清除掉 Web 服务器、IP 栈等危险模块后,ME 仅需保留 300KB 的代码即可正常拉起 Linux。尽管在服务器平台(如 OCP 节点)上运行 `me_cleaner` 仍会导致无法开机(固件镜像结构中包含类似 `bup` 的嵌套阶段,清空后续模块会导致启动中断),但这已被列为后续攻坚的重点。 > “如果直接移除 ME 固件,你的节点可能永远无法工作,很多情况下甚至开不了机;即便能开机,它也会在 30 分钟后自行关机。”(Ron Minnich) - **MinnowMax 固件结构**:8MB Flash 镜像中,ME 从 5MB 大幅缩减到 300KB,剔除了极易出现 0-day 漏洞的 RSA 验证模块及网络通信模块。 - **服务器端挑战**:OCP(Open Compute Project)节点上的 ME 镜像由于多阶段初始化依赖,清除后暂时无法开机,相关适配正在推进中。 --- ### [15:40](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=940s) 终结 SMM 隐患与接管系统中断 针对 Ring -2 级别的系统管理模式(SMM),NERF 采取了极具侵略性的策略:只要内核启动得足够早,就可以在硬件锁定之前彻底禁用 SMM。硬件厂商长期以来宣称 SMM 是服务器运行必不可少的组件,但这一说法早已被历史打破。早在 1999 年至 2007 年 LinuxBIOS(coreboot 前身)时代,洛斯阿拉莫斯国家实验室(Los Alamos)的数千个计算节点就完全在关闭 SMM 的状态下稳定运行。 对于极少数确实需要硬件错误处理(例如单错纠正、双错检测 ECC 内存中断)而必须保留 SMM 的特定平台,Ron Minnich 开发了一种中断重定向机制,将系统管理中断(SMI)直接向量化捕获并转发给 Linux 内核。如此一来,原本隐匿在芯片组内部、无法被 OS 审计的代码,被拉回到由 Linux 标准中断机制统一管控的透明环境中。 > “我们曾和一家 x86 厂商进行过一次很有意思的交谈,对方坚称服务器节点在关闭 SMM 的情况下绝对不可能运行;我们当时回答说:‘那你得去跟 Linux Networx 解释解释了,他们卖出的十万台服务器全都关掉了 SMM,而且它们跟我们手头这几千台一样跑得好好的。’”(Ron Minnich) - **SMM 的本质**:除极少数底层硬件纠错场景外,SMM 绝大多数时候被硬件厂商用于堆砌所谓的“增值服务”,实质上是构筑专有生态并对客户形成厂商锁定(vendor lock-in)。 - **处置方案**:要么在引导早期彻底拔除 SMM 权限,要么将其转化为 Linux 可见可控的标准中断向量。 --- ### [17:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1020s) 剖析 UEFI 架构:用 Linux 替换 DXE 引导模块 UEFI 的体积异常庞大,甚至达到了 Linux 内核相当一部分的代码规模,复杂的设计导致其内部充斥着各种各样的编程错误(固件代码中甚至出现诸如“thermoneter”这类的荒谬拼写)。UEFI 的完整启动链条自底向上包括安全验证阶段(SEC 阶段,负责 16 位实模式初始化、CPU、芯片组及主板初验,涉及各家厂商严格保密的底层知识)、PEI 阶段,以及驱动执行环境(Driver Execution Environment, 简称 DXE)。 ```mermaid flowchart LR accTitle: UEFI Boot Flow vs NERF Takeover accDescr: Standard DXE flow compared against the NERF Linux kernel takeover point. subgraph Standard_UEFI["标准 UEFI 引导流程"] SEC["SEC / PEI 阶段 (硬件初始化)"] --> DXE_Core["DXE 驱动分派器"] DXE_Core --> Drivers["硬件驱动 DXE (网卡/存储/协议栈)"] Drivers --> BootMgr["Boot Manager DXE"] BootMgr --> OS_Runtime["最终 OS 运行环境 + UEFI Runtime"] end subgraph NERF_Takeover["NERF 替换方案"] SEC2["SEC / PEI 阶段"] --> DXE_Core2["DXE 接口"] DXE_Core2 --> NERF_Payload["Linux 内核 Payload (伪装为 DXE Boot Manager)"] NERF_Payload --> Clean_OS["完全掌控硬件的纯净系统"] end ``` DXE 阶段具备规范且文档完备的标准接口,各类 DXE 硬件驱动(存储驱动、网卡驱动等)均挂载其上。更关键的是,UEFI 的引导管理器(Boot Manager)本质上也就是一个特殊的 DXE 驱动模块,唯一的区别在于其他驱动执行完后都会向调度器返回控制权,而 Boot Manager 一旦接管流程,就会负责加载上层操作系统(如通过 GRUB),并且不再向调度器返回。但标准 UEFI 在交权之后,依然会在后台保留 UEFI OS Runtime 模块并持续潜伏运行。NERF 的应对方案非常直接:构建一个符合 DXE 标准接口规范的小型 Linux 内核,直接替换掉原本的 UEFI 引导管理器与大量冗余驱动,从而在硬件初始化的最底层全面完成控制权接管。 > “这个 Boot Manager 符合这套定义极其明确的接口;因此我们所做的,就是构建一个同样符合该标准接口的 Linux 内核,然后用它直接把原有 BIOS 换掉。”(Ron Minnich) ### [19:46](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1186s) 缩短启动耗时与向开源引导方案的转向 以往用户在启动 PC 时,屏幕上往往会弹出一个巨大的画面询问“想要从哪里启动”、当前时间等一系列繁杂信息。在 NERF(Non-Extensible Reduced Firmware)架构中,这层复杂的逻辑直接由一个精简的 Linux 内核所取代。机器通电后直接跳入 Linux 内核,在现场楼上的测试节点上,启动时间大约只需 20 秒——前一天团队刚刚重新做过测试,并非传统固件所需的 8 分钟,而是实打实的 20 秒。在此基础上,系统运行基于 Go 语言构建的用户空间(u-root),其默认行为是先后执行 `dhclient`(获取网络配置)、`wget`(下载目标内核)以及 `kexec`(直接切换并执行新内核)。通过 100Mbps 网络向一台 Raspberry Pi 获取镜像,整套流程大概只要 3 秒钟。 演讲内容相比一周前发生了重大变化,原因是开源固件开发者 Trammell Hudson 一直在向 Ronald Minnich 极力建议。Minnich 提到,Hudson 不断提醒他:“这部分其实早就存在开源实现了,你应该直接把它替换掉。”因此团队决定采纳该方案,转而采用经过轻微改动的开源组件,使其能够更快速地完成引导。通过这种调整,团队预计能将原有的 20 秒启动耗时进一步大幅缩减。 ```mermaid flowchart LR accTitle: NERF 默认启动网络引导流 accDescr: 展示在 Linux 内核启动后,Go 语言用户空间执行 dhclient、wget 到 kexec 的串行流程 A["Linux 内核加载完成<约 20 秒>"] --> B["Go 用户空间 (u-root)"] subgraph BootAction ["用户空间默认操作 (约 3 秒)"] B --> C["dhclient: 获取 IP"] C --> D["wget: 下载目标内核"] D --> E["kexec: 切换执行目标内核"] end ``` --- ### [20:53](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1253s) 固件现实妥协与自动化构建工具 面对现代 x86 硬件极其封闭的现状,开发团队必须作出战术上的妥协。早年间在 LinuxBIOS 和后来的 coreboot 项目中,开发者尚可完全重写底层初始化代码;但如今即便是预装 coreboot 的 Chromebook,最底层的初始化也已经变成了厂商提供的二进制 Blob(Binary Blob)。Minnich 坦言,开源社区在未来几乎不可能再拿到那些被厂商严密保护的低层硬件初始化代码了,因此唯一的现实选择,是在 DXE(Driver Execution Environment)阶段的早期横切一刀,直接切除其后续庞大的运行时生态。 “我们只能部分解决这个问题,但有局部改进总好过一无所获,而且我们能彻底剔除 EFI 附带的所有运行时组件,这正是核心目标所在。”(Ronald Minnich 强调:“...partial is better than nothing and we can get rid of all the runtime components that come with EFI and that's really the goal.”) 为了便于社区构建,Trammell Hudson 针对其主持的 Heads 项目开发了一套 Makefile 与工具链,NERF 正在融合并借鉴这套方案,以实现针对不同主板自动化构建 NERF 固件镜像。目前,该方案已在 Dell PowerEdge R630 服务器、MinnowMax 单板机以及 OCP(Open Compute Project)计算节点上取得了良好的运行效果。 - **规避硬件琐碎差异**:做过底层固件开发的人都深知,即使是同一厂商的不同主板,硬件设计也会充满令人头痛的细微改动。例如在 AMD 平台上,厂商可能仅用一个 I/O Bridge 上的 GPIO 引脚来控制 DRAM 供电,但同一厂商的 5 块板子很可能分别接在 5 个完全不同的 GPIO 上。 - **标准化接口红利**:在切入 Linux 的分界线右侧,硬件平台已经被底层固件初始化为一个相对标准、功能完备的 x86 环境。团队最初以为必须为每款主板精细裁剪和适配专有内核,但实际验证发现,MinnowMax 这样的小型嵌入式板卡和大型 OCP 服务器居然能够平稳运行完全相同的 Linux 内核。 - **ACPI 与 BIOS 依赖**:合作者 Ryan O'Leary 曾提醒系统依然因 ACPI 表配置而对原厂 BIOS 存在依赖,但随着新架构设计的推进,这些紧耦合问题正逐步得到化解。 --- ### [23:23](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1403s) u-root:基于 Go 的极简用户空间设计 在用户空间的构建上,NERF 彻底舍弃了传统的 C 语言环境,转向完全由 Go 编写的 u-root。在 Google 内部,Go 语言在安全性与可靠性方面享有极高的信任度;相比于多年维护 Buildroot、BusyBox 陷入各种构建脚本与配置依赖泥潭的痛苦经历,Go 提供了极其干净的工程体验。u-root 在构建 initramfs 时支持两种截然不同的模式: ```mermaid flowchart TD accTitle: u-root 两种构建模式对比 accDescr: 比较 Mode 1 动态运行时编译与 Mode 2 AST 重写单二进制打包的差异 subgraph Mode1 ["模式一:源码动态编译模式 (~5.9MB)"] M1_A["打包 Go 工具链 + 源码 + 依赖包"] --> M1_B["系统启动执行命令"] M1_B --> M1_C["运行时即时编译 (~200ms)"] M1_C --> M1_D["常驻 RAMFS,后续调用近乎瞬间完成"] end subgraph Mode2 ["模式二:BusyBox 风格多调用单二进制 (~2MB)"] M2_A["AST 源码解析: package main -> package <cmd>"] --> M2_B["静态合并编译为单个二进制 (~15秒)"] M2_B --> M2_C["通过多符号链接 (Symlinks) 分发命令"] M2_C --> M2_D["依据 argv[0] 分发至对应内部函数"] end ``` 在第一种模式下,打包生成的 initramfs 直接内置了精简的 Go 工具链、所有命令的源代码及其依赖包。当操作系统启动并首次调用某个命令(如 `/bin/date`)时,系统会在运行时动态执行编译,耗时仅需约 200 毫秒;由于生成的可执行文件直接缓存于 RAMFS 中,随后的执行几乎瞬时完成。安全团队非常青睐这种模式,因为在启动后的系统上所有工具源码都完全透明可见。然而,该镜像在经过 LZMA 压缩后仍有约 5.9MB,这在 Flash 容量严苛的主板或性能孱弱的 ARM 处理器上并不适用。 为了解决体积瓶颈,u-root 提供了第二种“单二进制(multi-call binary)”模式,机制类似于 BusyBox: 1. **AST 重写机制**:利用 Go 语言标准库中的抽象语法树(`go/ast`)解析器,遍历每一个原本为独立独立程序(`package main`)的源码文件,将其动态重写为独立的命名包(如将 `ls` 重写为 `package ls`)。 2. **整合成单程序**:将所有重写后的模块统统编译进单一二进制文件中,根据执行时的 `argv[0]` 参数派发调用对应的命令函数。整个整合编译过程仅需 15 秒。 3. **原生跨平台支持**:Go 编译器原生内置跨平台编译能力,开发者无需折腾繁琐的交叉编译工具链,仅需设置环境变量 `GOARCH=arm` 即可直接输出目标架构文件。 4. **极小存储占用**:该模式不携带编译器和源代码,LZMA 压缩后的尺寸被大幅压减至 2MB,完美适配小容量 SPI Flash。 在启动逻辑方面,复杂的 init 脚本和多层 unit 文件被精简为一两个直观的 Go 程序。Minnich 指出自己早已放弃编写 Bash 脚本,全面改用 Go 处理系统初始化与自动化任务。借助这种轻量级启动机制,团队在 Chromebook 项目中甚至实现了“5 秒内直接启动到 X11 并拉起浏览器”的惊人速度。 --- ### [26:49](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1609s) 商业化展望与现场答疑:安全引导、coreboot 与微代码 针对 NERF 项目的前景,Minnich 表示目标是在 2018 年推动实际的服务器厂商将 NERF 作为出厂内置固件进行交付。对硬件客户而言,核心驱动力在于终于能拥有一套真正看得懂、启动飞快且具备可控安全性的固件方案。 随后现场进入提问环节: #### 关于 Secure Boot 与 TPM 测量引导 有参会者询问系统如何处理安全启动(Secure Boot)与 TPM。Minnich 明确表示:“我们不做 UEFI 那套 Secure Boot;如果要集成 TPM,我们大概会借鉴 Chromebook 的做法,因为事实证明它运转得非常好。”虽然 u-root 内部已经包含了一个使用 Go 编写的验证引导(Verified Boot)实现,但在当前尚未完全调通。他坦言 Trammell Hudson 对以测量引导(Measured Boot)为核心的 Heads 安全环境理解更深,后续在安全策略制定上会更多借鉴 Hudson 的思路。 #### 关于为何不直接采用 coreboot 现场参会者提问为何架构中没有使用 coreboot。Minnich 回应称,只要硬件允许,coreboot 始终是第一选择(如他在 MinnowMax 上能跑 coreboot 就会跑),但服务器生态有其特殊阻碍: “因为一直拿不到开启 QuickPath(QPI,英特尔高速互连总线)的技术文档,coreboot 已经在服务器平台上缺席了长达 12 年之久。” 正因如此,NERF 的核心价值在于让开源阵营在服务器领域撕开了一道口子,使开源固件能够尽可能深地渗透进现代服务器系统。“核心逻辑很简单:能用 coreboot 就坚持用 coreboot;如果由于硬件限制彻底被卡死,就退而求其次选择 NERF。” #### 关于 Intel 微代码(Microcode)的加载节点 对于微代码更新的提问,Minnich 解释了硬件层面的刚性制约:现代处理器的内存训练(Memory Training)极其复杂,开启 DRAM 控制器需要执行近十亿条指令,而这要求在此之前必须打上正确的处理器微代码补丁。因此,微代码加载这一步必须硬性保留在更早期的 PEI(Pre-EFI Initialization)阶段执行,无法拖延到 Linux 内核接管之后,这是绕不过去的客观物理限制。 ### [29:52](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1792s) 厂商实现问题与为何坚决选择 Linux 替代 UEFI 在进入问答环节之初,Ronald Minnich 补充说明了 DRAM 正常运作的相关机制发生在进入 DXE(驱动执行环境)层级之前,因此微码(microcode)层面我们目前确实无能为力。随后一位现场听众接过麦克风提问,认为演讲中指责的许多问题并不是 UEFI 规范本身固有的缺陷,而是各大硬件厂商糟糕甚至骇人的实现所致,比如在 SMM(系统管理模式)中塞入本不属于它的代码,或者在构建 EDK II 时默认开启了海量毫无必要的模块,而这些模块绝大多数在编译阶段是可以剔除的。 ```mermaid flowchart TD accTitle: UEFI 臃肿栈与 NERF 精简模式对比 accDescr: 对比传统 UEFI 包含的厂商专有闭源驱动与 NERF 仅保留必要引导后直接载入经受万亿级验证的 Linux 内核。 subgraph Traditional["传统厂商 UEFI 模式"] PEI1["PEI 阶段 (硬件初检/DRAM)"] --> DXE1["DXE 阶段 (数百个闭源驱动/网络/SMM)"] DXE1 --> OS1["载入操作系统 (偶发启动,验证稀少)"] end subgraph NERF["NERF / Linux 固件方案"] PEI2["PEI 阶段"] --> MiniDXE["极简 DXE (TianoCore DXE Core)"] MiniDXE --> LinuxFW["Linux 内核 + u-root (Initramfs)"] LinuxFW --> OS2["Kexec 极速载入目标 OS"] end ``` Minnich 认可厂商实现确实可以精简,但他指出,如果网卡厂商不提供驱动源码,用户在 DXE 阶段依然会被死死卡住。更核心的论据在于软件的工程验证强度。Minnich 以 Google 的规模为例提出反驳:根据公开数据,Google 拥有至少上百万台服务器,其 Linux 内核每天 24 小时都在超大规模生产环境下接受极高强度的实战测试,而 UEFI 在系统生命周期中只偶尔启动一次,根本不可能经历这种强度的测试与排错。 关于为何将 Linux 直接植入固件,Ronald Minnich 掷地有声地总结道:“I think there's a really strong case to say that that kernel that is so heavily tested and made performant should be the thing I put in firmware that that's my argument here and I've had good results for that since 1999 so I'm buying that argument.”(我认为有非常充分的理由说明,那个经受过如此严苛测试且高性能的内核,正是我应该放入固件的东西;这就是我的论点,而且我从 1999 年以来就凭借这个做法取得了极好的成果,所以我坚信这个论点。)他进一步补充,IBM 的 POWER9 同样直接在固件中运行 Linux,这种思路不仅早有先例,对 x86 而言也绝非不可行。对于听众提到的 EDK II 开源平台包(edk2 open platform package),Minnich 表示 Google 内部也有人在做跟进,但就他个人视角而言,在 PEI 阶段结束后立刻无缝切入 Linux,始终远胜于继续留在 UEFI 环境中。 - 厂商提供的专有 DXE 模块(如网卡驱动)往往缺乏源代码,导致开源固件定制陷入死局。 - Google 庞大的服务器集群为 Linux 内核提供了 24/7 的极端压力测试,其稳定性和性能表现远非启动时仅运行数秒的 UEFI 所能比拟。 - IBM POWER9 原生将 Linux 作为固件运行,证明该架构路径在大型企业级硬件中完全可行且成熟。 - NERF 项目中依然吸纳了 Intel 开源的 TianoCore 部分成果,包括 DXE 核心程序及两个实用工具软件。 --- ### [32:57](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1977s) 普通笔记本用户的落地实践与 Intel ME 的精简真相 一位普通笔记本用户提问:作为一个不碰服务器的普通个人用户,如果想要在笔记本上运行 NERF,是否需要向电脑厂商索取 UEFI 或 Intel ME(管理引擎)的源代码?Minnich 斩钉截铁地回答完全不需要,并且指出安全研究员 Trammell Hudson 的工作正是以普通笔记本为目标平台。 ```mermaid flowchart LR accTitle: Intel ME 固件精简过程 accDescr: 展示 ME 固件中仅必须保留经过 Intel 签名验证的 BUP 模块,其余网络与 Web 服务组件均可安全剔除。 subgraph FullME["原始 Intel ME 固件"] BUP["BUP 引导模块 (数字签名校验)"] WebSrv["内置独立 Web 服务器"] NetStack["带外网络协议栈"] OtherMod["其他非核心监控模块"] end subgraph CleanME["me_cleaner 处理后"] KeepBUP["保留 BUP (防止 30 分钟强制关机)"] end FullME -->|"me_cleaner 剔除未签名部分"| CleanME ``` Minnich 详细拆解了 Intel ME 能够被精简的物理机制:用户永远不可能拿到 Intel ME 的源代码,但这并不妨碍对它动手术。ME 固件最开头的初始化模块称为 BUP(Bringup),该模块受到 Intel 私钥的强签名保护,一旦篡改硬件将无法启动;但 BUP 之后附带的海量模块(包括臭名昭著的独立网络栈和微型 Web 服务器)其实并未纳入该签名校验范围。 通过开源工具 `me_cleaner`,研究人员剥离了 BUP 之外的所有额外模块。社区这两年最惊人的发现正是:只要保留合法的 BUP 模块,整个平台就能正常开机引导,并且打破了此前普遍存在的“30 分钟无 ME 响应强制关机”魔咒。Minnich 指出,过去 Trammell Hudson 试图在各种设备上适配 coreboot,但因为厂商对底层技术细节严密封锁,移植工作异常艰难;而 NERF 这种直接截断 UEFI 后期的方案,要远比从头移植 coreboot 容易上手得多。不过他也不忘调侃并告诫想要尝鲜的用户:“Make sure you're okay with the idea of turning your laptop into a brick and recovering from that because it's still early days right and anytime you do this stuff that can happen.”(在动手之前,你最好先做好把笔记本刷成砖头并能自己救砖的思想准备,因为这项技术尚处于早期阶段,随时都可能发生意外翻车。) - 用户改造笔记本完全不需要厂商提供 UEFI 或 ME 源码,仅需借助开源社区的 `me_cleaner` 脚本处理 BIOS 镜像。 - Intel ME 固件中仅有最开头的 BUP(Bringup)模块被签名保护,用以驱动硬件基础开机。 - `me_cleaner` 剔除了其余未签名功能模块后,主板仍能保持稳定运行,不会触发 30 分钟看门狗超时关机。 - 相比于从零适配 coreboot 的庞大工作量,NERF 方案为笔记本固件开源化提供了低门槛的替代路线。 --- ### [35:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=2100s) Purism、HAP 模式及 Intel ME 终极禁用的新突破 现场随后讨论起硬件厂商 Purism 在其 Librem 笔记本上声称“彻底禁用 Intel ME”的进展。听众询问这是否意味着此前演讲中提到的 ME 内置 Web 服务器后门问题已彻底解决。Minnich 确认了这一突破,并指出开源社区的推进速度极为惊人。`me_cleaner` 的工作负责移除实现 Web 服务器等网络功能的实体代码,而 Purism 的方案则更进一步,利用了泄露出的保留字段开启了 HAP(High Assurance Platform,高保障平台)模式。 Minnich 强调,不能孤立地看待 Purism 的成果,这是全球开源固件社区这几年接力深挖的延续。多方黑客与开发者的共同努力,正一步步走向彻底把 Intel ME 关进笼子的最终目标。当被问及这套清理方案是否适用于最新款的 Intel 处理器时,Minnich 坦言技术更迭快得令人目不暇接:“Like I say this was a different talk a week ago you know because we're learning more and more day in and day out fast moving project and we'd love to have anybody who wants to get involved get involved.”(就像我说的,哪怕仅仅一周以前,我这篇演讲的内容都会大不一样;我们每天都在发现新东西,这是一个飞速演进的项目,我们非常欢迎任何有志之士共同参与进来。) 此时一位观众举手补充了针对 Skylake 及更新平台的关键安全研究成果:从 Skylake 开始,Intel ME 的底层架构从过去晦涩的 ARC 架构精简指令集芯片换成了 x86 内核,上面运行着 Minix 3 操作系统;安全研究人员(如 Positive Technologies)通过对固件进行逆向工程,正是通过翻转一个保留的 HAP 禁用位(disablement bit),实现了在 BUP 执行完毕后让 ME 彻底停止运行。对于 Skylake 和 Kaby Lake 用户而言,他们终于可以直接彻底地关掉 ME。 在观众热烈的讨论中,现场工作人员提示演讲时间已经彻底用完,Minnich 笑着向全场致谢宣布散场:“I just got told in no uncertain terms to stop. Thanks all for attending and we again appreciate anything you want to do for this project thanks.”(现场工作人员刚刚已经毫不客气地勒令我必须立刻下台了。非常感谢大家的出席,我们由衷欢迎大家以各种方式为这个开源项目添砖加瓦,谢谢!) - Purism 利用美国国家安全局(NSA)制定的 HAP(High Assurance Platform)预留标志位,实现了硬件级别的 ME 深度挂起。 - Intel 从 Skylake 微架构开始将 ME 核心转为标准 x86 架构,并内嵌 Minix 3 操作系统作为控制核心。 - 安全研究团队逆向发现该配置位后,在 Skylake 及 Kaby Lake 平台实现了只要系统开机引导完成,便可将 ME 完全休眠关停。 - 针对固件后门的开源反制研究正以极快节奏推进,从单点清理代码演进为系统性禁用硬件管理引擎。 ## Notable quotes > [09:48](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=588s) 如果你们现在还不觉得害怕,那可能是我刚才讲得还不够清楚,因为我确实被吓到了,我认为眼下的处境非常糟糕。 — Ronald Minnich > [06:26](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=386s) The worry has been that you can make an exploit that can't ever be removed and again the only remediation is a shredder — Ronald Minnich > [00:00](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=0s) boot time from 8 minutes to 20 seconds and to be honest to my way of thinking that's the maybe the single least important part about this work — Ronald Minnich > [32:57](https://www.youtube.com/watch?v=iffTJ1vPCSo&t=1977s) Make sure you're okay with the idea of turning your laptop into a brick and recovering from that because it's still early days right and anytime you do this stuff that can happen. — Ronald Minnich ## Mentioned Ronald Minnich, Google, The Linux Foundation, UEFI, NERF, u-root, coreboot, LinuxBIOS, Go, Linux, Facebook, OCP, Intel ME, Intel, AMD, Minix 3, SMM, Jean-Marie Verdun, Guillaume, Trammell Hudson, Andrey Mirtchovski, Ryan O'Leary, Vassilios Ververis, Nicola Corna, me_cleaner, Two Sigma, Cisco, MinnowMax, Dell PowerEdge R630, Chromebook, IBM POWER9, EDK II, TianoCore, Purism, Librem, Positive Technologies, Heads, Raspberry Pi, FreeBSD, Plan 9, Harvey ## Video description Replace Your Exploit-Ridden Firmware with Linux - Ronald Minnich, Google With the WikiLeaks release of the vault7 material, the security of the UEFI (Unified Extensible Firmware Interface) firmware used in most PCs and laptops is once again a concern. UEFI is a proprietary and closed-source operating system, with a codebase almost as large as the Linux kernel, that runs when the system is powered on and continues to run after it boots the OS (hence its designation as a “Ring -2 hypervisor"). It is a great place to hide exploits since it never stops running, and these exploits are undetectable by kernels and programs. Our answer to this is NERF (Non-Extensible Reduced Firmware), an open source software system developed at Google to replace almost all of UEFI firmware with a tiny Linux kernel and initramfs. The initramfs file system contains an init and command line utilities from the u-root project (http://u-root.tk/), which are written in the Go language. About Ronald G. Minnich Ron Minnich is a Software Engineer at Google. He has contributed to many open source projects in the last several decades, including the Linux kernel (9p file system); the FreeBSD kernel (rfork); and Plan 9 (many different areas). He directed the team that ported Plan 9 to the Blue Gene supercomputers. He invented LinuxBIOS (now called coreboot) in 1999. He is one of the core contributors to the Harvey operating system. His most recent Linux Foundation talk was on how to build your own signed version of ChromeOS and resign your Chromebook with your personal keys in 2016. [Source](https://www.youtube.com/watch?v=iffTJ1vPCSo)

Source quotes

[9:48] Ronald Minnich: 如果你们现在还不觉得害怕,那可能是我刚才讲得还不够清楚,因为我确实被吓到了,我认为眼下的处境非常糟糕。 [6:26] Ronald Minnich: The worry has been that you can make an exploit that can't ever be removed and again the only remediation is a shredder [0:00] Ronald Minnich: boot time from 8 minutes to 20 seconds and to be honest to my way of thinking that's the maybe the single least important part about this work [32:57] Ronald Minnich: Make sure you're okay with the idea of turning your laptop into a brick and recovering from that because it's still early days right and anytime you do this stuff that can happen.

Source quotes

[11:13] Ronald Minnich: We consider extensibility harmful, so NERF stands for Non-Extensible Reduced Firmware. [17:00] Ronald Minnich: When Linux is running, EFI is running, and that's the thing we don't like; that's the thing we're trying to get rid of.

Original transcript

[0:00] wow those lights are bright [0:01] um hi my name is Ron Minnick I work at [0:03] Google [0:05] and my talk today is about replacing [0:07] your exploit ridden firmware with a [0:09] Linux kernel now for the past 10 years [0:11] when I've talked about firmware [0:13] people have gotten used to assuming that [0:15] I'm wearing my core boot hat which is a [0:17] core boot hat it's very nice hat I am [0:19] not wearing my core boot hat today [0:22] this is very much not a core boot talk [0:24] we have a couple Partners I need to [0:26] mention [0:27] um [0:28] tour in the audience here today Sean [0:30] Marie Verdon and I'm going to slaughter [0:32] the names with my terrible accent and [0:34] Guillaume and um [0:36] we have several people working who've [0:38] worked on this at Google and then [0:39] Trammel Hudson from two Cigna who's been [0:42] very important and Andre murkowsky at [0:43] Cisco who helped a lot with the Go part [0:45] I'll describe in a bit [0:48] uh going to start with the results we [0:51] had a Facebook compute node which I'm [0:54] calling the ocp node up in our booth and [0:58] we got the boot time from 8 minutes to [0:59] 20 seconds and to be honest [1:02] to my way of thinking that's the maybe [1:04] the single least important part about [1:06] this work and you'll see why I'm saying [1:08] that in a minute [1:09] all the user land is written in ghosts [1:11] we have a kernel and an emit Ram fs and [1:14] Flash [1:15] and the user land for that and it [1:17] ramfest is all Go including a net [1:20] this brings Linux performance [1:21] reliability and I forgot to say security [1:23] to Firmware [1:25] and a key point of this and you'll see [1:27] what I mean by this in a minute is we [1:29] eliminate all of the uafi and me post [1:32] boot activity [1:34] here's the problem [1:36] when we began Linux you know we all you [1:39] know joined it in the 90s it controlled [1:42] everything about the x86 platform it was [1:44] classic Intel 586 processor [1:47] but where we are today [1:50] between Linux and Hardware there are at [1:52] least two and a half kernels [1:54] and there are complete proprietary and [1:57] not surprisingly based on that they're [1:58] exploit friendly it's pretty easy to [2:01] write exploits for these other operating [2:02] systems [2:03] these run at a higher privilege level [2:06] than Linux [2:07] they can control and manipulate Linux [2:10] and those exploits can persist so unlike [2:12] the kind of exploits where you write you [2:15] know something to the disk and we can [2:16] always get out from under that by [2:17] formatting the disk again these exploits [2:20] can be placed in the operating the [2:22] motherboard Flash and you're never going [2:24] to get them out [2:25] so once they're in there [2:27] maybe one of your options is you shred [2:29] your motherboard because there's just no [2:30] other way out of the problem [2:32] I used to give this talk and the title [2:35] was if you trust your computer you're [2:36] crazy [2:37] uh fortunately hopefully I'm going to [2:39] talk about ways to deal with some of [2:41] these problems so we can stop being [2:43] crazy and maybe get a little sane [2:46] so here are the operating systems and [2:48] you know there's the one you're used to [2:52] which is ring zero Linux and then [2:54] there's ring minus one we call that ring [2:56] minus one it's never really been ring [2:57] minus one but basically we kind of ran [3:00] out of ring numbers so fine it's ring [3:02] minus one and so we've come to call the [3:04] other two [3:06] uh ring minus two and ring minus three [3:08] the ring minus two kernel and half [3:10] kernel control everything about the CPU [3:13] I call system manage mode a half kernel [3:16] because it traps the 8086 16-bit mode [3:18] every time you close your lid or do [3:21] certain other things on your Mac or on [3:23] your laptop it's probably trapping to [3:25] 8086 classic 16-bit Mode that should [3:28] make you happy right no protections at [3:30] all in that mode and then there's the [3:32] UEFI kernel running in 64-bit page mode [3:35] and sometimes things trapped smm and pop [3:37] out in UEFI so Linux isn't even running [3:40] at that point [3:42] and then there's ring minus three and [3:43] this is the one that has people really [3:45] worried this is there are three 8086 [3:48] CPUs on your die usually [3:50] one's called the management engine and [3:52] that's the one of concern [3:54] the other one is called the integrated [3:55] sensor Hub we're not going to worry [3:56] about that today and I don't know why I [3:59] really love the name of the other one [4:00] it's the Innovation engine [4:03] I just every time I say that I kind of [4:05] have to laugh a little the me though [4:07] runs Minix three [4:09] and that's why this is the year of Minix [4:10] on the desktop because if you add up all [4:12] the nodes running Windows and all the [4:13] nodes running Linux that's less than all [4:15] the nodes running minix3 which uh I [4:18] guess Andy Tannenbaum would like to know [4:20] what's in ring minus two and ring minus [4:22] three IP stacks and there's no common [4:24] code between these as far as I can tell [4:25] file systems drivers this net USB and [4:28] mouse why do you have to have file [4:30] systems in the me because it can [4:31] re-image your node [4:33] um web servers there's a web server in [4:35] the ring -3 8086 running Minix that was [4:38] the result you know that was the uh [4:40] thing you might have read about a recent [4:41] exploit with a zero length password [4:43] giving you full admin access to your [4:45] machine [4:46] and again these things can re-image your [4:48] workstation if it's turned off if it's [4:50] plugged into the wall and turned off and [4:52] on a net it'll get re-imaged maybe [4:53] without you knowing it [4:57] um here are some of the components of [4:58] the management engine I can't claim I [5:00] know what all these do [5:01] I can't claim to understand why there's [5:03] full Network manageability Regular [5:05] Network manageability and manageability [5:07] I don't know why you know small business [5:09] technology is in there what small [5:11] business technology meant originally [5:13] about 10 years ago is it's really [5:15] inconvenient to set up passwords so we [5:16] just don't have a password for the me [5:18] there's a thing in there called the [5:20] outbreak containment heuristic I don't [5:23] know if that comes from the movie and [5:25] then the protected audio video path [5:27] which at least some people claim to me [5:28] means DRM for audio and video [5:32] here is a great and these slides are [5:33] open and I'll mail them to you if you [5:35] don't catch them so don't worry about [5:36] copying this but facilius Rivera's about [5:38] 10 years ago did a fantastic Masters [5:40] thesis on me flaws and it was kind of [5:43] depressing because basically everything [5:45] could get attacked [5:46] and not all those have gotten fixed [5:49] so just for fun you can Google Intel me [5:51] exploit uh 50 million hits I kind of [5:54] enjoyed that and the wired headline was [5:56] pretty funny Intel fix is a critical bug [5:59] that lingered for seven dang years [6:01] uh you know and if you do the math [6:03] that's kind of like kind of a billion [6:05] machines [6:06] and you know the fix is just refresh [6:09] your firmware now how many people want [6:11] to believe that a billion machines have [6:13] been refetched since last spring with [6:14] new firmware to fix this bug I certainly [6:16] don't believe it I think I'm sure that [6:18] bug is still out there and the web [6:20] servers are still out there and you can [6:21] still send a lot of them a zero length [6:23] password and have admin access [6:26] the rig minus 2 half OS was originally [6:29] used for power management it came in [6:31] with the 486 here's the problem I have a [6:33] laptop based on a 486 running Dawson I [6:35] close the lid and I want it to sleep [6:38] Doss isn't going to do that and so what [6:40] they did is add a very high privilege [6:43] mode higher privilege than ring zero [6:44] that sort of can take over the machine [6:47] when certain events happen they're [6:48] called system management interrupts [6:50] and um [6:52] that stuff can take certain actions [6:55] um [6:56] and you know can't really go into all [6:59] the details it's a pretty long story but [7:00] all kinds of interrupts can go there so [7:02] if back in the day you had a kernel that [7:05] didn't support USB and you've plugged [7:06] the USB mouse in it and it worked it's [7:09] because of a full USB stack that exists [7:11] in system management mode [7:13] independent of every other piece of code [7:15] you've ever seen and that's why [7:16] sometimes maybe you'd plug a mouse in it [7:18] wouldn't work because USB stack didn't [7:21] support that particular Mouse [7:24] are there SMI exploits yeah there are a [7:26] lot of SMI exploits um and the big [7:28] problem with smm is the way in which it [7:32] works is once enabled you can't turn it [7:33] off as part of enabling it you set a bit [7:36] that essentially takes a big big chunk [7:38] of ram it makes it invisible to every [7:40] other operating mode [7:43] so it kind of it's a cloaking device [7:44] right it just vanishes this this memory [7:47] with its stuff in it so you kind of [7:49] can't really know what it's going to do [7:51] you can't disable it you can't turn it [7:53] off and it's hidden so it's a good way [7:55] to maintain vendor control over you [7:59] and finally there's ring -2 which is [8:02] UEFI that runs on the main CPU along [8:04] with smm this is an extremely complex [8:07] kernel and I think one source of the [8:09] exploits is that a lot of people that [8:11] say vendors are writing against this [8:13] kernel and don't really know all the [8:14] rules and they make mistakes [8:17] and the result is that there are big [8:19] giant holes that people can drive [8:21] exploits through [8:22] for the most part UEFI from what I can [8:25] tell the security model of security [8:27] how many people here have written code [8:28] for uafi I'm just curious [8:31] oh that is a lot [8:32] okay did you like it [8:35] okay so I never liked it personally but [8:37] I'm just curious are there uafi exploits [8:40] oh my gosh there are ufi exploits um and [8:43] kind of the weird thing about uafi the [8:45] model has always been that it's so darn [8:47] smart [8:48] that a kernel can sort of drop random [8:50] bits of UEFI update into memory and then [8:53] pull this chain and ufi will update [8:55] itself perfectly there are no bugs in [8:57] this process and of course there are [8:58] bugs because we all write code with bugs [9:00] and um [9:02] the worry for me has always been that [9:06] you know we get an exploited uafi [9:08] written and then we go and say hey I [9:10] don't like you you if I update yourself [9:11] but it's an exploited UA fine it says [9:13] sure I updated myself but it doesn't [9:16] so the worry has been that you can make [9:18] an exploit that can't ever be removed [9:20] and again the only remediation is a [9:22] shredder [9:24] here are some of the UEFI components I [9:27] this is on the ocp Node which is a [9:30] pretty limited node I am told that there [9:32] can be hundreds of these [9:35] um and just look at some of this stuff [9:36] there's USB stack there's an ip6 and ip4 [9:39] protocol stuff has anybody here got a [9:42] machine with an Isa bus just curious [9:44] there's Isa bus support in case you find [9:46] something from long ago [9:48] there's just a lot of stuff in there IDE [9:50] you know and all this stuff is pulling i [9:53] o driven it's got lots of delays built [9:56] in okay it's very very primitive drivers [9:59] and that's one reason it's so slow to [10:01] boot [10:03] so we've got these two and a half hid no [10:05] S's [10:06] um they have a lot of capabilities they [10:08] have Network stacks and web servers they [10:10] Implement self-modifying code that can [10:12] persist across power Cycles [10:14] and reinstalls they hide have bugs they [10:17] can control Linux and you know my [10:18] reaction and exploits of course have [10:20] happened and so this is where my old [10:21] talk used to end right are you scared [10:23] yet you know if you're not scared yet [10:25] maybe I didn't explain it very well [10:27] because I sure am scared I think this is [10:29] a bad situation [10:31] so how do we fix this mess now [10:33] eventually or every once in a while [10:35] someone comes to me and says AMD this [10:37] isn't a problem on AMD that's completely [10:39] wrong it did not used to be wrong it is [10:41] wrong now you really can't just move AMD [10:44] and have everything work people say to [10:45] me but ryzen is totally open that's only [10:48] partially true some of the weirder bits [10:49] of EFI and the AMD processors are moved [10:52] to something called the platform [10:53] security process or [10:55] the PSP kind of brings up dram not the [10:58] main processor and the PSP code to bring [11:00] up dram will never be released [11:02] so [11:03] kind of AMD is more open in the things [11:05] that are open but it's not open in a [11:07] sense of things closed on Intel are [11:09] still things closed on AMD if that makes [11:11] any sense [11:13] so we're focusing on Intel x86 and [11:16] partly that's just my bias that's the [11:17] processors I use [11:19] and and the goal here is to reduce the [11:22] scope of the two and a half os's and I [11:23] will say that a lot of what we're doing [11:25] here will apply to AMD processors just [11:27] not the management engine parts [11:30] this project is called Nerf uh UEFI [11:33] stands for unified extensible firmware [11:35] interface we consider extensibility [11:37] harmful so Nerf stands for non-extensive [11:39] or reduced firmware [11:42] whoops wrong way [11:44] the goal is you make firmware less [11:46] capable of doing harm you make the [11:48] things it does do very visible we get [11:50] rid of all those runtime components in [11:52] the management engine and UEFI [11:55] and in particular you know it's hard to [11:57] kill everything the me does your node [11:59] won't turn on in many cases but we did [12:00] take away its web server and ipstack [12:02] good thing to do in my opinion [12:05] um [12:06] and we also removed the uefiip stack and [12:09] other drivers it might have so and [12:11] finally we removed our ability to [12:12] reflash themselves we don't want them [12:13] doing that so they don't [12:16] Linux should manage this stuff right [12:18] there [12:19] probably 30 million plus Chromebooks out [12:21] there and when your Chromebook gets a [12:22] new bios image Linux reflashes that [12:25] image that works I haven't heard of any [12:27] problems like we had with EFI where [12:30] someone tried to boot Linux on EFI and [12:32] brick the machine that used to happen a [12:34] lot it doesn't happen with Chromebooks [12:37] so the pieces of Nerf are a d blob [12:40] demi-rom a UEFI ROM reduced to its most [12:43] basic parts we disable system management [12:45] node or we Vector it to Linux [12:49] a Linux kernel and then a user land [12:50] written and go and for anybody here [12:53] doing go [12:55] we really welcome anyone who wants to [12:57] join just the Go part of this project [12:58] and nothing else so this to be in part [13:01] of and contributing to this project [13:02] doesn't mean you have to be a kernel [13:03] person or a firmware person there's a [13:05] significant user land activity too [13:09] so we don't want the Emmy at all you [13:12] can't get rid of the enemy it's on the [13:13] die the Emmy is the first thing that [13:15] turns on when you turn on the chip the [13:17] Emmy starts all the clocks up on the [13:19] later processors there's a reset Vector [13:21] the main CPU fetches it the me feeds [13:23] that Vector to the CPU in a lot of cases [13:25] the Emmy is not going to go away [13:28] it's there for good if you remove the me [13:31] firmware your node may never work again [13:33] it may not turn on in a lot of cases [13:36] it'll turn on and turn itself off in 30 [13:38] minutes and the idea there is the Emmy [13:40] says something's wrong with firmware [13:41] I'll give you 30 minutes to fix it and [13:43] then I'll turn off [13:44] okay so you know you really really can't [13:47] kill it but two and a half years or so [13:49] ago tram Hudson started looking at the [13:52] me firmware and he learned a lot about [13:53] it and since that point there have been [13:55] other people kind of breaking this stuff [13:57] open [13:58] and boy we've learned a lot [14:00] um [14:00] but the big thing is Nicholas Corona [14:03] wrote a thing called the me cleaner in [14:04] Python [14:06] and on a neat little system like the [14:07] Minimax this 159 I really love minimax's [14:11] board [14:12] um it has an eight Meg flash believe it [14:14] or not five Mega that flash is just for [14:16] the me if you run the me cleaner on that [14:19] thing 300K of it is left [14:22] so out of that five Meg you really only [14:24] three need 300K to boot Linux on that [14:26] platform [14:28] and again it removes the web server and [14:30] the IP stack and all those things you [14:31] really don't want it doing I should [14:33] mention that server platform is not [14:36] completely solved if I run any cleaner [14:37] on the SCP node ocp node won't turn on [14:39] don't know why yet but that's something [14:41] we're going to plan to work on in [14:42] November [14:44] here's what sort of the the components [14:47] of that me image look like on the [14:49] Minimax well as you can see buff boot up [14:53] kernel I assume that's Minix three uh [14:56] there's some interesting names in here [14:57] policy RSA fpm you know just random [15:00] stuff that kind of make you worry a [15:02] little right because Nick one of the [15:04] things that people have found is this [15:06] fair amount of zero days and anything [15:07] related to networking in the Emmy as [15:09] well as in anything related to RSA [15:13] on the ocp this is what it looks like [15:15] again see the funniness there there's [15:17] buff and buff okay so it's kind of like [15:20] a bump that that kind of is there for a [15:22] lot of stuff and then sort of I guess a [15:24] sub bump that also has to run an Emmy [15:27] cleaner seems to remove everything after [15:28] the first buff and that's why it won't [15:30] turn on [15:32] so that's the me and we've made that [15:34] work on the Minimax and a number of [15:36] other boards so let's move on to smm [15:40] if you get into the game early enough [15:42] and we think our Linux kernel is getting [15:44] in early enough we can completely [15:46] disable smm now [15:49] back in the day when we had Linux bios [15:51] which is you know the 1999 to 2007 or so [15:55] named for core boot we ran thousands of [15:57] compute nodes at Los Alamos with no smm [16:00] and we had a nice conversation once with [16:02] an x86 vendor who claimed that it was [16:04] impossible [16:06] to run a server node with smm turned off [16:08] and we said well you'll have to talk to [16:10] Linux networks about their 100 000 [16:12] servers they've sold with smm turned off [16:14] and explained to them that it can't work [16:15] but it's working fine for us too [16:18] so as far as I know there's no [16:20] requirement in most cases to run system [16:22] managed mode it is there vendors use it [16:25] to do value add which means stuff that [16:27] locks you into that particular vendor I [16:30] don't think we need it [16:31] but let's pretend we have a node for [16:33] whatever reason that it turns out we [16:35] have to have it I've worked on I've [16:38] developed some stuff that allows you to [16:39] Vector an SM interrupt into the Linux [16:41] kernel [16:42] so this is kind of nice because the SM [16:44] interrupt now becomes like any other [16:46] sort of interrupt and we can manage it [16:48] in Linux not in Hidden code off [16:50] somewhere in the chipset [16:51] so we kind of have two approaches kill [16:53] smm or vector it to Linux but keep Linux [16:56] in control is the theme Here [17:00] onto uafi ufi is huge it's extremely [17:03] complex we find a lot of errors in [17:06] programming of it just for that reason [17:07] there are some things that still seem to [17:09] need to go there on some platforms so [17:11] single error correction Double Arrow [17:13] detection interrupts seem to want to go [17:14] to UEFI uh maybe that's not as true as [17:18] it used to be but it is it you know it's [17:20] possible but [17:21] we really want to remove all the [17:23] opportunities to put exploits into UEFI [17:25] and that remains removing most of UEFI [17:27] so it was the unified extensible [17:29] firmware interface we make it [17:31] non-extensible [17:33] here again are some of the UEFI [17:35] components [17:36] by the way um [17:39] that digital thermometer sensor that's [17:41] not a typo that's right out of the thing [17:42] I don't know what a thermometer is some [17:44] maybe someone here knows but I haven't [17:45] quite worked it out [17:47] here are some of the UEFI components and [17:49] this is an eye chart and you don't need [17:51] you won't be tested on this and you [17:52] probably don't even want to know but [17:55] there's a lot of stuff here right and if [17:58] it looks like a kernel well it is a [17:59] kernel it's a big kernel it's actually a [18:02] sizeable fraction of the size of Linux [18:06] so here's here's what we do here's the [18:08] standard UEFI Boot Steps [18:11] over here is the security phase and [18:14] security you kind of start up in 16-bit [18:16] mode and do some other things and verify [18:18] the processor and it chipset and it and [18:20] board and it bits okay and this is where [18:23] lots of stuff happens that you are never [18:24] going to find out about [18:26] that's just highly proprietary stuff the [18:28] vendors hold this very tight they don't [18:30] even distribute information about what [18:32] this means widely in the vendor [18:34] but here's the neat part [18:36] they've done a good job with that [18:38] interface this is a very well-defined [18:40] interface documented all the code [18:43] follows the rules and this is the [18:45] so-called driver [18:46] execution environment [18:48] this thing conforms to that interface [18:51] all these dxes conform to it and this [18:53] thing called the boot manager conforms [18:55] to it and the boot manager is just [18:56] another kind of DXE the big difference [18:58] being that notice these all have an [19:00] arrow coming back and that one doesn't [19:02] so it runs a bunch of these then it pops [19:05] into this doesn't expect it to return [19:07] and this guy loads your OS [19:11] this red box here you could think of as [19:13] grub here's the thing that should worry [19:14] you a little final OS environment run [19:17] time what is that [19:19] well that's an eif iOS present app again [19:22] when Linux is running EFI is running [19:25] and that's the thing we don't like [19:26] that's the thing we're trying to get rid [19:28] of [19:29] so again I mentioned that that boot [19:32] manager conforms to this well-defined [19:35] interface okay [19:37] so what we do [19:39] we build a Linux kernel that conforms to [19:41] that well-defined interface and we [19:43] replace the BIOS with that [19:46] um I guess to everybody here is booted [19:48] to PC and seen that big screen that says [19:50] what do you want to boot from and what [19:51] time it is and all that stuff [19:53] that becomes this Linux kernel [19:57] so you pop into the Linux kernel and [19:58] Away you go and on the Node upstairs [20:00] it's about 20 seconds we timed it again [20:02] yesterday not 8 minutes 20 seconds and [20:05] again on a note upstairs what we have is [20:07] this go-based user land and the default [20:08] action of that is to run a DH client a w [20:11] get to get the kernel and then a k exec [20:14] all that stuff's written in go and [20:16] that's about a three second process over [20:17] 100 megabits to a Raspberry Pi [20:20] now tram's been leaning on me really [20:23] hard and so as a result this is actually [20:25] a different talk than it was a week ago [20:28] um keeps saying hey [20:30] this actually exists in an open source [20:32] form [20:33] you should replace that and so we've [20:35] decided that's what we're going to do [20:37] and so this is an open source thing that [20:42] is slightly modified so that it really [20:44] knows how to boot that even faster and [20:46] we think we're going to be able to shave [20:47] that 20 seconds down to a lot less time [20:50] which I think is you know all to the [20:52] good [20:53] so that's where we're headed so again [20:57] we can't fix this stuff okay this is [21:00] what we did in the old days with Linux [21:02] bios and then core boot we rewrote this [21:04] even on Chromebooks that run core boot [21:07] that nowadays is a binary blob and we're [21:10] not going to get that stuff again I [21:12] really don't see how it's going to [21:13] happen so the only real option [21:16] is to put ourselves oh I'm not doing so [21:18] over this 400 put ourselves right there [21:20] at the line that runs through that green [21:21] Dixie core oval so as I said we can fix [21:25] this problem partially [21:26] but partial is better than nothing and [21:29] we can get rid of all the runtime [21:30] components that come with EFI and that's [21:32] really the goal [21:36] so how do you rebuild bits of EFI and [21:38] again these slides are going to be [21:39] distributed you don't have to type real [21:41] fast to try and copy them trans done [21:44] some real nice work with with building a [21:46] kind of set of make files and things to [21:48] automate his heads thing [21:50] and part of his heads thing is part of [21:52] what we're doing with Nerf so we're [21:53] going to be building what he does to [21:56] allow you to really kind of automate [21:57] building a Nerf image for your [21:59] motherboard [22:00] um [22:01] we've had some good results on a Dell [22:03] r630 [22:05] as well as the Minimax as well as the [22:07] ocp nodes [22:09] so um [22:11] anyway that's kind of where where we are [22:13] with this [22:15] so using Linux makes firmware a lot [22:17] easier if you're ever done firmware you [22:19] know that with every little board there [22:21] are all these tweaks you have to do I [22:23] mean the simplest one is so it might be [22:25] on an AMD a gpio and that single gpio [22:28] on a on an i o bridge is used to turn on [22:31] memory let's just say [22:33] I've had cases where if five different [22:35] boards from the same vendor and every [22:37] time they use a different gpio so that [22:39] even trivial trivial changes make your [22:41] life really difficult but what is [22:43] another nice thing about that defined [22:45] interface we have is on the on the right [22:47] side of the interface when we start [22:48] Linux that's a pretty standard x86 [22:50] platform and it's functional so we [22:52] thought for a long time we were going to [22:54] have to finally tune the kernel for each [22:56] of these boards we're on I've used the [22:58] same kernel for the Minimax which is a [23:00] tiny thing in the ocp which is a very [23:01] big thing and it's worked fine so this [23:04] actually makes our life a little easier [23:06] um one of the particip Ryan O'Leary [23:09] wanted me to mention actually though [23:11] that [23:13] um actually what he's what he wanted me [23:14] to mention is no longer true because of [23:15] changing plans we were slightly tied to [23:17] the BIOS vendor because of acpi setup I [23:20] think some of those issues are going to [23:21] go away [23:23] so I wanted to just talk a little bit [23:24] about user space [23:27] our users face is written in go [23:30] and um [23:34] there are a lot of reasons for that [23:37] we we tend to trust go a lot more than C [23:39] at Google it's really viewed with favor [23:43] if you can [23:44] have a thing and see and instead have a [23:46] thing and go I spent many years with [23:48] Bill brute and BusyBox and all those [23:51] things and I started this year route [23:52] project about six years ago when I sort [23:55] of had yet again another build route [23:56] failure and I just got tired of trying [23:58] to figure out all the config scripts and [24:00] stuff so all our all our commands are [24:02] written and go and um in sort of mode [24:05] one for your route in fact when we build [24:07] on a knit Ram FS it includes the go tool [24:10] chain all the packages needed to build [24:12] all the commands all the command source [24:14] and when you boot and then commands [24:16] start running they're dynamically [24:17] compiled [24:19] it typically takes about 200 [24:21] milliseconds to build a command like bin [24:22] date since we're putting this in a ram [24:24] FS after that it's just essentially [24:26] instantaneous to run [24:28] so that's [24:30] um the security guys really like this [24:31] because you bring a machine up and all [24:33] the sources visible and we kind of bring [24:34] along you know everything that's needed [24:36] but it's a 5.9 Mega nit Ram FS even lcma [24:40] compressed so sometimes there just is [24:42] not enough room and so um [24:46] or you've got a really slow processor [24:47] like an arm and you really don't want to [24:49] get a compilation step even a fast one [24:50] in a way of booting so we have a [24:53] different mode we have one program and [24:56] many Sim links which should be familiar [24:57] to anyone who's used BusyBox so it's [25:00] kind of a multi-point binary so you type [25:02] LS and it actually runs the same command [25:04] it looks at arc V of zero and then it [25:06] calls a function named LS and what we do [25:09] here is we use the go abstract syntax [25:12] tree package to rewrite commands in the [25:14] packages so I have a command called LS [25:15] it's package Main [25:17] we actually parse that with AST and [25:19] rewrite that to package LS get all those [25:22] packages we compile them all into one [25:24] binary that takes 15 seconds [25:26] now the thing about go is [25:28] every compiler instance supports all the [25:31] architecture and Os combinations you can [25:32] think of so you'd never do a cross tool [25:35] build again you get the go compiler if [25:37] you want to compile for arm go Arc equal [25:39] arm run your compilation you've got an [25:42] arm binary so that's really kind of [25:44] Handy [25:45] in this mode of course we don't include [25:47] the the source code or the tool chain [25:48] but it does reduce the footprint to two [25:50] Meg and this is really handy again when [25:52] flash space is limited [25:55] there's kind of an interesting [25:57] implication here for startup which is [25:58] that all the init scripts uh get [26:00] replaced with one go program one or two [26:02] and that leads to things coming up [26:04] really fast and at least from my point [26:06] of view I don't need to look at unit [26:09] files and scripts and stuff right I look [26:10] at one program for whatever platform I'm [26:12] on and I understand that the boot up and [26:14] it's really fast so [26:16] um [26:17] we actually have a project for [26:19] Chromebooks where we can boot to X11 in [26:21] a browser in five seconds and you know [26:23] this speed is part of that [26:25] so um [26:27] I don't know I this this is leading to [26:29] some other thoughts about maybe how we [26:31] do things you know in normal machines [26:32] right we just basically use go to write [26:35] the init thing and we're done so go is a [26:38] compiled language but it's frequently [26:40] used for scripting that's why I use it [26:41] all the time I stopped writing bash [26:44] scripts years ago I just write go [26:45] programs it's actually easier and more [26:47] reliable [26:49] so anyway I I kind of pushed a little [26:51] hard to get through this because because [26:53] I wanted to cover questions I literally [26:55] have to leave here right at five o'clock [26:56] to catch a taxi [26:58] um and I just wanted to see if anyone [27:00] had any comments or thoughts or [27:02] questions about this project where we [27:04] are going is we hope in 2018 to have [27:07] some actual companies using this and [27:08] shipping nodes with this embedded in it [27:10] and the reason they want it is they want [27:12] to have firmware they understand and it [27:14] has a fastboot and is secure [27:17] um and with that I'll stop and see if [27:19] anyone has any questions [27:21] oh yeah [27:35] yeah so we're not we don't do secure [27:37] boot um and I think if we use TPM we'll [27:40] probably try and look at how the [27:42] Chromebooks do it because that's worked [27:43] really well there is a verified boot [27:45] written and go that's part of your route [27:47] now that doesn't work I must say [27:49] um but we'd really like to look at at [27:51] going that the track that you that [27:53] Chrome OS took with with their use of [27:55] TPM and not the secure boot stuff [27:58] and to be honest with you you're you're [28:00] skirting right at the edge of what I [28:02] really understand so that may not be as [28:04] good an answer as you'd like but it is [28:06] something we definitely will be looking [28:07] at how to how to handle that and tram is [28:09] I should say tram is very concerned [28:11] about this heads is part of a secure [28:12] environment that he's building and [28:15] um he really has a much better [28:16] understanding of measured boots than I [28:18] do so to some extent I'm going to follow [28:19] his lead [28:21] but that's a good question [28:24] oh yeah I'm back here [28:29] I'm sorry core boot is not in here [28:37] no I so here's here's the mic [28:40] um my take on this is that core boot is [28:44] always preferred I always prefer core [28:46] boot right so on the Minimax when I can [28:48] run core boot I do [28:49] but there are situations where Corbin's [28:51] just not going to work core boot has not [28:53] been on server platforms for 12 years [28:54] because of this problem because we [28:56] couldn't get the information on how to [28:57] turn on quick path [28:59] so we're back on server [29:01] and and I think that's the the important [29:03] thing about this is we are now back in [29:05] an area with with sort of open sourcing [29:07] the BIOS as deep as we can [29:10] and on server and that that just hasn't [29:13] been true for a very long time [29:15] so that that's my idea it always use [29:18] core boot if you can if you're stuck [29:20] with a situation like this look at Nerf [29:22] that that's that's how I'm attacking [29:24] this yeah [29:29] we don't uh question was about Intel [29:31] microcode updates here's the issue [29:33] on many processors now to turn on dram [29:37] which is essentially a billion [29:38] instructions for the training step you [29:40] have to have the right microcode loaded [29:43] so that microcode load has to happen in [29:45] that second thing that Pei step [29:48] so we there's nothing we can do about [29:49] that right if they're going to turn on [29:51] dram they need the microcode that makes [29:52] dram work correctly and that happens [29:54] before we get into this into this uh DXE [29:58] level [29:59] so there's we can't really do much about [30:00] microcode [30:06] so any other question oh yeah [30:10] um [30:12] I don't even know if this mic works [30:13] actually I haven't tried it [30:15] does this yes this mic works [30:19] so more of a general comment [30:22] um a lot of the things that you seem to [30:23] be complaining about [30:25] aren't part of the EFI specification but [30:27] rather things that vendors have done [30:29] that are sub-optimal or horrific like [30:32] the use of SMN for things that should [30:33] never be in smm enabling tons of modules [30:36] in their edk2 build that are unnecessary [30:39] and that kind of thing because you can [30:41] compile out all those majority of those [30:44] modules in edk well [30:46] you can compile the Dixies that sources [30:49] available for from a vendor for their [30:50] network card let's say if they don't [30:52] give you that Source you're stuck right [30:54] and we have enough of them and further [30:57] um I mean your point it's good point [30:59] right yes you can fix a lot of this but [31:01] the Counterpoint is [31:03] take a company like Google which you [31:05] know in published terms has at least a [31:07] million machines in its Fleet the Google [31:09] Linux compiler is tested at scale 24 7. [31:13] when we boot EFI it's very infrequent so [31:16] that testing is not nearly as strong [31:18] so I think there's a really strong case [31:20] to say that that kernel that is so [31:22] heavily tested and made performant [31:24] should be the thing I put in firmware [31:26] that that's my argument here and um I've [31:29] had good results for that since 1999 so [31:32] I'm buying that argument uh so that but [31:34] you know I take your point but if you [31:35] look at the power 9 for example IBM [31:37] power 9 dayfoot Linux and firmware [31:40] so this is this is not really [31:42] I have to say this is not a novel idea [31:44] it's a novel for x86 even though we've [31:47] done it for a long time but it's not an [31:49] awful idea in general [31:52] um just yeah one follow-on from that [31:53] yeah bits that you said you were you had [31:56] a repository of Open Source bits for the [31:57] firmware have you interacted at all with [31:59] the edk2 open platform package where [32:02] they have lots of they're trying to [32:04] Upstream open source platform support [32:06] into edk2 for a variety of arm and x86 [32:09] platforms yeah I think I think [32:12] I mean there are a number of companies [32:14] as an entity that are doing that and I [32:16] think there are people at Google doing [32:17] that but I also think that when we kind [32:19] of look at the overall picture we at [32:21] least me personally I shouldn't say I'm [32:23] speaking for Google at this point [32:25] um Linux to me makes far more sense as [32:27] the thing to start at the end of Pei [32:28] than the new AFI sure I just mentioned [32:30] the bits that you mentioned that you had [32:31] open source yeah Tiano Tiano court and [32:34] again to Intel's credit Tiano core was [32:36] open sourced and there are a lot of [32:38] pieces there that actually we use [32:40] um the Dixie core and there are two [32:41] utility programs but in the end we want [32:44] to get into Linux and firmware as soon [32:46] as we can fair enough yeah thanks [32:48] um did you have a question back there no [32:51] okay yeah [32:57] so for me it's a like a normal user not [33:00] talking about servers platform other [33:01] things like I have my [33:03] notebook can I use this without having [33:06] access to the [33:07] oh yes trim is actually targeting [33:09] notebooks [33:11] and is someone set your question yeah [33:13] but and what exactly do I need for this [33:14] because uh if I go to vendor uh and ask [33:19] okay can you give me a source code for [33:20] your ufi and me no no no you don't need [33:23] source code for UEFI at all from the [33:24] vendor and what about me [33:27] you can never get source code for near [33:29] me anyway yeah can I can I just replace [33:31] it with uh so the me cleaner you're not [33:34] going to replace it either the thing I [33:36] didn't mention it's I'm really glad yes [33:37] this the bup that very first thing that [33:40] is signed [33:41] you can't change that or things won't [33:43] work okay so it's all the stuff after [33:45] the buff that is not included in that [33:47] signing [33:49] so what we're doing is removing all the [33:51] stuff that's not part of that sign thing [33:52] and that's when we discovered that if [33:54] all that's in there is the bup platform [33:57] comes up doesn't turn off after 30 [33:59] minutes everything seems to work fine [34:00] that's been the big discovery of the [34:02] last two years which none of us ever [34:04] thought would happen so [34:06] you do not need the me source from your [34:09] laptop vendor you need the me cleaner [34:11] from from corner to to clean it [34:14] you do not you need you do not need UEFI [34:17] Source you want to talk to tram Hudson [34:19] um and I should say part of this [34:21] discussion of core boot versus you know [34:23] or Nerf uh tram was working really hard [34:25] to kind of get core boot on a lot of [34:26] things and it's just a tough lift [34:28] because that information is is so close [34:31] tightly held [34:32] I think he's finding this Nerf approach [34:34] a lot easier and more approachable so [34:37] but again you do not need Source from a [34:39] laptop vendor to do this tram has done [34:41] it and if you want to talk to us later [34:43] we'll we'll try and help you do it now [34:44] if you're going to do it [34:46] make sure you're okay with the idea of [34:48] turning your laptop into a brick and [34:49] recovering from that because it's still [34:51] early days right and anytime you do this [34:53] stuff that can happen [34:56] um yeah [35:00] tourism released some [35:03] tourism The Notebook yeah really [35:06] something that they disabled emilinos [35:09] completely yes I know that guy very well [35:11] actually yeah is that is that they said [35:14] it's not gone but it's simply disabled [35:16] so yes speaking about this web server [35:19] that you said is still a problem so the [35:22] me cleaner removes all that code that [35:24] implements the web server the purism [35:26] work actually goes a little deeper [35:28] and and turns on this hap mode which is [35:31] really pretty cool so what's happening [35:33] as a result of the again last two years [35:35] of work by a lot of really good people [35:37] we're slowly slowly digging our way into [35:39] basically disabling Emmy which I think [35:42] is is something we've all wanted for a [35:44] long time and I think we finally are [35:45] learning really how to do that very [35:47] effectively [35:48] that's that's the big goal but purism's [35:51] work is you don't want to view it in [35:54] isolation furism's work is sort of part [35:56] of this Continuum of work [35:58] and everybody has been contributing and [36:00] and it's sort of the the next step in in [36:03] this work we're all doing to try and get [36:04] it I shouldn't say me I haven't it's [36:06] other people doing this great stuff but [36:08] you know the community has been doing [36:10] to get this disabled [36:12] and another question uh is this me [36:15] cleaner or the the possibility to clean [36:18] that up also working for the newest [36:20] Intel uh [36:21] processors versus science stuff I think [36:25] but we we'd have to I'd have to find out [36:29] honestly [36:30] um [36:31] again all this stuff is moving so fast [36:33] that that week in and week out there [36:36] there's sort of some new discovery and [36:37] some new way of turning more stuff off [36:39] so it's it's been really fun to watch [36:41] because we really didn't know we'd be [36:43] able to do any of this [36:45] so yeah it I guess all you can do is [36:47] watch events [36:48] like I say this was a different talk a [36:50] week ago you know because we're learning [36:52] more and more day in and day out fast [36:55] moving project and we'd love to have [36:56] anybody who wants to get involved get [36:58] involved so yeah [37:01] uh I'll repeat your question because oh [37:03] that's okay yeah [37:05] I have two minutes and 54 seconds left [37:09] just to follow up on what he asked the [37:12] disablement is actually working curse [37:15] the Skylake stuff okay this is an x86 [37:19] core from E and A Minix kernel and [37:22] there's been security research on just [37:24] decompiling or me yeah they they found [37:28] and just disablement bid so you can just [37:32] flip a bit and everything after the boot [37:35] up is gone [37:37] all right [37:38] um and the old me cleaner works on an [37:40] obscure risk architecture and that won't [37:43] work on the old stuff but if you've got [37:45] a Skylake [37:47] um and KB Lake you can just disable me [37:49] for good so I just I just got told in no [37:53] uncertain terms to stop [37:55] um thanks all for attending and we again [37:57] appreciate anything you want to do for [37:59] this project thanks