Lesson 1 of 14 · 12m
A Container Is a Process With a Broken View
Docker containers are ordinary processes lying about their view via clone() namespace flags, and /proc/<pid>/ns/ inodes prove which walls exist.
What runc actually does
When you type docker run nginx, nobody boots anything. There is no second kernel, no hypervisor, no bootloader. The daemon hands the image layers and your flags to containerd, which hands them to runc, and runc calls clone(2) — the same syscall fork() is built on — with a set of flags: CLONE_NEWNS, CLONE_NEWPID, CLONE_NEWNET, CLONE_NEWIPC, CLONE_NEWUTS, and usually CLONE_NEWCGROUP. A container is a process the kernel is lying to.
Each flag creates one lie. CLONE_NEWPID gives the process a fresh process-number table where it is PID 1. CLONE_NEWNS gives it a private copy of the mount table, so mount and umount inside it stay invisible outside. CLONE_NEWNET gives it a network stack with nothing but lo. CLONE_NEWIPC walls off SysV shared memory and message queues. CLONE_NEWUTS lets it set its own hostname. CLONE_NEWUSER — the interesting one — remaps UIDs, so root inside can be an unprivileged user outside.
You can create all of this without Docker:
unshare --pid --fork --mount-proc bash
echo $$ # prints 1unshare is the same clone flags behind a CLI. nsenter goes the other direction: it opens a PID's namespace file descriptors under /proc/<pid>/ns/ and calls setns(2) to join them — which is exactly what docker exec does when it slides a second process into a running container.
Every namespace a process lives in is a symlink under /proc/<pid>/ns/ named by inode:
$ readlink /proc/1/ns/net /proc/1/ns/mnt
net:[4026532008]
mnt:[4026532009]Two processes in the same namespace share the inode number. lsns renders the whole table. This is the audit trick that matters: compare a container's /proc/<pid>/ns/* links against PID 1's on the host. Same number means same namespace, which means no wall.
The wrong model
The mental model to discard is "lightweight VM." A VM isolates by hardware virtualization: a second kernel, a second syscall table, everything mediated by a hypervisor. A container isolates by bookkeeping. The same kernel keeps a table of which process may see which mounts, PIDs, and interfaces — and the syscall surface, including every bug in it, is shared.
That inverts where the danger sits. Escaping a VM means breaking the hypervisor, which is rare and hard. Escaping a container means convincing one kernel to stop lying: either a kernel bug that does not care about namespaces, or a configuration that shares the wrong namespace or hands over the wrong capability. The configuration kind is far more common, which is why most of this course is about flags.
The namespace inventory
Linux has eight namespace types. Seven matter:
| Flag | Namespace | What it privatizes |
|---|---|---|
CLONE_NEWNS | mount | the mount/unmount table |
CLONE_NEWPID | PID | process numbering and visibility |
CLONE_NEWNET | network | interfaces, routes, firewall rules |
CLONE_NEWIPC | IPC | SysV shared memory, semaphores, queues |
CLONE_NEWUTS | UTS | hostname and domain name |
CLONE_NEWUSER | user | UID/GID mappings |
CLONE_NEWCGROUP | cgroup | view of the cgroup filesystem |
CLONE_NEWTIME exists too — it virtualizes CLOCK_BOOTTIME so containers can report their own uptime — and it matters for correctness, not isolation.
chroot is notably absent. It repoints /, but the process keeps the host's mount table, PID table, and network stack. People call chrooted trees "jails." They jail almost nothing. Docker's root filesystem is a pivot_root inside a mount namespace — a real wall, not a repointed pointer.
What to actually do
Learn the three tools before you need them: unshare to create, nsenter to enter, lsns and readlink /proc/<pid>/ns/* to inspect. When you audit a workload, check the namespace links first. If a container shares the host's net, pid, or ipc inode, every escape technique in the next module applies to it before you look at anything else.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
A 257-Byte Password Is the Key: Inside the OpenSSH musl Bypass
CVE-2026-123158 lets an attacker log into a locked account on musl-based systems like Alpine by sending a password nobody set. The trigger is one number, 257, and the reason is a C library returning a single asterisk. I reproduced the exact boundary against musl 1.2.4 and read the fix.
A Password-Free Path to Root: Inside the macOS Screen Sharing Vulnerability Now Under Attack
A logic bug in screensharingd let attackers skip authentication entirely and land as root — no password required. Here's how it was found, patched, reverse-engineered, and finally weaponized.
CVE-2026-31431 "Copy Fail": How a 9-Year-Old Linux Kernel Bug Gives Any Local User Root in 732 Bytes
CVE-2026-31431 chains AF_ALG, splice(), and authencesn's ESN scratch write into a deterministic 4-byte page cache write that gives an unprivileged local user root. Full technical breakdown, exploit mechanics, detection, mitigation, and patch status per distro.
BlueHammer: The Unpatched Windows Zero-Day That Weaponizes Microsoft Defender Against Your Own System
BlueHammer is an unpatched, publicly released Windows local privilege escalation exploit that chains Microsoft Defender's update workflow, Volume Shadow Copy, Cloud Files callbacks, and opportunistic locks to reach NT AUTHORITY\SYSTEM from a standard user account.