Repository navigation
fix: reject corrupt blob reads - #80
Merged
Merged
Conversation
Signed-off-by: wchwawa <wch19961116@gmail.com>
Signed-off-by: wchwawa <wch19961116@gmail.com>
Compact records from the 0.8 line must never expose bytes beyond their authenticated extent. Read that prefix, clear the rest, and verify independent blobs in parallel for large Linux batches while preserving per-blob results. Signed-off-by: wchwawa <wch19961116@gmail.com>
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.
TLDR
Reject damaged file-backed blob reads and respect the authenticated extent of compact records.
Problem
A changed byte in an active blob could reach a reader without a storage error. This is a private security follow-up; no public issue was opened under
SECURITY.md.Consequences
A caller could consume a wrong value, and bytes outside a compact record's extent could come from a reused slot.
Example
A read of a damaged page now returns
NodeCorrupt. A range read beyond a compact record's extent returns zeros rather than old slot bytes.Solution
Bind per-page checksums to each published blob slot, make the checksum record durable before its manifest mapping, and verify reads before returning them. Existing version 6 stores migrate on writable open. Large Linux batches verify independent blobs on separate workers while preserving result order.
Gain
Persistent blob damage is reported at the read boundary. Compact records from the 0.8 line remain readable without exposing their unpersisted tail.
Tradeoffs
CRC detects accidental damage, not an attacker who can rewrite storage metadata. Damage already present during legacy migration cannot be authenticated. Version 6 read-only opens need a prior writable migration. The 0.8 backport's synthetic dense-frame benchmark shows material checksum overhead; 0.9.2 product performance is not qualified. This PR remains Draft.
Validation
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warningson macOS, and Linux io-uring Clippy passed.git diff --checkpassed.The current NoKV dependency uses published Holt 0.8.7. The matching 0.8.8 backport is #81.