tinyhumansai/openhuman · error · io::Error

Landlock not available

Error message

Landlock not available

What it means

Availability probe inside LandlockSandbox::with_workspace: constructing a minimal Ruleset with handle_access(ReadFile|WriteFile) tests whether the kernel exposes the Landlock LSM. If that ruleset cannot be created (kernel < 5.13, Landlock compiled out of the kernel, or seccomp restrictions in the container), the constructor returns this error rather than a half-functional sandbox.

Source

Thrown at src/openhuman/security/landlock.rs:38

#[cfg(all(feature = "sandbox-landlock", target_os = "linux"))]
impl LandlockSandbox {
    /// Create a new Landlock sandbox with the given workspace directory
    pub fn new() -> std::io::Result<Self> {
        Self::with_workspace(None)
    }

    /// Create a Landlock sandbox with a specific workspace directory
    pub fn with_workspace(workspace_dir: Option<std::path::PathBuf>) -> std::io::Result<Self> {
        // Test if Landlock is available by trying to create a minimal ruleset
        let test_ruleset = Ruleset::default()
            .handle_access(AccessFs::ReadFile | AccessFs::WriteFile)
            .and_then(|ruleset| ruleset.create());

        match test_ruleset {
            Ok(_) => Ok(Self { workspace_dir }),
            Err(e) => {
                log::debug!("Landlock not available: {}", e);
                Err(std::io::Error::new(
                    std::io::ErrorKind::Unsupported,
                    "Landlock not available",
                ))
            }
        }
    }

    /// Probe if Landlock is available (for auto-detection)
    pub fn probe() -> std::io::Result<Self> {
        Self::new()
    }

    /// Apply Landlock restrictions to the current process
    fn apply_restrictions(&self) -> std::io::Result<()> {
        let mut ruleset = Ruleset::default()
            .handle_access(
                AccessFs::ReadFile
                    | AccessFs::WriteFile

View on GitHub (pinned to 7491200858)

Solutions

  1. Run on a Linux kernel >= 5.13 with CONFIG_SECURITY_LANDLOCK enabled
  2. Avoid running the core inside containers/namespaces that filter the landlock_create_ruleset syscall
  3. Fall back to another sandbox backend (bubblewrap, docker) or run unsandboxed per policy
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/openhuman/security/landlock.rs:38 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/f25cf926a05b9246. Report an issue: GitHub.