Protection ring

Also known as: ring 0 · CPU privilege level

On this page 7

A protection ring is a hardware-enforced privilege level of the processor that determines which instructions code may execute and which memory and devices it may touch. In OS security, rings form the foundation on which every other protection rests: the kernel runs in the most privileged level, usually called ring 0, while ordinary applications run in the least privileged level, ring 3 on x86 processors.

The term CPU privilege level describes the same idea from the processor’s point of view. Because the boundary is checked by the hardware on every sensitive instruction and memory access, a bug or malicious routine in user code cannot simply rewrite kernel data or reprogram devices. It must instead cross the boundary through a controlled entry point such as a system call, where the kernel validates the request.

How protection rings enforce privilege

Protection rings work because the processor tracks the current privilege level of running code and compares it with the privilege required by each operation. On x86 this value lives in the low two bits of the code segment register and is called the CPL. When code at a less privileged level attempts a privileged instruction, such as loading a new page-table base or disabling interrupts, the CPU raises a general protection fault instead of executing it.

Memory is guarded in the same way. Each page-table entry carries a user/supervisor bit, and a page marked supervisor-only is inaccessible from ring 3. Transitions between levels happen only through gates defined by the kernel: the SYSCALL and SYSENTER instructions, interrupt and exception vectors, and older call gates. On entry, the CPU switches to a kernel stack and a known instruction address, so user code cannot choose where kernel execution begins.

The following table summarizes the classic x86 ring model and how mainstream desktop operating systems actually use it.

RingOriginal design intentUse in modern desktop systems
Ring 0Operating system kernelKernel, most drivers, memory manager
Ring 1Operating system servicesPractically unused
Ring 2Device drivers or servicesPractically unused
Ring 3User applicationsAll user processes and most services
Classic x86 ring levels and their typical use

Why most systems use only two rings

Although x86 offers four levels, Windows, macOS and Linux use only ring 0 and ring 3. The decision is practical: portability across architectures matters more than fine-grained hardware layering, and many processor families provide only two modes. Paging also distinguishes just user and supervisor, so rings 1 and 2 gain no separate memory protection without segmentation, which 64-bit long mode has largely abandoned.

The consequence is a coarse privilege model. Every kernel-mode driver shares ring 0 with the kernel itself, so a flaw in a third-party graphics or antivirus driver is as dangerous as a flaw in the core kernel. This is why measures such as driver signing, kernel exploit mitigations and moving drivers into user mode carry so much weight in modern OS security.

Other architectures implement the same principle under different names, as the next table shows.

ArchitecturePrivilege levelsTypical assignment
x86 and x86-64Rings 0 to 3Kernel in ring 0, applications in ring 3
ARMv8-AException levels EL0 to EL3Applications EL0, kernel EL1, hypervisor EL2, secure monitor EL3
RISC-VU, S and M modesApplications U, kernel S, firmware M
IBM POWERProblem, privileged, hypervisor statesApplications, kernel, hypervisor
Privilege levels on common processor architectures

Rings below zero

Security practitioners use the informal labels ring -1, ring -2 and ring -3 for execution environments that are more privileged than the operating system kernel. These are not official x86 rings, but the shorthand captures an essential fact: code at those levels can observe and modify ring 0 while remaining invisible to the operating system.

  • Ring -1 refers to hardware virtualization (Intel VT-x, AMD-V), where a hypervisor controls guest kernels. Windows virtualization-based security uses this layer to protect credentials and code integrity checks from a compromised kernel.
  • Ring -2 refers to System Management Mode, a firmware execution mode triggered by system management interrupts and isolated from the operating system.
  • Ring -3 refers to independent management controllers inside the chipset, such as the Intel Management Engine, which run their own firmware.

These deeper layers explain why firmware integrity and secure boot matter: a compromise there defeats all protection the kernel enforces, and the operating system has no reliable way to detect it from ring 0.

Protection rings separate privilege, but they do not by themselves separate one application from another. That task belongs to memory protection and process isolation, which give every process its own address space. Several hardening features exist precisely because the ring boundary alone was not enough.

MechanismWhat it addsWeakness of rings it addresses
Process isolationSeparate address spaces per processRings do not separate user processes
SMEPBlocks kernel execution of user pagesKernel jumping into attacker code
SMAPBlocks kernel access to user dataKernel misled by user-controlled pointers
Kernel page-table isolationUnmaps kernel memory in user modeSpeculative leaks across the boundary
KASLRRandomizes kernel addressesPredictable targets for exploits
How neighboring mechanisms complement protection rings

Together these mechanisms turn a simple two-level split into a layered defense of the kernel boundary, which remains the most valuable target on any desktop system.

Limitations and common misconceptions

The ring model is robust in hardware but only as strong as the code running in ring 0. Most real-world privilege escalations do not break the ring mechanism; they exploit a kernel or driver vulnerability that lets attacker-supplied data steer privileged code. The table below lists frequent misunderstandings and the accurate picture.

MisconceptionReality
Administrator accounts run in ring 0Administrator processes still run in ring 3
Four rings mean four security layersDesktop systems use only two rings
Ring 0 code is trusted because it is signedSigned drivers can still contain exploitable bugs
Rings stop speculative execution leaksSpectre and Meltdown crossed the boundary
Rings protect against firmware malwareFirmware runs below ring 0
Misconceptions about protection rings

Another limitation is performance cost. Every system call or interrupt crosses the boundary and saves processor state, and mitigations such as page-table isolation make each crossing more expensive. Designers therefore balance a smaller trusted computing base against the overhead of frequent transitions, which is the central argument in the debate between monolithic kernels and microkernels.

In plain words

A computer runs two kinds of software: the core of the operating system, which manages everything, and the programs people use every day. Protection rings keep these two apart. The processor itself knows which kind of code is running and refuses to let ordinary programs perform the most powerful actions.

Think of a bank. Customers can use the counter and the cash machine, but only staff with the right badge may enter the vault. When a customer needs something from the vault, they ask at the counter and an employee checks the request. Programs work the same way: they ask the operating system, and the operating system decides whether to help.

A real-world example

A security team at a mid-sized engineering firm investigates an alert on a Windows workstation. A malicious document has launched code inside a word processor, but that code runs in ring 3 with the user’s rights. When it tries to read the memory of the credential manager and disable the security agent, the attempts fail, because the kernel refuses requests that the user’s token does not permit and kernel pages are marked supervisor-only.

The attacker then tries a known flaw in an outdated, signed printer driver to reach ring 0. Here the firm’s earlier hardening pays off: the vulnerable driver is on the blocklist enforced by virtualization-based security, so it never loads. The investigation closes with the incident contained in user mode, a reimaged workstation and a review of which old drivers remain on other machines.