Skip to content

Lesson 10 of 14 · 14m

One Kernel, One Blast Radius

All containers share one kernel, so Dirty Pipe, nf_tables, and OverlayFS bugs escape every namespace at once and kernel updates are container security updates.

The thing every namespace shares

Namespaces partition views. They do not partition the kernel. Every container on a host executes the same syscall table, drives the same scheduler, shares the same page cache and device drivers — which means a memory-corruption bug reachable from a container breaks every namespace at once. This is the escape path that no amount of flag hygiene closes: the wall you built is a table inside the software that has the bug.

That changes how you should read kernel CVEs. A "local privilege escalation" bug is a container escape when the attacker starts inside a container. LPE advisories that read as desktop problems are node compromises on Kubernetes.

The receipts

Dirty Pipe, CVE-2022-0847 — disclosed March 7, 2022 by Max Kellermann. Kernels 5.8 through 5.16.11 failed to initialize the PIPE_BUF_FLAG_CAN_MERGE flag on pipe buffers, so splice(2) could merge attacker data into the page cache of a read-only file. File permissions never entered the picture — the write happened to the cached page, not the file. Container-relevant instantly: overwrite a binary the host trusts (runc, anything in a read-only mount), wait for execution, done. Working exploits appeared the day of disclosure.

nf_tables. Netfilter's packet-rules engine has been the single richest container-escape subsystem on Linux. CVE-2021-22555 — a fifteen-year-old heap overflow in IPT_SO_SET_REPLACE, disclosed July 2021 by Andy Nguyen at Google — was exploited publicly against Google's own kCTF cluster. CVE-2024-1086 — a double-free via nft_verdict_init mishandling NF_DROP with an error verdict, affecting kernels 5.14–6.6 — got Notselwyn's "Flipping Pages" writeup in March 2024 and worked as a universal-ish local root. Both bugs sit behind CAP_NET_ADMIN.

Here is the uncomfortable part: on default Ubuntu and Debian systems, an unprivileged user can create a user namespace plus a network namespace, which grants CAP_NET_ADMIN inside that namespace — enough to reach netfilter code the bug lives in. The kernel bugs are armed by a feature meant to help sandboxing. That is why kernel.unprivileged_userns_clone exists as a sysctl (Debian), why user.max_user_namespaces exists, and why gVisor's model cuts deeper than flags.

GameOver(lay), CVE-2023-0386 plus CVE-2023-2640 and CVE-2023-32629 — OverlayFS, the stacked filesystem every Docker image is made of. The generic bug (March 2023): OverlayFS mishandled UID mapping on copy-up, so SUID binaries from a lower layer could execute with host-root effect. The Ubuntu-specific pair (Wiz, July 2023) made it nearly trivial on Ubuntu systems — again via unprivileged user namespaces. When the filesystem your containers are built from is the bug, "the container can't escape" gets very hard to say.

io_uring — three syscalls fronting a giant kernel surface, about 60% of the Linux vulnerabilities submitted to Google's kCTF bounty in 2022. Docker blocked io_uring_setup, io_uring_register, and io_uring_enter in the default seccomp profile in release 20.10.9 (October 2021); Google disabled io_uring in Android, ChromeOS, and gVisor production builds in June 2023. This is the defense model working — you cannot patch a bug you haven't found, but you can stop guests from reaching the subsystem.

What this means for the model

The kernel shared surface means container isolation has a floor: however good your flags are, the next netfilter bug resets to "patch the kernel." Kernel updates are your container security updates. A host running a six-month-old kernel with well-configured containers is running a well-configured container stack on an escapable kernel.

It also means unprivileged user namespaces are a real tension: the same mechanism that powers rootless containers and Chrome's sandbox is the arming mechanism for CAP_NET_ADMIN-gated kernel bugs. The resolution isn't disabling userns everywhere — it's knowing which hosts run hostile workloads and setting kernel.unprivileged_userns_clone=0 or capping user.max_user_namespaces on exactly those.

What to actually do

  • Patch kernels on a schedule that treats "LPE" as "container escape." On a shared compute host, kernel CVE cadence is your escape cadence.
  • Keep the seccomp defaults — the io_uring block already paid for itself.
  • For genuinely untrusted code, accept that namespaces top out and put a second wall in — userns remapping, or a runtime with its own kernel, which is the next lesson.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.