fix(dv): validate Puffin blob metadata against manifest - #1615
Open
fallintoplace wants to merge 2 commits into
Open
fix(dv): validate Puffin blob metadata against manifest#1615fallintoplace wants to merge 2 commits into
fallintoplace wants to merge 2 commits into
Conversation
Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
Signed-off-by: Minh Vu <vuhoangminh97@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.
Problem
ReadDVfinds a Puffin blob using the manifest entry'scontent_offsetandcontent_size_in_bytes, then validates its cardinality. It does not verify that the selected footer entry is adeletion-vector-v1blob for the manifest'sreferenced_data_file.That leaves a gap when one Puffin file contains deletion vectors for multiple data files. A malformed manifest entry can point to another blob with the same cardinality, pass the existing checks, and return row positions belonging to a different data file.
Fix
Before reading or decoding the blob payload,
ReadDVnow:referenced_data_filedeletion-vector-v1referenced-data-fileproperty to match the manifest valueThe existing cardinality checks and compatibility behavior for a missing Puffin
cardinalityproperty are unchanged.Tests
Added coverage for mismatched and missing data-file references, a non-DV blob at the selected range, and both nil and empty manifest references.
go test ./table/dvgo test ./...golangci-lint run --timeout=10m