TECHNOLOGY

chroot does not relocate a worker current directory

In this article
THE QUICK TAKE

A changed root and an unchanged current directory are separate lookup anchors; chroot alone is not confinement.

The operational scenario

A tool launcher enters a reviewed filesystem tree with chroot and then starts a model-related utility using relative paths. Its recorded root looks correct, but the utility still resolves a relative input from an unexpected directory. The review must inspect both root and current working directory. A successful root change is not evidence that every later pathname begins inside the intended tree.

The trust-boundary mechanism

The Linux chroot manual explicitly states that the call does not change the current working directory and does not close open file descriptors. Path-resolution documentation distinguishes absolute lookup from the process root and relative lookup from the current directory or an explicit directory descriptor. These are separate anchors. The manual also warns that chroot is not intended as a complete security sandbox or general filesystem-call restriction.

Define the control contract

Define the launcher entry state, intended root, current directory and inherited resource set. Specify whether the objective is path organization or an actual containment boundary. If containment is required, identify the additional supported mechanism rather than treating chroot plus a convenient directory change as a universal security proof. Keep mount topology, credentials and directory movement under explicit ownership because changing one lookup anchor does not freeze the whole filesystem.

A step-by-step verification

First inspect the launch sequence as text, preserving the order of root and directory changes. In an authorized disposable environment, place synthetic marker files at deliberately distinct lookup locations. Compare absolute and relative reads through the intended utility path without reading private host files. Include a controlled directory-descriptor case if the tool uses relative-at APIs. Stop at the documented observation rather than constructing an escape against a live host.

Evidence required for acceptance

Acceptance requires the effective root, actual current directory and the identity of each marker opened through a declared path form. Retain inherited descriptor inventory without contents where relevant. A missing relative file can be a lookup error rather than a denied operation, so distinguish not-found from permission refusal. A successful absolute read inside the tree cannot certify unrelated relative reads or resources referenced through existing handles.

Failure cases and limits

Correcting the working directory may fix the application input selection while leaving the broader sandbox question unanswered. Likewise, a restricted runtime may provide other protections independently of chroot. The article establishes which launch state explains pathname behavior and which stronger claims remain unsupported. No existing directories are moved and no private files are accessed; the proposed marker fixture is sufficient to expose the mismatched lookup assumption.

A changed root and an unchanged current directory are separate lookup anchors; chroot alone is not confinement. Linux chroot pathname-resolution limitations; Linux absolute and relative lookup roots.

The proposed investigation of chroot current directory path anchor is a proposed control review; no live security test was executed. Related reading: Continue MCP working directory determines relative resource paths; Read-only container will not start: where to allow temporary and cache writes.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles