Landlock lets an unprivileged process build a sandbox around itself and its future children. That is useful for application confinement, but a ruleset is constrained by the kernel's supported Landlock ABI. A policy that names a right the running kernel does not support will not become a complete network boundary just because the process asked for it.

The Linux kernel documentation describes filesystem rules and network rules. Filesystem rules apply to file hierarchies and specific file actions. Network rules restrict TCP and UDP actions by port. The documentation states that network rules arrived in ABI v4 for TCP and ABI v10 for UDP. A binary intended to run across kernel versions therefore needs to query the ABI and enable only the rights it can enforce.

The handled_access_fs, handled_access_net, and scoped attributes define which rights the ruleset intends to manage. A process must be explicit about denied-by-default rights. If it omits UDP handling on an older ABI, for example, it may still have a useful TCP restriction but it does not have equivalent UDP coverage. That difference belongs in the deployment requirement, not in a footnote.

Landlock is also deliberately narrow. The documentation says threads sandboxed with filesystem restrictions cannot modify filesystem topology through mount(2) or pivot_root(2), but it does not claim to restrict every possible data path. Files accessed through /proc/<pid>/fd/* and special filesystems can have different behavior. Network rules restrict ports, not DNS names, destinations, or application-level commands. A sandbox may allow a connection to one port while the application still sends a dangerous request to a permitted peer.

Good tests answer three questions.

  1. 1.

    Which ABI does the host kernel report?

  2. 2.

    Which filesystem and network rights were included in the ruleset?

  3. 3.

    Did a denied operation fail, and did an allowed operation still work?

Run the test inside the same container image and under the same service manager that production uses. Check both TCP and UDP when the policy claims to cover both. Exercise file creation, rename, link, truncate, execute, and read operations where those rights are handled. For network tests, bind and connect to an allowed port and a denied port. A TCP success on an old kernel does not prove that the equivalent UDP restriction works.

The deployment should record a minimum ABI for each feature. It should also fail closed when a required capability is absent. A startup warning is easy to miss when the service continues with a weaker sandbox. Operators can make Landlock's logs and denial records part of observability, but those logs are evidence of attempted access, not proof that all unsafe paths are blocked.

Landlock is valuable because it can reduce ambient authority without requiring root. Its value depends on matching the requested policy to the kernel that enforces it and on testing the paths that remain outside the ruleset.

References