[PR #1297] [MERGED] fix(ghidra): use dot-free private session paths #2777

Closed
opened 2026-10-17 21:10:08 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1297
Author: @N0zoM1z0
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/ghidra-session-root-stability


📝 Commits (10+)

  • da606ff fix(mcp): deliver tool errors within advertised schema contracts
  • 7bf63ed chore: integrate canonical Evidence changes for MCP error delivery
  • fd46cff test(mcp): read typed errors in canonical Evidence regressions
  • 5486860 Merge remote-tracking branch 'origin/main' into fix/mcp-error-schema-delivery
  • a8b8288 fix: keep the Ghidra session root free of dot-prefixed path elements
  • 1e83d27 test(ghidra): use host-native absolute session root fixtures
  • 09058eb test(mcp): validate public error diagnostics in acceptance workflows
  • 2060a6d Merge branch 'fix/mcp-error-schema-delivery' into fix/ghidra-session-root-stability
  • f61673f Merge remote-tracking branch 'origin/main' into fix/ghidra-session-root-stability
  • 1e34197 test(ghidra): size oversized annotations for canonical delivery

📊 Changes

5 files changed (+140 additions, -3 deletions)

View changed files

📝 scripts/lib/native-value-e2e.mjs (+9 -0)
📝 scripts/lib/real-ghidra-large-results.mjs (+4 -1)
📝 src/ghidra/GhidraClient.ts (+2 -2)
➕ src/ghidra/GhidraSessionRoot.test.ts (+70 -0)
➕ src/ghidra/GhidraSessionRoot.ts (+55 -0)

📄 Description

Ghidra rejects a project path containing a dot-prefixed directory, so inherited temp paths such as ~/.cache/... fail before analysis. Preserve safe inherited paths and create the private session beneath a dot-free fallback when required. Target paths and bytes are preserved.

Closes #1219.

Preserves @felipeatp's original fix as an authored commit; the follow-up makes pure path fixtures absolute on Windows and covers its default fallback policy. Also updates the real oversized-annotation fixture to exceed the pinned SDK receive budget using two annotation fields and both MCP representations after canonical Evidence removed redundant envelopes. The isolated CLI/MCP verifier environment explicitly receives caller-selected Ghidra heap and JVM limits.

Validation:

  • Real Ghidra 12.1.4 / JDK 21 on Linux x64: source-owned CET executable fails under a hidden temp parent before the fix, then successfully decompiles through the CLI under both hidden and interior-dot temp paths.
  • Actual stdio MCP under a hidden TMPDIR passes function analysis, private fallback permissions, close cleanup and connection reuse. Target bytes remain identical.
  • Actual ENDBR64 preserves zero operands; decoded RET retains p-code RETURN evidence, remains a non-call, and matches the CLI result. This independently audits the already-merged #1238/#1242 repairs.
  • Focused session-root/launcher checks: 15 pass, one Windows-only launcher case skipped on this Linux host. npm run check:fast passes.
  • The complete host-format real Ghidra verifier passes at exact head 1c3766a8bcc8a2b6af679cdaa92a73fec42b3372: 290 successful calls, 52 rejected boundary cases, actual CLI/MCP parity, annotation rollback, snapshot lifecycle, retained oversized results and complete exports, long private socket paths, startup cancellation and complete cleanup. The fixture is independently confirmed CET-enabled. Exact-head CI is green. Optional cross-target lanes and real Windows/macOS Ghidra were not run.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1297 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/ghidra-session-root-stability` --- ### 📝 Commits (10+) - [`da606ff`](https://github.com/morluto/rea/commit/da606ff77718d9a3b10426fcf68c098138e6dcfa) fix(mcp): deliver tool errors within advertised schema contracts - [`7bf63ed`](https://github.com/morluto/rea/commit/7bf63ed7f8312e56acaf8ddb95c69705b616b79c) chore: integrate canonical Evidence changes for MCP error delivery - [`fd46cff`](https://github.com/morluto/rea/commit/fd46cff017f0110aaab1216764cf01a71b341766) test(mcp): read typed errors in canonical Evidence regressions - [`5486860`](https://github.com/morluto/rea/commit/548686067319279128246ab849265173c182c03d) Merge remote-tracking branch 'origin/main' into fix/mcp-error-schema-delivery - [`a8b8288`](https://github.com/morluto/rea/commit/a8b8288396cf2e053db768ef03f4db756aa8f71e) fix: keep the Ghidra session root free of dot-prefixed path elements - [`1e83d27`](https://github.com/morluto/rea/commit/1e83d270c2098b1bcb59591698a257a05d2296fc) test(ghidra): use host-native absolute session root fixtures - [`09058eb`](https://github.com/morluto/rea/commit/09058ebc4a68c76d865a92dbddb65811ba8344f7) test(mcp): validate public error diagnostics in acceptance workflows - [`2060a6d`](https://github.com/morluto/rea/commit/2060a6d7f331c10dec3158355a92e952f1a07789) Merge branch 'fix/mcp-error-schema-delivery' into fix/ghidra-session-root-stability - [`f61673f`](https://github.com/morluto/rea/commit/f61673fa992ad2baae89b7ca051c7a19dda9d113) Merge remote-tracking branch 'origin/main' into fix/ghidra-session-root-stability - [`1e34197`](https://github.com/morluto/rea/commit/1e341973cfad1dbf06755f3a086ffc23d42a723c) test(ghidra): size oversized annotations for canonical delivery ### 📊 Changes **5 files changed** (+140 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `scripts/lib/native-value-e2e.mjs` (+9 -0) 📝 `scripts/lib/real-ghidra-large-results.mjs` (+4 -1) 📝 `src/ghidra/GhidraClient.ts` (+2 -2) ➕ `src/ghidra/GhidraSessionRoot.test.ts` (+70 -0) ➕ `src/ghidra/GhidraSessionRoot.ts` (+55 -0) </details> ### 📄 Description Ghidra rejects a project path containing a dot-prefixed directory, so inherited temp paths such as `~/.cache/...` fail before analysis. Preserve safe inherited paths and create the private session beneath a dot-free fallback when required. Target paths and bytes are preserved. Closes #1219. Preserves @felipeatp's original fix as an authored commit; the follow-up makes pure path fixtures absolute on Windows and covers its default fallback policy. Also updates the real oversized-annotation fixture to exceed the pinned SDK receive budget using two annotation fields and both MCP representations after canonical Evidence removed redundant envelopes. The isolated CLI/MCP verifier environment explicitly receives caller-selected Ghidra heap and JVM limits. Validation: - Real Ghidra 12.1.4 / JDK 21 on Linux x64: source-owned CET executable fails under a hidden temp parent before the fix, then successfully decompiles through the CLI under both hidden and interior-dot temp paths. - Actual stdio MCP under a hidden TMPDIR passes function analysis, private fallback permissions, close cleanup and connection reuse. Target bytes remain identical. - Actual ENDBR64 preserves zero operands; decoded RET retains p-code RETURN evidence, remains a non-call, and matches the CLI result. This independently audits the already-merged #1238/#1242 repairs. - Focused session-root/launcher checks: 15 pass, one Windows-only launcher case skipped on this Linux host. `npm run check:fast` passes. - The complete host-format real Ghidra verifier passes at exact head `1c3766a8bcc8a2b6af679cdaa92a73fec42b3372`: 290 successful calls, 52 rejected boundary cases, actual CLI/MCP parity, annotation rollback, snapshot lifecycle, retained oversized results and complete exports, long private socket paths, startup cancellation and complete cleanup. The fixture is independently confirmed CET-enabled. Exact-head CI is green. Optional cross-target lanes and real Windows/macOS Ghidra were not run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:10:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2777
No description provided.