astrid-runtime/astrid · error

FUSE lease manifest exceeds the bounded size

Error message

FUSE lease manifest exceeds the bounded size

What it means

validate_lease reads the lease.json manifest from the FUSE lease resource directory and enforces a hard 64 KiB size cap before deserializing it into StorageMountLeaseV1. The library throws this to avoid allocating unbounded memory on a hostile or corrupted manifest file. It is a security bound, not a format error: the file exists and is readable but is simply too large to be a legitimate kernel-issued lease manifest.

Solutions

  1. Delete the oversized lease.json and re-run the launch so the kernel regenerates a fresh, correctly sized manifest
  2. Inspect lease.json for unexpected or duplicated content (e.g. embedded blobs, concatenated JSON) and remove whatever inflated it
  3. Ensure nothing else writes into the lease resource_path directory; it must be managed exclusively by the kernel
  4. Check permissions so unprivileged processes cannot modify files under resource_path

Example fix

// before: manually editing/merging into lease.json grew it past 64 KiB
cat extra-metadata.json >> leases/abc/lease.json

// after: never hand-edit the manifest; regenerate it
rm leases/abc/lease.json
# re-run the launch so the kernel writes a fresh manifest
Defensive patterns

Strategy: validation

Validate before calling

let md = std::fs::metadata(manifest_path)?;
if md.len() > 64 * 1024 { /* regenerate manifest before launch */ }

Prevention

When it happens

Trigger: Calling validate_launch when the lease.json file under lease.resource_path is larger than 64 * 1024 bytes (65536 bytes) at the moment of validation.

Common situations: A stale or corrupted lease.json left behind by a crashed previous launch; a user or misconfigured kernel writing extra metadata into the manifest; an attacker tampering with the private lease directory; accidental duplication of manifest content by tooling that merges JSON files.

Understand the failure class

Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/617c402aadb3d52c. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-storage-provider-fuse/src/service.rs:233

    if lease.expires_at_epoch_secs < now {
        bail!("FUSE lease is expired");
    }
    if !lease.resource_path.is_absolute() || !lease.callback_path.is_absolute() {
        bail!("FUSE lease paths must be absolute");
    }
    if lease.callback_path != lease.resource_path.join("control.sock") {
        bail!("FUSE callback path is not the kernel lease endpoint");
    }
    platform_fs::validate_private_directory(&lease.resource_path)
        .context("validate private FUSE lease resource")?;
    platform_fs::verify_no_redirects(&lease.resource_path)
        .context("reject redirected FUSE lease resource")?;
    let manifest_path = lease.resource_path.join("lease.json");
    platform_fs::validate_private_file(&manifest_path)
        .context("validate private FUSE lease manifest")?;
    let manifest = std::fs::read(&manifest_path).context("read FUSE lease manifest")?;
    if manifest.len() > 64 * 1024 {
        bail!("FUSE lease manifest exceeds the bounded size");
    }
    let admitted: StorageMountLeaseV1 =
        serde_json::from_slice(&manifest).context("decode FUSE lease manifest")?;
    if admitted != *lease {
        bail!("FUSE launch lease does not match the kernel manifest");
    }
    Ok(())
}

fn validate_mountpoint(mountpoint: &Path, resource_path: &Path) -> Result<()> {
    if !mountpoint.is_absolute()
        || mountpoint
            .components()
            .any(|component| matches!(component, std::path::Component::ParentDir))
        || mountpoint.parent().is_none()
    {
        bail!("FUSE service mountpoint is malformed");
    }

View on GitHub (pinned to affd8760f4)