[PR #1280] [MERGED] fix(ghidra): reject a native decompiler built for another host #2764

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1280
Author: @DeryFerd
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/ghidra-native-decompiler-platform-admission


📝 Commits (3)

  • 09642cb fix(ghidra): reject a native decompiler built for another host
  • 5b9d70c Merge remote-tracking branch 'origin/main' into review/ghidra-admission-1280
  • 95f77f4 fix(ghidra): inspect foreign FAT tools without blocking on pipes

📊 Changes

3 files changed (+356 additions, -13 deletions)

View changed files

📝 docs/installation.md (+5 -2)
📝 src/ghidra/GhidraInstallation.test.ts (+169 -0)
📝 src/ghidra/GhidraInstallation.ts (+182 -11)

📄 Description

Fixes #1192.

Ghidra admission now checks a bounded executable-header prefix before reporting a native decompiler available. Positive format/architecture mismatches identify both the observed binary and the host requirement. Unknown or truncated headers remain explicitly unverified.

The contributor's implementation is retained, with follow-ups for foreign-only FAT Mach-O tables, malformed host slices, and nonblocking regular-file admission. A readable foreign slice can establish a missing host architecture; a listed but truncated host slice remains unknown. Directories and FIFOs cannot satisfy the executable-file prerequisite.

Validation:

  • 54 focused installation, doctor and MCP failure-diagnostic tests passed, including matching/unreadable/foreign headers, universal FAT and truncated representations.
  • Actual CLI doctor, providers and capabilities reject a real Windows x64 PE decompiler copied into an owned Linux x64 installation path. The borrowed installation is untouched and copied bytes remain unchanged.
  • An executable FIFO without a writer is rejected without blocking.
  • Actual SDK 2.3.1 stdio MCP with installed Linux Ghidra 12.1.4 opens and batch-decompiles a source-built native function, then closes, pings and reports a closed session. Target bytes remain unchanged and the owned runtime directory is empty after close. Two CPUs, 768 MiB Node heap, configured 512 MiB JVM; sampled family peak 993 MiB.
  • Pre-push static checks run before publication; final-head CI is required before merge.

This establishes Linux real-provider behavior and the observed header boundaries. It does not establish real macOS Ghidra execution or a new Windows provider-support claim. REA does not build/install Ghidra, Java or native tools.


🔄 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/1280 **Author:** [@DeryFerd](https://github.com/DeryFerd) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/ghidra-native-decompiler-platform-admission` --- ### 📝 Commits (3) - [`09642cb`](https://github.com/morluto/rea/commit/09642cbf1805d45dc8e47f77bfc310db443031a0) fix(ghidra): reject a native decompiler built for another host - [`5b9d70c`](https://github.com/morluto/rea/commit/5b9d70c7c92299c3eaf54e4281f29cd0f23d5f2e) Merge remote-tracking branch 'origin/main' into review/ghidra-admission-1280 - [`95f77f4`](https://github.com/morluto/rea/commit/95f77f4d4bfd92423bd4ff1ee0b4dccb27d03e2d) fix(ghidra): inspect foreign FAT tools without blocking on pipes ### 📊 Changes **3 files changed** (+356 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `docs/installation.md` (+5 -2) 📝 `src/ghidra/GhidraInstallation.test.ts` (+169 -0) 📝 `src/ghidra/GhidraInstallation.ts` (+182 -11) </details> ### 📄 Description Fixes #1192. Ghidra admission now checks a bounded executable-header prefix before reporting a native decompiler available. Positive format/architecture mismatches identify both the observed binary and the host requirement. Unknown or truncated headers remain explicitly unverified. The contributor's implementation is retained, with follow-ups for foreign-only FAT Mach-O tables, malformed host slices, and nonblocking regular-file admission. A readable foreign slice can establish a missing host architecture; a listed but truncated host slice remains unknown. Directories and FIFOs cannot satisfy the executable-file prerequisite. Validation: - 54 focused installation, doctor and MCP failure-diagnostic tests passed, including matching/unreadable/foreign headers, universal FAT and truncated representations. - Actual CLI `doctor`, `providers` and `capabilities` reject a real Windows x64 PE decompiler copied into an owned Linux x64 installation path. The borrowed installation is untouched and copied bytes remain unchanged. - An executable FIFO without a writer is rejected without blocking. - Actual SDK 2.3.1 stdio MCP with installed Linux Ghidra 12.1.4 opens and batch-decompiles a source-built native function, then closes, pings and reports a closed session. Target bytes remain unchanged and the owned runtime directory is empty after close. Two CPUs, 768 MiB Node heap, configured 512 MiB JVM; sampled family peak 993 MiB. - Pre-push static checks run before publication; final-head CI is required before merge. This establishes Linux real-provider behavior and the observed header boundaries. It does not establish real macOS Ghidra execution or a new Windows provider-support claim. REA does not build/install Ghidra, Java or native tools. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:09:58 +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#2764
No description provided.