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

Memory Protection and Access Control Hardware

College Depth 98 in the knowledge graph ☐ I know this ☆ Set as goal
361prerequisites beneath it
See this on the map →
Memory Management: Paging and SegmentationTranslation Lookaside Buffer (TLB) Design→
memory-protection privilege-levels access-control

Core Idea

MMUs (memory management units) enforce access control: each page has protection bits (read, write, execute) and a privilege level. The processor's current privilege level (user, supervisor, kernel) is checked; privilege violations cause exceptions. Memory protection prevents user programs from accessing other processes' memory and kernel memory.

Explainer

You already understand how paging divides virtual memory into fixed-size pages mapped to physical frames through page tables, and how the TLB caches these translations for speed. Memory protection builds directly on this infrastructure — the same page table entries that translate addresses also carry protection bits that control what operations are allowed on each page. Every time the MMU translates a virtual address, it simultaneously checks whether the requested access type (read, write, or execute) is permitted by those bits.

Each page table entry typically contains at least three protection flags: read, write, and execute. A page holding program code might be marked read and execute but not write, preventing the program from accidentally (or maliciously) overwriting its own instructions. A page holding data would be marked read and write but not execute, so even if an attacker injects malicious code into a data buffer, the processor refuses to execute it. This principle — called WX (write XOR execute) — is a fundamental defense against code injection attacks.

Protection also depends on privilege levels, sometimes called rings. Most processors define at least two levels: kernel mode (ring 0) and user mode (ring 3 on x86). Each page table entry records the minimum privilege level required to access that page. When a user-mode program tries to read a page marked as kernel-only, the MMU does not return the data — instead, it triggers a protection fault, an exception that transfers control to the operating system's fault handler. This is how the OS prevents applications from reading each other's memory or tampering with kernel data structures.

The beauty of hardware-enforced protection is that it cannot be bypassed by software running at lower privilege. A user program cannot modify its own page table entries because those entries live in kernel-only memory. It cannot disable the MMU because that requires a privileged instruction. Every single memory access passes through the MMU's check, with no opt-out. This creates the isolation boundary that makes multitasking possible — dozens of processes share the same physical RAM, each believing it has the machine to itself, with the hardware guaranteeing that no process can reach beyond its own address space.

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) → Assembly Language Basics → Memory Organization and Addressing → Memory Hierarchy → Cache Memory Design → Cache Replacement Policies → Virtual Memory and Paging → Memory Management: Paging and Segmentation → Memory Protection and Access Control Hardware

Longest path: 99 steps · 361 total prerequisite topics

Prerequisites (2)

Leads To (0)

No topics depend on this one yet.