Skip to content

fix(flutter): reject ambiguous ELF mappings and bound note reads - #2334

Merged
morluto merged 4 commits into
morluto:mainfrom
3QL:fix/flutter-post-merge-bounds
Oct 13, 2026
Merged

morluto merged 4 commits into
morluto:mainfrom
3QL:fix/flutter-post-merge-bounds

Conversation

@3QL

@3QL 3QL commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • 147 focused Flutter cases across Linux, macOS Sonoma 14.8.9 and Windows 11 build 26300.9457.
  • Real Gallery CLI/stdio MCP verification across all three ABIs, plus a plain-APK negative control.
  • Six compiler-produced ELF32/ELF64 SysV/GNU/both-hash cases.
  • Static, documentation, discovery and duplication checks passed.
  • Windows verification ran under a non-administrator account.

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.

me and others added 2 commits October 12, 2026 21:36
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.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@3QL 3QL changed the title ix(flutter): reject ambiguous ELF mappings and bound note reads fix(flutter): reject ambiguous ELF mappings and bound note reads Oct 12, 2026
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026

Copy link
Copy Markdown
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.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the latest test changes introduce no blocking issue.

Summary

The PR rejects conflicting ELF load mappings and limits ELF note reads while retaining observed build IDs.

  • Flutter symbols use only file mappings that agree across their full range.
  • Engine build-ID checks stop after 1,024 distinct nonempty note ranges.
  • The Flutter verifier uses a shared temporary parent and cleans it up.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[ELF load segments] --> B[Normalize overlapping mappings]
  B --> C{Requested range has one file mapping?}
  C -->|Yes| D[Read symbols and dynamic tables]
  C -->|No| E[Leave affected symbols unresolved]
  F[ELF note declarations] --> G[Skip empty ranges and exact duplicates]
  G --> H[Retain at most 1024 ranges]
  H --> I[Read retained ranges and keep observed build IDs]
  E --> J[Report partial coverage]
  H -->|Limit exceeded| J
Loading

Reviews (3) · Last reviewed commit: "test(flutter): parse complete facts thro..." · Reviewed by Greptile

Comment thread scripts/verify-flutter.mjs Resolved
@morluto
morluto merged commit e3a012d into morluto:main Oct 13, 2026
5 of 6 checks passed
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: build Build, CI, packaging, and publishing P2: medium Medium priority issue labels Oct 13, 2026
@morluto morluto added the provider: flutter Analysis provider / engine: flutter label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working P2: medium Medium priority issue provider: flutter Analysis provider / engine: flutter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants