3 ms·
As someone still at the "piecing things together" stage, here's my understanding: There are a bunch of privilege levels in Intel CPUs (https://en.wikipedia.org
by exikyut 4y ago
As someone still at the "piecing things together" stage, here's my understanding:
There are a bunch of privilege levels in Intel CPUs (https://en.wikipedia.org/wiki/Protection_ring https://en.wikipedia.org/wiki/Protection_ring, relatively boring), used for memory protection and user/kernel mode separation (IIUC, I think I'm correct). They can be controlled by whatever code boots the CPU ("gets there first"), because the CPU boots in the most trusting state.
Over time the set of available levels proved insufficient for security and new levels were added with negative numbers so as not to disrupt the existing status quo. Ring -1 is used for virtualization and can also be controlled by whatever boots first (ie, outer code can create VMs and enter them, but the CPU faults if inner code attempts to access the virtualization instruction set), but Ring -2 and Ring -3 are used by the CPU itself.
Essentially, in the same way whatever the bootloader loads gets control over a bunch of interesting functionality because that code got there first, Ring -2 and -3 are controlled by code running directly on the CPU that gained control of the system before the bootloader and in some cases even UEFI was started. The significant elements are that a) this code can theoretically be altered by system (microcode) updates; b) these components run *completely* independently of the operating system - IIRC, the Management Engine is based on Minix running on a tiny 486-class core somewhere on the CPU die; and c) this invisible functionality has the ability to read and write all of system RAM. What's that? A glitch? A couple of bytes of RAM just got modified? That made the running Linux kernel suddenly think a process's effective UID is 0? Must have been the butterfly effect!
A bit of Googling found this overview of Ring -1 to -3 which I'd say is really good, definitely worth clearing your cookies to read if Medium is yelling at you about subscribing:
https://medium.com/swlh/negative-rings-in-intel-architecture-the-security-threats-youve-probably-never-heard-of-d725a4b6f831 https://medium.com/swlh/negative-rings-in-intel-architecture...
- mdaniel 4y ago> definitely worth clearing your cookies to read if Medium is yelling at you about subscribing: I've been getting a lot of mileage out of "scribe.rip" that was posted a while back (https://news.ycombinator.com/item?id=28838053 https://news.ycombinator.com/item?id=28838053) https://scribe.rip/swlh/negative-rings-in-intel-architecture-the-security-threats-youve-probably-never-heard-of-d725a4b6f831 https://scribe.rip/swlh/negative-rings-in-intel-architecture...
- exikyut 4y agoWow, this is really neat. Thanks!