Repository navigation
fix(ghidra): respect Java Unix socket path limits - #8382
Merged
Merged
Conversation
Contributor
[Medium impact] The reviewed changes appear safe to merge. SummaryLowers the Ghidra Unix-socket path limit to 102 UTF-8 bytes on macOS and 106 on Linux, matching the stated OpenJDK boundary.
Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
4 of 19 tasks
morluto
marked this pull request as ready for review
November 1, 2026 03:55
Codex Review Summary: ✅ CompletedThis 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. |
OpenJDK still reserves two sockaddr_un bytes, so the path cap stays 102 on macOS and 106 on Linux. The real Ghidra run also keeps the project-identity check from main.
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
Ghidra startup fails on macOS when REA's proposed Unix-socket path is exactly 103 UTF-8 bytes. Select the existing short private socket root at the OpenJDK boundary, so the same analysis works at that length. Fixes #8378.
Problem and expected behavior
On a real Ghidra 12.1.4 / JDK 21 run, 102-byte socket paths succeeded, 103-byte paths failed with
Unix domain path too long, and 104-byte paths succeeded because REA selected its short-root fallback. The CLI and MCP both hit the failure before analysis.Change and scope
OpenJDK's Unix NIO implementation allows
sizeof(sun_path) - 2bytes. Use 102 on macOS and 106 on Linux before selecting the already-owned short socket root. Keep byte-based measurement and existing private-root lifecycle. The runtime observation is macOS-only; the Linux limit is source-derived and still needs a real Linux Ghidra run.Contract and boundary impact
Expected effects:
Evidence and regression coverage
Validation performed
An earlier hosted static check failed on
tests/boundary/cli/cliHelpDefaultAnnotations.test.ts, an unrelated formatting defect fixed by style(test): format CLI help default annotations #9280. The branch now includes that fix; new hosted CI is pending.After merging main
0ecf3a4cbf, Node 24.22.1 focused Vitest runs:ghidraTransport.test.ts5 passed;ghidraEvidenceMcp.test.ts11 passed. The prior CI shard failed because its Evidence wording assertion predated checkpoint support; current main already updates the assertion. The real-provider lane was not rerun after this merge.npm run check:ci:fast— passed.Real Ghidra 12.1.4 stdio MCP / CLI boundary regression — passed on macOS arm64; pre-change baseline failed as expected.
Existing
ghidraClient.test.tssocket-root cleanup failure and retry case — passed.Full host-native
npm run verify:ghidra— passed on the prior head4d2dcfcaf3in an isolated checkout with separate verifier corrections for [Bug] Ghidra verification sends function Evidence beyond the default MCP input allowance #8172 and [Bug] Ghidra snapshot verifier expects retained Evidence to disappear #8380 / PR test(ghidra): check retained historical snapshot evidence #8381; this was not a clean-tree lane. It recorded 433 successful and 52 rejected boundary calls, verified the socket samples above, and reported complete cleanup with no remaining descendants.Compatibility, safety, and release
sun_pathsize but remain runtime-unverified; other JDKs and Ghidra versions were not tested.Author readiness
Human owner:
Before merge
type(scope): outcome.