Repository navigation
fix(kuna): stop calling executable-segment data sections definite data - #10686
Conversation
An address in a Mach-O section whose attributes declare no instructions was refused as "data that Kuna lists, not a procedure", even when the section sits in an executable segment. In morluto#8352 a direct call targets `_placed_in_const` in `__TEXT,__const` (segment initprot r-x), Ghidra decodes and decompiles it, and REA's own procedure_callees reports the call, yet the Kuna refusal asserted it categorically as data. The Mach-O layout now records, for each data placement, whether its enclosing segment's initial protection includes VM_PROT_EXECUTE. For such placements the refusal keeps the section declaration and the classification, but says REA's Kuna lane does not treat the entry as a procedure and that the declaration alone does not prove the bytes are not code; its remediation adds the Ghidra provider as a decoding route. address_name's limitation is qualified the same way. Non-executable segments and the Mach-O header keep the existing wording. Procedure tools still refuse these entries; making them followable is left open. Validation: kunaMachoInventory and kunaInventoryPlacement boundary tests cover the executable `__TEXT,__const` entry, its remediation and address_name limitation, and an unchanged `__DATA` control. The full Kuna boundary directory shows the same 11 environment-related failures on unchanged main as on this branch; check:fast passes. Refs morluto#8352
Codex Review Summary: ❌ FailedThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable correctness or security issues were found. SummaryKuna now qualifies refusals for entries in executable Mach-O segments without changing which entries procedure tools accept.
The earlier shared-name finding is addressed. No new actionable issues were found. Validation here was source-based; no tests or real Kuna runs were performed. Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
…shared by data entries Review follow-up: a name that several data entries share took a grouped refusal that still said "they are data, not procedures" and offered no Ghidra route, even when one entry lies in an executable segment. The grouped message and remediation now come from KunaInventoryPlacement beside the single-entry ones: with an executable placement they keep the caveat and the Ghidra route, and otherwise the wording is unchanged. Tests: a shared-name case with and without an executable-segment entry fails before this change and passes after; the Mach-O inventory tests pass. Five process-lifecycle Kuna test files fail identically with and without this change in this environment.
|
Ready to merge: full CI is green on this head, Greptile's latest review is 5/5 with no open threads, and it merges into main 42cab26 without conflicts. |
Summary
Refs #8352. With Kuna, an address in a Mach-O section whose attributes declare no instructions was refused as "data that Kuna lists, not a procedure". This happened even when the section sits in an executable segment. In the issue's fixture:
_placed_in_constin__TEXT,__const(segment initprot r-x);procedure_calleesreports that call;Yet the Kuna refusal stated categorically that the entry is data.
Change and scope
KunaInventoryPlacement.ts: each data placement now records whether its enclosing segment's initial protection includesVM_PROT_EXECUTE(codePossible). The Mach-O header placement is alwaysfalse.address_name's limitation is qualified the same way.Evidence and regression coverage
tests/boundary/providers/kuna/kunaMachoInventory.test.tscovers the fixture'stableentry in executable__TEXT,__const: the exact refusal, the Ghidra route in the remediation, and theaddress_namelimitation. An unchanged__DATA,__datacontrol has no Ghidra route.kunaInventoryPlacement.test.ts: the placement map now carries{ region, codePossible }.mainas on this branch. The changed files' tests pass.Validation performed
npm run test:focused -- tests/boundary/providers/kuna/kunaMachoInventory.test.ts tests/boundary/providers/kuna/kunaMachoInventoryMcp.test.ts tests/boundary/providers/kuna/kunaInventoryPlacement.test.ts: passed.npm run check:fastpassed.Maintainer follow-up
Kuna list and search now keep the same executable-segment caveat as direct refusal and address lookup. Non-executable data and Mach-O headers keep their data classification. The original listing failed the new mixed-inventory assertion. Seventeen focused fixture tests and
check:ci:fastpassed on the repair. The eight CLI/MCP inventory tests passed again after bringing in current main, and the pre-push checks passed. This follow-up used provider fixtures.Author readiness
Human owner: @Davmunrey
Before merge
type(scope): outcome.