You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(worldline): attribute each write's "before" correctly across replace and fd reuse
Hardening from an audit of the capture pipeline, fixing four ways a write's
`before` content could be wrong:
- Rename-over and delete-and-recreate (the write-tmp-then-rename pattern is
ubiquitous in build tools) resurrected the replaced file's stale content. The
file's on-disk identity (inode+device, or volume+index on Windows) is now
tracked, so an empty truncating-open read keeps the prior content only when
it's the *same* file; a replaced path is treated as fresh (empty `before`).
- Under the seccomp backend (raw_fd == -1) every open of a path shared one slot,
so a second overlapping write lost its `before`. Pending opens are now a LIFO
stack per correlation key.
- A descriptor reused for another file (e.g. via dup2, which closes the old
target without a close callback) could mispair a close with a leaked open of a
different file. The close now validates the open's path and falls back to the
file's prior content on a mismatch.
The in-place truncating-rewrite fix (keeping the prior content as `before`) is
preserved. Adds store-level regression tests for each case.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments