Validate untrusted footer metadata on open instead of panicking#8867
Conversation
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Merging this PR will improve performance by 12.27%
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|
Polar Signals Profiling ResultsLatest Run
Previous Runs (2)
Powered by Polar Signals Cloud |
Benchmarks: Vortex queries 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.912x ➖, 0↑ 0↓)
datafusion / parquet (0.839x ✅, 2↑ 0↓)
duckdb / vortex-file-compressed (0.883x ✅, 1↑ 0↓)
duckdb / parquet (0.961x ➖, 0↑ 0↓)
No file size changes detected. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e48c79c5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
|
I had no idea that codex could talk FOR me here without a prompt... I guess it was the correct fix though |
Closes: #8819
A fuzzed Vortex file whose footer segment map declared a segment past the end of the file panicked while slicing the backing buffer during open, instead of returning an error. This fixes that plus a few nearby unchecked-slice / unchecked-shift panics in the same file-open and array-decode paths:
offset + lengthagainst the file size (the Panic inSerializedArray::from_flatbuffer_and_segment(uncheckedBufferHandle::slice) #8819 root cause).populate_initial_segmentsbounds-checks the initial-read slice range before slicing.SerializedArray::from_flatbuffer_and_segmentuses checked offset arithmetic and bounds-checks a buffer against its segment before slicing.Alignment::try_from_exponentinstead offrom_exponent, which panics on a too-large shift.