fix(safety): make the rollback temp path collision-resistant
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- operating-systems
Research direction
Locate the rollback temp-file creation and read how its PID-based name and File::create call are used. Change the name and creation behavior as suggested, then verify that collisions fail rather than truncate and that rollback snapshots remain usable after compression failure.
Written by the indexing model from the issue text.
Description
The rollback temp file is named from the PID alone and created with File::create, which truncates an existing file. Two failure modes follow:
- A stale temp left by a crashed process with the same PID is silently truncated and reused.
- Two concurrent rollbacks in the same process share one path and race, so one can overwrite the other's snapshot.
Both matter because this file is the rollback snapshot — the copy used to restore the original after a failed compression. Losing it turns a recoverable failure into a corrupted file.
A fork of this engine in abitious named the temp with PID + nanos + a counter and created it with create_new (O_EXCL), so a collision fails loudly instead of truncating. That fork is now deleted in favor of depending on this crate, so the hardening is lost unless it lands here.
Suggested fix: add nanos and a process-local counter to the name, and switch File::create to OpenOptions::new().create_new(true).
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SocketDev/decmpfs
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in SocketDev/decmpfs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·