﻿# Landlock: an omitted handled right can remain outside the sandbox policy

A practical investigation of landlock: an omitted handled right can remain outside the sandbox policy, with explicit observations, control cases and evidence limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/field-security-landlock-handled-rights-policy-gap/
Language: en

## The operational scenario

A video preprocessing service permits a decoder to read an input directory and write a disposable output directory. Its review shows only these permitted paths, yet an operation elsewhere still succeeds. Before blaming a broken rule, inspect which filesystem actions the ruleset actually handles. A path list alone does not define the complete restriction imposed on the worker.

## The trust-boundary mechanism

Landlock separates handled actions from permissions granted by individual rules. Handled actions are denied unless permitted through the policy; actions omitted from the handled set generally are not denied by that ruleset. The manual documents a historical exception for REFER. Consequently, observing a denied read does not establish that writes or truncation were included in the same boundary.

## Define the control contract

Define the required operation matrix before selecting flags: reading model-independent input, creating output, modifying an existing file and traversing an unrelated directory are different cases. Record the supported ABI and which requested protections remain available. If a required protection is unsupported, explicitly reject that deployment or document a narrower accepted contract; compatibility adaptation must not silently preserve a stronger claim.

## A step-by-step verification

First build disposable directories with synthetic files under an ordinary service identity. Next preserve the intended handled mask, installed rules and installation return values. Exercise permitted and forbidden operations independently, changing only the relevant right between controlled variants. Finally repeat under the actual worker launch path, including child creation. Never use private user documents as probes or infer enforcement merely from successful initialization.

## Evidence required for acceptance

Acceptance requires a table linking each required operation to a supported handled right, the relevant path rule and an observed outcome. Retain the kernel ABI, policy revision and harmless fixture identities. Include a positive control showing that ordinary permissions permit the denied operation without Landlock; otherwise filesystem ownership could explain the result. An unsupported operation remains an explicit gap rather than a successful denial.

## Failure cases and limits

Landlock adds restrictions to other access controls; it does not grant an action forbidden by ordinary permissions. Nor does a filesystem test establish complete decoder containment, network isolation or protection against every kernel vulnerability. Preexisting resources and the timing of restriction installation need separate review. The useful deliverable is an evidenced operation boundary for this launch sequence, with unsupported protections visible to its operator.

## Primary references and related reading

A Landlock allowlist is meaningful only alongside the handled-rights mask and the supported kernel ABI. [Linux Landlock policy construction](https://docs.kernel.org/userspace-api/landlock.html); [Landlock ruleset creation and handled rights](https://man7.org/linux/man-pages/man2/landlock_create_ruleset.2.html).

The proposed investigation of landlock handled rights policy gap is a proposed control review; no live security test was executed. Related reading: [Agent Sandbox with nono: pod isolation, tool policy and signed evidence](/journal/agent-sandbox-nono-pod-tool-policy-signed-audit-smoke-test/); [Read-only container will not start: where to allow temporary and cache writes](/journal/read-only-container-writable-caches/).
