Repository navigation
fix(native)!: own Mach-O load commands in binary reader - #7952
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa19c869ce
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
[Medium impact] The reviewed changes appear safe to merge; no new actionable issue remains. Summary
This review used source and regression-test inspection; no tests were run. Whether another PR supersedes this one could not be checked because GitHub authentication was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Selected artifact] --> B[Verify file identity and digest]
B --> C[Resolve selected slice]
C --> D[Read bounded binary commands]
D --> E[Project facts and explicit unknowns]
E --> F[Verify source again]
F --> G[Close descriptor]
G --> H[Return observation]
G --> I[Close failure or late cancellation]
I --> J[Retain verified Evidence and cleanup owner]
Reviews (3) · Last reviewed commit: "fix: reserve Mach-O projection envelope ..." · Reviewed by Greptile |
Upstream main at 70a8325 fails oxfmt 0.72.0 on these files (from morluto#7952 and a docs table). Formatting only; the integration branch's format check needs it until main formats them.
Summary
Fixes #7391. A linker-generated section name containing a newline no longer makes
inspect_machomisinterpret name bytes as load-command framing.Problem and expected behavior
otoolemits names as unescaped text. Newlines or field-shaped names can therefore change the parser's interpretation of command and section boundaries. Inspection must preserve the selected binary's facts without treating name contents as control text.Change and scope
Read load-command framing and modeled fields from a bounded, identity-verified binary source; remove the superseded text command parser. Resolve and verify the selected FAT declaration and thin header, retain source and cleanup ownership, bound locations and image-base derivation to the selected slice, and preserve exact format failure reasons. The selected-slice identity fix from #7940 is now on main.
Contract and boundary impact
otool; undecoded payload bytes remain in the selected artifact, not in the response.Expected effects:
Evidence and regression coverage
Real macOS ARM64 CLI tests use an Apple linker-generated multiline section name and a patched invalid UTF-8 name, verify bytes are preserved, and check the target is unchanged. Binary-backed boundaries cover misleading names, legacy commands, selected FAT rows, missing and contradictory lipo ranges, malformed counts, out-of-slice locations, and SDK-converted MCP schemas. Lifecycle tests cover mutation, cancellation during successful and failed close, retained completed Evidence, mixed primary/cleanup failures, and retry. Retained command bytes own their backing storage; projected sections, nested records, strings and fixed envelope are charged before retention. Other Apple architectures and toolchains were not independently exercised.
Validation performed
npm run check:fast— passed on the follow-up diff.npm run docs:check— passed.git diff --check— passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.