Repository navigation
fix(security): make no-clobber root moves atomic - #357
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 16, 2026, 5:32 AM ET / 09:32 UTC (Revision 6). ClawSweeper reviewWhat this changesThe branch makes no-clobber moves atomic, preserves isolated producer publication through identity-checked hard links, and strengthens temporary-workspace admission and cleanup. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful security fix: current main still separates the destination check from a replacing rename. No blocking code defect was found. The previous workspace-authority proof hold is no longer applicable because that work merged separately. Priority: P2 Review scores
Verification
How this fits togetherfs-safe guards filesystem operations requested by Node.js applications. Root moves and isolated producer publication turn caller-supplied paths and completed output files into guarded filesystem mutations. flowchart TD
A[Caller paths or producer output] --> B[Root and parent admission]
B --> C{Publication operation}
C --> D[Native no-replace move]
C --> E[Identity-pinned hard-link handoff]
D --> F[Published file or collision rejection]
E --> F
F --> G[Identity verification and owned cleanup]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain atomic no-clobber publication and the accepted native-required boundary, with identity-preserving producer compatibility and quantified performance costs. Do we have a high-confidence way to reproduce the issue? Yes: current main exposes a target-creation window between its absence check and replacing rename. This review established the mechanism from source, without executing it. Is this the best way to solve the issue? Yes: using the existing atomic native primitive fixes the collision decision directly, while the guarded hard-link handoff preserves isolated producer behavior without restoring the unsafe rename fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 59e85b8656ca. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
ef66845 to
1abdf36
Compare
|
Exact-head runtime evidence for The native collision case loaded the real bundled addon through the production loader, used mode Owner decision: accept the documented upgrade boundary. Public default no-clobber Final performance qualification is still pending and will be posted separately before merge. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Admit temporary-workspace roots and children before use, preserve existing permissions, and bind mode initialization and cleanup to retained directory identities.
Keep real sidecar acquisition and draining outside the wrapper-construction timeout. Track setup and test completion so fixture removal cannot race timed-out filesystem work.
Make no-clobber Root moves atomic through native rename primitives and preserve identity-pinned isolated producer handoff, including legacy Windows delete-pending behavior.
1abdf36 to
5fe53dd
Compare
Keep boundary error codes and details primary when Windows descriptor disposal also fails. Retain combined-error behavior on POSIX and cover both root and parent admission with real closed-descriptor checks.
Root moves without overwrite could race a separate destination check and replace a file created by another writer. This change uses native atomic no-replace rename, snapshots overwrite before admission, and rechecks deny rules against the canonical source and destination actually selected by native parent admission. Missing atomic support fails closed with the documented helper-unavailable result.
Native-off isolated producers retain a zero-copy hard-link handoff. Maintainer review found and fixed legacy Windows deletion behavior: the pin transfers to an already-verified sibling descriptor before source retirement, and a cleared read-only attribute is restored and verified through that descriptor. Identity, one-link publication, original callback receivers, cleanup ownership, and existing sync access requirements remain enforced.
The integrated JavaScript suites pass 80 tests (2 platform skips), all 88 Rust workspace tests pass, and fresh independent review through P2 is clean. Real Windows NTFS probes reproduced the original directory-cleanup and read-only-bit failures on Node 22.0.0 and proved the descriptor-transfer/restoration approach; current Node 24 controls also passed. The packed package passed real Windows NTFS tests on Node 22.0.0 and Node 24.11.1: identity, contents, mode, and cleanup were verified, with existing write-access failures preserved for read-only outputs requesting sync. A follow-up preserves the established Windows admission-error precedence when cleanup also fails; 23 focused tests pass and independent review is clean. Final head
c6e02f3c47f5970cd3d5abbf8b9c3dd32a9ab944passed the full CI matrix, including Windows native coverage of admission-error precedence, and was fast-forwarded onto main.