In this article
A path-resolution restriction must apply to the open that supplies the loader, not only to an earlier pathname check.
The operational scenario
A preparation service canonicalizes a requested artifact path, verifies that it lies inside a staging directory and later opens the original name. Another actor can change a symlink between those operations. The approved string then describes an earlier resolution, while the loader may receive a different inode. The control must bind path resolution to the actual open and retain the resulting object’s identity.
The trust-boundary mechanism
Linux openat2 provides resolve constraints such as staying beneath a directory descriptor and rejecting symlinks or magic links according to selected flags. These choices have different meanings: allowing internal symlinks while preventing escape is not the same as forbidding all symlinks. O_NOFOLLOW on ordinary open addresses the final component, so it should not be described as a complete restriction on intermediate path components.
Define the control contract
Define a trusted directory descriptor, allowed relative naming, link policy and the loader interface that consumes the opened object. Preserve kernel and wrapper support and decide what happens when the required operation is unavailable. Do not silently fall back to an earlier check-then-open pattern while retaining the stronger protection label. File content integrity and ownership remain separate from confinement of path resolution.
A step-by-step verification
First exercise an accepted ordinary artifact beneath the trusted root. Then use a disposable directory fixture to change an intermediate link while resolution is attempted, checking that the selected restriction rejects escape or returns a documented retryable race outcome. Compare internal allowed links with forbidden ones under the declared policy. Pass the resulting descriptor or an equivalently controlled object to validation and loading rather than reopening an unchecked pathname.
Evidence required for acceptance
Evidence includes the trusted root identity, effective resolve flags, open outcomes and file identity associated with validated bytes. A control that canonicalizes first and reopens later should be recognized as a weaker path. Keep race-related errors distinct from successful reads and unsupported-kernel failures. Acceptance requires the actual loader input to remain inside the declared resolution policy, with separately verified content identity.
Failure cases and limits
A held descriptor does not freeze mutable file contents or prevent another authorized writer from changing the inode’s bytes. Mount changes and loader APIs may introduce additional boundaries requiring inspection. This protocol runs no filesystem race here. It identifies the check/use gap and the scope of descriptor-relative resolution without claiming that one syscall establishes a complete immutable artifact or general process sandbox.
Primary references and related reading
A path-resolution restriction must apply to the open that supplies the loader, not only to an earlier pathname check. Linux openat2 path resolution constraints; Linux open file creation and descriptor semantics.
The proposed investigation of openat2 beneath symlink swap is a proposed control review; no live security test was executed. Related reading: Validate safetensors weight artifacts separately from repository code; Pin object version identities in a model manifest.
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.