Repository navigation
fix(ghidra): retain relocation symbol observations - #8531
Merged
Merged
Conversation
This was referenced Nov 1, 2026
Contributor
[Medium impact] The reviewed changes appear safe to merge; no blocking code issues remain. SummaryRetains Ghidra relocation
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["Ghidra: getSymbolName()"] --> B["Evidence: retained symbol"]
B --> C["Relocation pages"]
B --> D["DOS comparison excludes symbol"]
E["Historical Evidence: symbol missing"] --> F["Page reports not recorded"]
Reviews (3) · Last reviewed commit: "test(ghidra): share load verification gu..." · Reviewed by Greptile |
morluto
marked this pull request as ready for review
November 1, 2026 15:14
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Entrpi
added a commit
to Entrpi/rea
that referenced
this pull request
Nov 1, 2026
main moved the real-toolchain lanes section from docs/testing.md to docs/testing-lanes.md. docs/testing.md takes main's version, the verify:ghidra:cortex-m paragraph moves to the same place in docs/testing-lanes.md, and the raw-binary guide links there. main's load-image observation (morluto#8531) and procedure search (morluto#8520) revisions change every Ghidra profile digest. With this branch's own bridge and shared semantics, the merged tree keeps every earlier pin, so the move is main's alone. The legacy pins take main's own digests at d3ab0fa, which the merged branch matches for all five loads; the variant digest is re-pinned. The compatibility test accepts the two new revisions beside instruction_status and still requires the rest of the saved profile.
Entrpi
added a commit
to Entrpi/rea
that referenced
this pull request
Nov 1, 2026
main's load-image observation (morluto#8531) and procedure search (morluto#8520) revisions change every Ghidra profile, so this branch's pins move again: morluto#7951's raw digests and its pre-morluto#7823 snapshot comparison, which now also sets aside the two revisions, Q10's digests outside the M-profile ELF lane, and morluto#8464's RISC-V images without an overlap. With this branch's earlier bridge and shared semantics, every earlier pin holds, so the move is main's alone. The legacy raw comment now says that these pins include Change 2's revision, as Q10's does.
Entrpi
added a commit
to Entrpi/rea
that referenced
this pull request
Nov 1, 2026
main's load-image observation (morluto#8531) and procedure search (morluto#8520) revisions change every Ghidra profile digest, so the profiles of images without an overlap move with main. With this branch's own bridge and shared semantics, the merged tree keeps the earlier pins, so the move is main's alone. Both pins take main's own digests at d3ab0fa, which the merged branch matches.
coyoteXujie
pushed a commit
to coyoteXujie/rea
that referenced
this pull request
Nov 2, 2026
* fix(ghidra): retain relocation symbol observations * test(ghidra): verify named relocation symbols through CLI * fix(ghidra): clarify verification and supervise test commands * test(ghidra): share load verification guidance
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
Fixes #8529. Ghidra load-image relocation rows now retain the symbol name recorded by Ghidra, so a relocation to an imported symbol can be attributed without interpreting its analysis-time bytes as a runtime address. Empty strings and nulls are preserved as returned; older Evidence with no recorded symbol stays unrecorded and relocation pages disclose that uncertainty.
Contract and boundary impact
Relocation.getSymbolName()into the existing load-image Evidence and its default/selectable relocation pages. This is an existing read-only observation; no maintainer scope decision is required.Expected effects: reading caller-selected files and launching Ghidra in its existing ephemeral analysis environment; the target is not executed or modified.
Evidence and regression coverage
On the base, an x86-64 ELF with
R_X86_64_64 audit_externalproduced a Ghidra relocation row with original and analysis-memory bytes but no symbol. A direct Ghidra 12.1.4 headless control returnedaudit_externalfromgetSymbolName()for the same row; LLVM independently identified the undefined relocation symbol.On this change, real Ghidra stdio MCP in full and compact profiles returned
symbol: "audit_external"in complete and default relocation-page output. A separate relative relocation returned Ghidra's empty string unchanged. The selected pages survived export and import into a fresh target-free server; an authentic old Evidence record remained unrecorded and its page disclosed the unknown. Successful replies validated against the advertised output schemas using Ajv 2020 with strict and format checks disabled. Both source fixture digests and exported bundle digests stayed unchanged; the binaries were not executed. A Ghidra analysis-time address and status do not prove runtime binding.The focused tests cover provider-boundary parsing of named, empty and null symbols; current and historical page projection; and preservation without overclaiming independent DOS verification. The real DOS verifier checks that each relocation carries a symbol observation and that independently verified DOS loading still passes. A source-built ELF regression in the real Ghidra cross-format lane checks a named external relocation and an unnamed relative relocation through the public CLI. Run alone, it failed on #8509 at the missing name and passed on this branch; the source-owned target stayed unchanged. The full cross-format lane ran the new check but then failed in the pre-existing native-value verifier input-limit issue #8172, before completing the remaining cross-format checks. Windows, other Ghidra versions and autonomous-agent behavior were not tested.
The DOS limitation regression uses the owning guidance constant while separately checking verified status and retained symbol. A temporary wording-only mutation passed; a temporary mutation dropping the symbol failed as expected.
Validation performed
npm run test:local -- src/ghidra/GhidraLoadImageValues.test.ts src/ghidra/GhidraRawProfileDigest.test.ts src/application/analysisView/NativeLoadImageViews.test.ts— 64 passed.npm run check:fast,npm run docs:check, changed-file formatting andgit diff --check— passed.npm run verify:ghidra:doswith Ghidra 12.1.4/JDK 21 on macOS arm64 — passed, including the new real relocation-symbol presence check and verified cleanup.npm run verify:ghidra:cross-formatran that new check, then failed at the existingcompare_functions1,024-element input allowance ([Bug] Ghidra verification sends function Evidence beyond the default MCP input allowance #8172); the full lane did not pass.Combined cross-format verification
On macOS arm64 with Ghidra 12.1.4 and JDK 21, the full cross-format lane passed in an isolated checkout of prior head
d232c43d9after applying verifier-only changes from #8491 and #8381 and the equivalent structured snapshot assertion from #8536. It exercised seven fixture variants and the new named/unnamed relocation control; process lineage was verified with no remaining descendants and cleanup complete. This combined result does not claim that the clean branch passes the lane without those separate verifier fixes.Review follow-up
The DOS attestation now states that Ghidra relocation symbol names are retained observations, not independently verified; the independent relocation comparison still excludes the symbol. The verifier's compiler, linker, and CLI subprocesses now use the shared command owner, and its private runtime root is released only after command cleanup succeeds. The test now reports a failed
Resultdirectly.On the follow-up, 62 focused tests and
check:fastpassed. The supervised named/unnamed real Ghidra CLI regression passed and failed at its intended assertion on the old branch. A forced compiler failure returned an error and left no owned workspace in the controlled temporary parent. The real Ghidra DOS lane passed again with verified cleanup and no remaining descendants. These are one-host controls; the full combined cross-format result below predates this follow-up. CodeQL review for the new command-owner implementation is pending.Historical snapshot control
A real Ghidra snapshot made on #8509 was rejected on this branch with
evidence_integrity_mismatchand a profile-digest mismatch; a fresh analysis returnedaudit_external. Manually extracting the snapshot's embedded Evidence bundle and importing it into a fresh target-free server preserved the old record exactly, and its relocation page reported the symbol as unrecorded. Manual extraction is a test control, not an advertised snapshot migration feature. Target, snapshot, and extracted bundle digests stayed unchanged.Compatibility, safety, and release
No runtime binding is inferred. Existing retained observations can omit the new field; new Ghidra profiles differ, so old analysis snapshots do not silently replay the earlier projection. Real provider coverage is limited to the host and fixtures above.
Author readiness
Human owner: