Shared host namespaces

Each --host namespace flag removes one layer of isolation between container and host. Sharing the PID namespace exposes and lets you inject into host processes, the network namespace exposes host-local services and the node's loopback, the IPC namespace exposes shared memory and semaphores, and a shared or mapped user namespace can mean container root is host root.

1 ನಿಮಿಷದ ಓದುಅಕ್ಟೋ 7,2026 ರಂದು ನವೀಕರಿಸಲಾಗಿದೆflorianamette1 ಕೊಡುಗೆದಾರ
ನಿಮ್ಮ ಸಹಾಯಕವನ್ನು ಕೇಳಿ (MCP)GitHub ನಲ್ಲಿ ಸಂಪಾದಿಸಿ

Namespaces are what make a container a container: separate views of processes, network, IPC, mounts, users, and more. Every --pid=host, --net=host, --ipc=host, or --userns=host flag (and the Kubernetes hostPID, hostNetwork, hostIPC fields) removes one of those separations, re-joining the container to the host's view. None of these is a memory-corruption exploit; each simply hands back a slice of the host, and the escape is using that slice.

Fingerprint which namespaces are shared with the host by comparing namespace IDs against PID 1 on the host, or by what is visible:

bash
ls -l /proc/self/ns/                       # this process's namespace inode IDs
ls -l /proc/1/ns/                          # compare: same inode = shared with host init
ls /proc | grep -E '^[0-9]+$' | wc -l      # many host PIDs => shared PID namespace
ip addr; ss -tlnp 2>/dev/null | head       # host interfaces/ports => shared net namespace
ipcs                                       # host shared memory/semaphores => shared IPC
cat /proc/self/uid_map                     # "0 0 ..." => not in a user namespace

Subtopics#

References#