A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

OS Security Fundamentals

College Depth 94 in the knowledge graph ☐ I know this ☆ Set as goal
2topics build on this
356prerequisites beneath it
See this on the map →
Processes and the Process Control BlockSystem Calls and User/Kernel Mode→→Access Control: ACLs and Capability Lists
authentication authorization protection-rings privilege-escalation OS-security

Core Idea

OS security encompasses the mechanisms and policies that protect system resources from unauthorized access. The hardware protection model uses privilege rings: ring 0 (kernel mode, full hardware access) and ring 3 (user mode, restricted) — user programs cannot directly access hardware or memory-mapped kernel structures. The OS enforces three security properties: authentication (verifying identity — who are you?), authorization (enforcing permissions — what are you allowed to do?), and auditing (logging activity). Security vulnerabilities often arise from privilege escalation bugs: a user-mode exploit that tricks the kernel into granting elevated access, or a buffer overflow in a privileged process that overwrites control data.

How It's Best Learned

Study a classic privilege escalation CVE (e.g., a Linux kernel local privilege escalation). Identify which protection mechanism failed and what the attacker gained.

Common Misconceptions

Explainer

You already know that a process is an abstraction the OS uses to isolate running programs, and that system calls provide the controlled gateway between user code and kernel services. OS security builds directly on these concepts: the entire security model depends on the hardware and OS enforcing a boundary between what user processes can do and what the kernel can do, and then carefully controlling how processes cross that boundary.

The foundation is hardware privilege levels, often called protection rings. Modern CPUs operate in at least two modes: kernel mode (ring 0), where code has unrestricted access to hardware, memory, and privileged instructions, and user mode (ring 3), where code is restricted. Your process runs in user mode. It cannot directly access another process's memory, touch hardware registers, or modify page tables. When it needs a privileged operation — opening a file, sending a network packet, allocating memory — it makes a system call, which triggers a controlled transition to kernel mode. The kernel validates the request, checks permissions, performs the operation, and returns to user mode. This boundary is the single most important security mechanism in the OS: without it, any process could read any file, access any device, or overwrite the kernel itself.

On top of this hardware boundary, the OS implements three security functions. Authentication establishes identity: when you log in, the system verifies your credentials (password, SSH key, biometric) and associates your session with a user ID (UID). Authorization enforces what each identity is allowed to do: file permissions (read/write/execute for owner/group/others), process capabilities, and access control lists determine whether a given UID can access a given resource. Auditing logs security-relevant events so that administrators can detect and investigate breaches after the fact. These three functions — sometimes called AAA (authentication, authorization, auditing) — work together as layers of defense.

The principle of least privilege ties these mechanisms together into a design philosophy: every process should run with the minimum set of permissions needed for its task. A web server does not need root access; it needs permission to bind to port 80, read its document root, and write to its log directory. Running it as root means that a vulnerability in the web server grants the attacker full system control. Running it as a restricted user means the same vulnerability is contained — the attacker can only access what the web server could access. Privilege escalation — an attacker gaining higher privileges than intended — is the primary threat model. This can happen through kernel bugs (a system call handler that fails to validate input, letting user-mode code corrupt kernel memory), setuid misconfigurations (a program that runs with elevated privileges but can be tricked into executing attacker-controlled code), or buffer overflows in privileged processes. Every layer of the OS security model exists to make privilege escalation as difficult as possible.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Kernel Architecture and OS Structure → System Calls and User/Kernel Mode → Processes and the Process Control Block → OS Security Fundamentals

Longest path: 95 steps · 356 total prerequisite topics

Prerequisites (2)

Leads To (1)