Containers do not virtualise the kernel; they share the host's single kernel through namespaces and cgroups. Any kernel code path a container process can reach is therefore an escape surface, and a successful kernel exploit lands directly on the host as root, bypassing every namespace. What a container can reach is widened enormously when it can create a user namespace, because that grants CAP_NET_ADMIN and other capabilities inside the namespace and exposes subsystems (netfilter, some filesystems) that would otherwise be unreachable.
Gauge reachability and version:
uname -r # exact kernel release
unshare -Urn true 2>/dev/null && echo "unprivileged userns available"
sysctl kernel.unprivileged_userns_clone 2>/dev/null
Subtopics#
- Dirty COW: a copy-on-write race for writing read-only pages.
- Dirty Pipe: overwriting read-only file page cache through a pipe.
- nf_tables: netfilter use-after-frees reachable via an unprivileged user namespace.