Repository navigation
fix(cache): contain and bound the fs origin's outboard read; zeroize node key buffers - #2793
Merged
Merged
Conversation
…node key buffers Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Code coverage overviewLanguages: Rust, Solidity Rust / code-coverage/cargo-llvm-cov
View coverage of the 6 most impacted files.
Solidity / code-coverage/forge
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
The filesystem outboard read presized its buffer with Vec::with_capacity, which aborts the process when the allocator refuses. It now goes through read_capped, which reserves with try_reserve_exact and returns an OutOfMemory error for that one read, as std::fs::read does. New tests cover the reservation failure and the one-byte-past-the-cap bound. Comments, the Origin trait docs and the engine's outboard doc now state what the checks cover: the fstat re-check catches a swapped-in device but not a FIFO, and the filesystem origin's escape and non-regular-file refusals are origin errors. The CHANGELOG entry moves to Security and splits the identity-key change into its own common bullet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 31, 2026
Contributor
Author
|
Review fix pass in 42fa94e:
Issues that were already there before this PR and that the review turned up:
|
…guard-key-zeroize # Conflicts: # CHANGELOG.md
…guard-key-zeroize # Conflicts: # CHANGELOG.md
…file straight into a wiped buffer read_capped presizes from the stat, but a file that grows or shrinks before the read leaves spare capacity that the outboard cache does not budget. The successful buffer is now shrunk to its length. load_from built its Zeroizing wrapper around fs::read's result, so a read that failed partway dropped std's unwiped buffer. It now opens the file and reads into a wiped [u8; 32], with a one-byte probe to refuse an over-long file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Gas snapshotNo gas changes vs base. |
thiras
approved these changes
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Two local-hardening fixes from #2775.
Filesystem origin outboard read.
FilesystemOrigin::fetch_outboardread{hex}.obao4with no symlink containment and no regular-file check. A symlink to/dev/zeropassed the metadata length gate and grew memory without bound (the origin timeout cannot cancel the blocking read), a FIFO pinned a blocking-pool thread, and a symlink out ofcache.origin.pathread foreign files.fetch,fetch_range_data,sizeandfetch_outboardall use it, so a FIFO or device inside the base no longer blocksfetchat open either.fetch_outboardre-checks the opened handle and reads throughtake(outboard_max_bytes + 1)into a buffer sized from the stat, so the cachedBytesholds no spare capacity.fetchalready treats data objects; the engine falls back to a whole-blob pull./dev/zero, a directory and a socket in place of the outboard, a special file for each read method, and no spare buffer capacity.Identity key buffers.
load_fromand the two key writes indecdn-commonnow hold the key bytes inzeroize::Zeroizingbuffers, so they do not linger in freed memory.decdn-commongains a directzeroizedependency (already a workspace dependency).Closes #2775
🤖 Generated with Claude Code