-
Notifications
You must be signed in to change notification settings - Fork 27
[Bug]: Linux without openat2 cannot complete nested no-clobber moves; native-off also disables required operations #511
Copy link
Copy link
Open
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Activity
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
On Linux
4.4.302+, fs-safe 0.13.1's Linux native path requires unavailableopenat2for nested paths. Native-off avoids that call but intentionally disables no-clobberRoot.move(), leaving an OpenClaw retained-state migration without a working path. Please expose/validate the actual operation capabilities and consider secure older-kernel support while retaining native no-replace operations that the host does implement.Minimal reproduction
Tested in a disposable published OpenClaw 2026.9.5 container, without production mounts, Node
v24.19.0, with its installed@openclaw/fs-safe@0.13.1:Observed for both
autoandoff:Positive control: with source and destination directly under the root (no
nested/prefix), nativeautosuccessfully moves the file on this host;offstill refuses. Nested parent resolution matters.Expected behavior
Keep collision and path-containment guarantees. Detect and report unavailable operations before a consumer starts migration; document the supported kernel/capability floor. If older-kernel support is intended, retain available native primitives and provide a reviewed resolver or explicitly labeled policy-controlled fallback. A userspace walk must not falsely report
kernel-atomiccontainment. This is not a request to change no-clobber moves into overwriting rename or silently ignore safety failures.Actual behavior and downstream impact
The Linux resolver calls
openat2(BENEATH | NO_MAGICLINKS)directly. A real pinned-plugin installation failed withopenat2 beneath root: Function not implemented (os error 38).We then rehearsed the full downstream upgrade on Btrfs-cloned state with both
OPENCLAW_FS_SAFE_NATIVE_MODE=offandFS_SAFE_NATIVE_MODE=offverified in the candidate. First Doctor exited 1:OpenClaw's
stageAuditRecoveryRestore()writes and syncs a staging journal, then uses default no-overwriteRoot.move()to publish it. Native-off returns no binding, so this fails as designed. The old installation was restored and independently verified healthy; candidate startup and subsequent gates were not reached.A separate direct syscall probe on disposable files in the updater's Btrfs data mount returned
ENOSYSforopenat2, butrenameat2(RENAME_NOREPLACE)correctly returnedEEXISTfor an occupied destination without changing either file, and succeeded for an absent destination. All probe resources were removed. This establishes capabilities in that tested container/filesystem, not every mount or security policy; syscall filtering was not independently excluded.Package version or commit
@openclaw/fs-safe@0.13.1, source7022a0a10c53e36f34a467df68ed5614a1db1741. Main6953a1d85a92160f036b9ce9cfd5c8f096f92cbestill has directopenat2resolution. Updating to current main has not been tested.Affected surface
Atomic operations and file locking; rooted path resolution.
Environment
Synology DSM; Linux
4.4.302+; x86_64; Nodev24.19.0; Docker. Minimal package reproducer uses disposable container temporary storage; real migration uses Btrfs bind mounts. No credentials, personal paths, hostnames, or private content included.Cross-references and provenance
Searches for
openat2,ENOSYS,Synology, and older-kernel reports found no matching existing fs-safe issue. Happy to consolidate if a canonical tracker exists.