Skip to content

sec(sandbox): BestEffort Landlock silently degrades to no filesystem sandbox #584

Description

@cluster2600

Summary

When LandlockCompatibility::BestEffort is set (the default, per crates/openshell-policy/src/lib.rs:88), any Landlock error is silently swallowed with a debug-level log at crates/openshell-sandbox/src/sandbox/linux/landlock.rs (lines 69–76).

On kernels older than 5.13 or with Landlock disabled, the filesystem sandbox is completely bypassed with no warning to the operator.

Additionally, the implementation is pinned to Landlock ABI V2 (line 33), missing protections from newer ABIs: V3 adds TRUNCATE, V4 adds network restrictions, V5 adds ioctl scoping.

Impact

  • Severity: Medium
  • Operators may believe filesystem restrictions are enforced when they are not.
  • Newer kernel protections are not leveraged even when available.

Proposed Fix

  1. Emit a warning-level log (not debug) when Landlock is unavailable or degraded
  2. Consider making HardRequirement the default in production deployments
  3. Use the highest available Landlock ABI via feature detection rather than hardcoding V2

Activity

  1. added a commit that references this issue on Mar 24, 2026
    013d869
  2. added a commit that references this issue on Mar 26, 2026
    6828e14
  3. added a commit that references this issue on Apr 8, 2026
    e14d1b7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions