Lion Cipher Lab

See virtual memory, page faults, and copy-on-write with your own eyes

Why it matters

Every program you will ever run, defend, or reverse lives inside an illusion the kernel maintains: a private virtual address space that only becomes real RAM one page at a time, on demand. Most people treat that illusion as a black box -- 'the program uses 2 GB of memory' -- and are wrong in ways that matter. They panic at a process with a 20 GB VSZ that is using 200 MB of actual RAM. They cannot explain why fork() of a 4 GB process is instant and nearly free. They read 'malloc succeeded' and assume the memory exists, then get OOM-killed the moment they write to it. They see a SIGSEGV and…

What you'll learn

Steps in this lab

  1. The one idea: your memory is a promise, and only RSS is the part that came true
  2. Get a shell, then read your own address space in /proc/self/maps
  3. Demand paging: reserve 512 MiB, touch nothing, watch RSS refuse to move
  4. Minor vs major page faults -- and why fresh anonymous pages are always minor
  5. Copy-on-write across fork(): parent and child share pages until someone writes
  6. Enforce protection: mprotect a page read-only, write to it, catch the SIGSEGV
  7. The named failure modes: VSZ is a lie, overcommit is a bet, the OOM killer is the reckoning
  8. The judgment: the security lens, and why you now read this machine like the exploit labs do

Open the full interactive lab →