Skip to content

fix(bflt): reject relocation tables overlapping image segments - #15188

Merged
vincentkoc merged 4 commits into
morluto:mainfrom
ShuaixinHuang:fix/bflt-relocation-start
Nov 30, 2026
Merged

vincentkoc merged 4 commits into
morluto:mainfrom
ShuaixinHuang:fix/bflt-relocation-start

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Reject bFLT relocation tables that start inside the header, text, or initialized data. Preserve the declared coordinates, complete text/data segments, and unknown relocation coverage instead of interpreting those bytes as relocations.

Validation

  • Current head: 31 focused tests passed, including 12 malformed-table cases across stored, GZIP and GZDATA images, plus valid-table controls.
  • Compilation, documentation, static checks, portable tests and the Linux package baseline passed. All required CI checks are green.
  • Canonical review found the missing data-overlap case; the fix now uses the end of initialized data. elf2flt writes relocations there.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review November 30, 2026 08:46
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-30T08:47:02.361716Z
We couldn’t complete this review. Comment @codex review to try again.
4b05f19 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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.
Credits must be used to enable repository wide code reviews.

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable defects were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

The bFLT reader now rejects relocation tables that overlap the header, text, or initialized data.

  • bFLT inventories skip relocation tables that start inside earlier segments.

No actionable issues were found. No previous review threads were supplied. The previous-review merge bases differed, so this review covered the full PR. GitHub access was unavailable, so whether another PR supersedes this one could not be checked. No tests were run during this review.

Reviews (3) · Last reviewed commit: "fix(bflt): reject relocation tables over..." · Reviewed by Greptile

* commit '11c8de1bc1c2ab922b190117e20ee48e90671db3':
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
@vincentkoc vincentkoc changed the title fix(bflt): reject relocation ranges before data fix(bflt): reject relocation tables overlapping image segments Nov 30, 2026
@vincentkoc
vincentkoc merged commit 6ea03cd into morluto:main Nov 30, 2026
42 checks passed
@vincentkoc

Copy link
Copy Markdown
Collaborator

Thanks for the fix! I also covered relocation tables overlapping initialized data. The 31 focused tests and all required CI checks passed; squash-merged.

vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
* commit 'c91c504089557f048b72989c632f504954757d46':
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
* commit 'c91c504089557f048b72989c632f504954757d46':
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
* commit 'ba90eb225510c1342c7513754e62d1139d73f472':
  perf(evidence): bound link inspection frontier by records (morluto#15189)
  perf(evidence): retain snapshots across duplicate imports (morluto#15186)
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
vincentkoc added a commit to sx4im/rea that referenced this pull request Nov 30, 2026
* commit 'ba90eb225510c1342c7513754e62d1139d73f472':
  perf(evidence): bound link inspection frontier by records (morluto#15189)
  perf(evidence): retain snapshots across duplicate imports (morluto#15186)
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
vincentkoc added a commit to DeryFerd/rea that referenced this pull request Nov 30, 2026
* commit '31cec30f51fb59b28a1849a67d09ab79b1c40094': (803 commits)
  fix(android): declare Android mapping and JNI fixed allowances (morluto#15183)
  fix(artifacts): retain deep comparison source chains (morluto#15191)
  perf(evidence): bound link inspection frontier by records (morluto#15189)
  perf(evidence): retain snapshots across duplicate imports (morluto#15186)
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  ...
vincentkoc added a commit to DeryFerd/rea that referenced this pull request Nov 30, 2026
* commit '31cec30f51fb59b28a1849a67d09ab79b1c40094': (803 commits)
  fix(android): declare Android mapping and JNI fixed allowances (morluto#15183)
  fix(artifacts): retain deep comparison source chains (morluto#15191)
  perf(evidence): bound link inspection frontier by records (morluto#15189)
  perf(evidence): retain snapshots across duplicate imports (morluto#15186)
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants