Separate identity, authority and resource consumption

Namespace-relative names are not grants of host-wide power. A process can see itself as PID 1, UID 0, or a member of cgroup / while remaining constrained by host policy. Each namespace isolates a particular kind of state.

User: mapped identity and scoped privileges

Added example: namespace UID 0 maps to ordinary host UID 1000. The process can have administrative capabilities within the relevant namespace scope without becoming host root. A host file writable only by host root is not made writable merely because the process reports UID 0 inside its environment.

Actual access depends on mappings, capabilities and the resource being controlled; root inside a user namespace is not an unrestricted promise for every operation. Linux user namespace manual.

UTS: machine name, not a new kernel

UTS isolates the hostname and NIS domain name. In PDF pages 30-31, the child is created with CLONE_NEWUTS | SIGCHLD. It initially sees hostname VM, then changes its hostname to CustomVM and its NIS domain name to CustomDomain.

ObservationHostname
Parent before child changes itVM
Child initiallyVM
Child after sethostnameCustomVM
Parent afterwardsVM

uname() returns several system details, but the namespace does not independently change every field: it does not supply a different kernel version. A UTS hostname is also not an IP address, a network connection or a separate port-binding space. NIS domain naming here is not ordinary DNS configuration.

IPC: selected communication resources

IPC means Interprocess Communication. An IPC namespace separates System V IPC resources, including shared-memory identifiers and semaphores, and POSIX message queues. It does not isolate every conceivable communication mechanism.

Added example: applications in separate IPC namespaces can use the same System V shared-memory key without referring to one common IPC object. Other explicitly shared communication paths need their own controls.

Cgroup namespace: view, not the controller

The source’s page 33 illustrates:

Outside view: /batchjobs/container_id1
Inside view:  /

The cgroup namespace makes membership paths relative to its root and virtualizes the relevant cgroup mount view. Seeing / means the root of that view, not ownership of the host’s whole resource hierarchy. Existing cgroup limits still apply; creating the namespace does not reset them. Linux cgroup namespace manual.

Flags in the source’s seven-type table

NamespaceCreation flagSeparated state
PIDCLONE_NEWPIDProcess-ID environment
NetworkCLONE_NEWNETInterfaces, routes, ports and network state
MountCLONE_NEWNSMount arrangement
UserCLONE_NEWUSERUser/group identities and scoped capabilities
UTSCLONE_NEWUTSHostname and NIS domain name
IPCCLONE_NEWIPCSelected IPC resources
CgroupCLONE_NEWCGROUPCgroup hierarchy/membership view

This preserves the lecture’s table rather than asserting that Linux has exactly seven types forever. Linux Process Isolation and Container Assembly explains the independence of these choices and the creation/join interfaces.

Retrieval practice

Can namespace root modify a host-root-only file solely because its inner UID is 0? No. The mapped identity and applicable permissions still matter.

Does changing the child’s hostname change the parent’s? Not when they have separate UTS namespaces; the values can diverge independently.

Does seeing cgroup / remove an ancestor CPU quota? No. The path view and resource-control policy are separate mechanisms.

Lecture 06 - Lightweight Virtualization - Cgroups and Namespaces, PDF pages 13 and 30-33. Identity mappings and the cgroup-view trace are expanded study explanations.