{"record":{"id":"49cebe53f970ad21","repo":"astrid-runtime/astrid","slug":"fuse-launch-lease-does-not-match-the-kernel-manife","errorCode":null,"errorMessage":"FUSE launch lease does not match the kernel manifest","messagePattern":"FUSE launch lease does not match the kernel manifest","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/service.rs","lineNumber":238,"sourceCode":"    }\n    if lease.callback_path != lease.resource_path.join(\"control.sock\") {\n        bail!(\"FUSE callback path is not the kernel lease endpoint\");\n    }\n    platform_fs::validate_private_directory(&lease.resource_path)\n        .context(\"validate private FUSE lease resource\")?;\n    platform_fs::verify_no_redirects(&lease.resource_path)\n        .context(\"reject redirected FUSE lease resource\")?;\n    let manifest_path = lease.resource_path.join(\"lease.json\");\n    platform_fs::validate_private_file(&manifest_path)\n        .context(\"validate private FUSE lease manifest\")?;\n    let manifest = std::fs::read(&manifest_path).context(\"read FUSE lease manifest\")?;\n    if manifest.len() > 64 * 1024 {\n        bail!(\"FUSE lease manifest exceeds the bounded size\");\n    }\n    let admitted: StorageMountLeaseV1 =\n        serde_json::from_slice(&manifest).context(\"decode FUSE lease manifest\")?;\n    if admitted != *lease {\n        bail!(\"FUSE launch lease does not match the kernel manifest\");\n    }\n    Ok(())\n}\n\nfn validate_mountpoint(mountpoint: &Path, resource_path: &Path) -> Result<()> {\n    if !mountpoint.is_absolute()\n        || mountpoint\n            .components()\n            .any(|component| matches!(component, std::path::Component::ParentDir))\n        || mountpoint.parent().is_none()\n    {\n        bail!(\"FUSE service mountpoint is malformed\");\n    }\n    if mountpoint == resource_path\n        || mountpoint.starts_with(resource_path)\n        || resource_path.starts_with(mountpoint)\n    {\n        bail!(\"FUSE service mountpoint overlaps the lease resource\");","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/service.rs#L220-L256","documentation":"After parsing lease.json into StorageMountLeaseV1, validate_lease compares it with the lease supplied by the kernel in the launch request. Any field mismatch between the on-disk manifest and the in-kernel lease aborts the launch, since the kernel manifest is the authoritative record of the mount agreement. This prevents launching a FUSE service against a tampered, stale, or mismatched manifest.","triggerScenarios":"Calling validate_launch when the deserialized lease.json on disk is not equal (PartialEq) to the StorageMountLeaseV1 passed in the lease argument — e.g. fields differ after the manifest was edited, replaced, or generated for a different launch.","commonSituations":"A previous launch's manifest still on disk while the kernel issued a new lease with different mount/resource parameters; the manifest was hand-edited; the resource directory was reused across launches; a race where the manifest is rewritten between launches.","solutions":["Remove the stale lease.json from resource_path and relaunch so the kernel writes a manifest matching the current lease","Compare the on-disk lease.json with the kernel-issued lease fields (resource, mountpoint, callback) to identify which field diverged","Ensure each launch uses a unique resource_path so manifests from prior launches cannot be compared against a new lease","Verify no external process rewrites lease.json between lease issuance and validate_launch"],"exampleFix":"// before: reusing a directory whose manifest belongs to an older lease\nvalidate_launch(&old_lease)\n\n// after: fresh resource per lease, manifest regenerated\nlet resource_path = lease_dir_for(&lease.id); // unique per launch\nvalidate_launch(&lease)","handlingStrategy":"validation","validationCode":"let on_disk: StorageMountLeaseV1 = serde_json::from_slice(&std::fs::read(manifest_path)?)?;\nif on_disk != expected_lease { /* relaunch with a fresh manifest */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a unique resource_path per launch","Never reuse a lease directory across launches","Let the kernel write manifests exclusively"],"tags":["fuse","lease-mismatch","integrity-check","manifest"],"backgroundTag":"checksum-mismatch","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}