Privilege Levels
100%

Kernel · Lesson 2

Privilege Levels

Learn how processor privilege separates user execution from trusted kernel execution.

Processors provide privilege modes that restrict sensitive instructions and memory access. Linux uses this hardware boundary so ordinary application failures cannot directly overwrite kernel memory or reconfigure devices. The kernel controls transitions into privileged execution.

User Mode

A normal process executes in user mode within its virtual address space. It can compute freely and access memory mappings the kernel has granted, which can be large; user mode does not mean “only a small amount of memory.” It cannot directly access arbitrary physical memory, another process's private mappings, or privileged processor controls.

Page tables and protection bits enforce memory access. If a thread references an invalid or disallowed address, the processor traps into the kernel, which can resolve a valid page fault or deliver a signal such as SIGSEGV.

What memory can a user-mode process normally access directly?

Kernel Mode

Kernel mode permits execution of privileged instructions and access to protected kernel mappings needed for memory management, scheduling, interrupt handling, and drivers. On x86 this Linux split is commonly described as ring 0 for the kernel and ring 3 for user processes. Linux normally does not use rings 1 and 2 for ordinary process isolation.

Other architectures use different names and mechanisms, such as exception levels. Virtualization adds hypervisor and guest relationships that do not fit a simple two-ring drawing. The essential idea is controlled privilege, not the x86 ring numbers themselves.

Which x86 protection ring normally executes the Linux kernel?

Controlled Transitions

Several events transfer control to a kernel entry point:

  • a system-call instruction requests a kernel service
  • an exception reports a condition such as a page fault or invalid instruction
  • a hardware interrupt reports an external event

The processor saves execution context, changes privilege according to configured entry mechanisms, and begins trusted kernel code. The kernel validates the request and state, performs or rejects work, then returns to user mode when appropriate.

The application does not temporarily become kernel code. The CPU executes a kernel handler on behalf of the thread, with kernel-controlled stacks and mappings.

What happens during a system-call transition?

CPU Privilege Is Not User Identity

An application running as Linux user root still normally executes in user mode. UID 0 influences kernel authorization checks but does not let its instructions directly access kernel memory. Conversely, kernel code executes in privileged mode regardless of which user's system call caused it to run.

Capabilities, namespaces, seccomp, security modules, and cgroups further constrain what a process can request. This layered policy is separate from the hardware user/kernel mode boundary.

Which statement correctly compares root identity and kernel mode?

Why the Boundary Matters

The boundary limits damage from ordinary bugs and provides a point for access checks, but kernel vulnerabilities and malicious modules can defeat it. Keep kernels and firmware updated through trusted channels, minimize privileged code, and avoid loading untrusted modules.

Speculative-execution issues and side channels also show that hardware isolation requires ongoing mitigation; “different ring” is a foundation, not a complete security proof.

Does user/kernel mode separation guarantee complete system security?

Lesson complete

You finished Privilege Levels

You can now distinguish hardware execution privilege from Linux account authority.

  • Relate user mode to protected virtual address spaces.

  • Relate kernel mode to privileged instructions and mappings.

  • Treat system calls, exceptions, and interrupts as controlled entries.

  • Separate UID 0 authorization from ring 0 execution.

  • View privilege modes as one layer of a broader security design.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Kernel