Repository navigation
fix(flutter): reject ambiguous ELF mappings and bound note reads - #2334
Merged
Merged
Conversation
Resolve PT_LOAD interpretations once for symbols and dynamic tables, including partial overlaps. Preserve equivalent mappings and leave conflicting or invalid alternate definitions unresolved. Bound distinct nonempty ELF note ranges before retention and reads, deduplicate shared ranges, preserve observed build-ID candidates and report partial coverage on exhaustion. Correct shared verifier workspace ownership and structured Windows path assertions. Addresses the two post-merge review findings on PR morluto#1582. Validation: 147 focused cases across Linux, macOS Sonoma 14.8.9 and non-administrator Windows 11 build 26300.9457; real Gallery CLI/MCP checks on all three hosts; six compiler-produced ELF32/ELF64 hash-layout cases; static, docs, discovery and duplication checks. Full string-pool projections remain explicitly bounded.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Owner
|
@greptileai review |
Contributor
|
This PR is set for a Plus review. TREX isn't supported with Plus or Apex reviews yet, so Greptile reviews this PR at Base while TREX is on. |
Contributor
|
12 of 19 tasks
4 of 9 tasks
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.
Summary
Follow-up to #1582 addressing the two remaining ELF review findings.
Conflicting PT_LOAD mappings
The parser previously selected the first matching segment, potentially reporting complete coverage despite conflicting file interpretations.
Normalize load mappings once and reuse them for snapshot symbols, dynamic hash tables, dynsym and dynstr. Equivalent mappings remain valid; conflicting partial overlaps leave affected symbols unresolved while preserving other observations.
Unbounded ELF note ranges
The metadata byte budget did not bound the number of retained ranges or separate reads.
Limit the inventory to 1,024 distinct nonempty ranges before retention. Deduplicate shared ranges, skip empty ranges, and preserve examined build-ID candidates with partial coverage when the limit is exceeded.
Also correct shared verifier workspace ownership and structured Windows path assertions.
Validation
Validation of fix commit
337b12e34:The 30,000-range fixture now requires at most 1,027 reads. An indicative CLI sample improved from 1.50s to 0.77s elapsed and 1.99s to 1.13s CPU. Peak process RSS changed from 333 to 324 MiB. OS caches were uncontrolled; token usage and summed process-family peak memory were not measured.
Full string-pool projections remain explicitly bounded.