mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #8333] [Design] Preserve IFUNC resolver semantics when investigating exported APIs #6549
Open
opened 2026-11-01 21:12:08 +00:00 by bsakaguchi
·
4 comments
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#6549
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @morluto on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/8333
Before submitting
Decision needed
How should an agent investigating an ELF-exported API distinguish an IFUNC resolver's analyzed signature and references from the eventual implementation, while preserving independent format Evidence and leaving runtime selection unknown?
Context and evidence
A source-built x86-64 shared object defines
audit_transformusing a compiler IFUNC attribute, a no-argument resolver returningaudit_implementation, and an implementation taking one integer and adding seven. Independentllvm-readelfreported the export asIFUNCat0x12a0;llvm-objdumpshowed that address returning the implementation's address0x1290. The GNU C Library manual describes IFUNC symbols as naming resolvers whose returned addresses become relocation targets.On REA
a989c0ewith real Ghidra 12.1.4 and Kuna 1.986 MCP:inspect_native_exportscorrectly returnedaudit_transformwithtype:"ifunc"and the ELF value. This is independent format Evidence.audit_transformto the resolver, whose pseudocode returnedaudit_implementation. Ghidra's rebased entry was0x1012a0; Kuna used0x12a0.inspect_native_api({procedure:"audit_transform"})returned a low-confidence pointer return, an empty parameter list and ordinary decompiler-inference caveats for that selected resolver. It did not identify the export as an IFUNC or explain that the result describes the resolver rather than the selected implementation. The analysis of the selected function is valid; the concern is the cross-tool handoff when the analyst's question is the exported API.procedure_referencesexposed the resolver's data reference to0x101290andtrace_native_valuesexposed the address-forming value flowing toRETURN. Explicitly selectingaudit_implementationyielded one inferred integer parameter and an integer return. This is a manual, single-fixture static candidate, not proof of general IFUNC resolution or runtime binding.trace_call_pathcorrectly found no direct call edge from resolver to implementation; a returned pointer is not a call.A second source-built library contained both an ordinary one-argument export and an IFUNC. Format inspection distinguished
functionandifunc; Ghidra's API view recovered a one-parameter signature for the ordinary function and a zero-parameter pointer-return signature for the resolver. Neither file was executed or modified. This does not test a real loader, alternate resolver choices, other architectures, or agent behavior.Expected interaction with targets
Read caller-selected artifacts and use static provider observations. No target execution, library loading, mutation, injection or automatic provider switch is proposed.
Boundary details (optional)
Keep artifact digest/slice, ELF symbol type and version, provider address space, resolver identity, candidate implementation Evidence and the caller's selected provider distinct. An IFUNC value is not automatically an implementation address; data references alone do not prove a resolver returns an address, and static candidates do not establish runtime selection. Resolver conditions, multiple returns, interposition, external code, relocations, incomplete sources and rebased projects may leave correspondence unknown.
Options and tradeoffs
Consider focused documentation/contract guidance using the existing export, reference and value-flow workflows; or an explicit evidence-backed handoff that accepts retained export facts, preserves a verified mapping to the selected provider, labels resolver versus candidates, and returns unknowns where not established. Avoid automatic filesystem search, runtime execution or interpreting every export as a normal function. The existing Android JNI inspection already excludes IFUNC exports from direct implementation candidates; any shared solution should respect that distinction.
Verification available so far
I have a prototype or observed results.
Success criteria and open questions
Exercise ordinary functions alongside IFUNCs, multiple or conditional resolver returns, unknown targets, weak/versioned symbols, provider-specific rebasing, stripped files and retained/offline Evidence. Test that API output never silently presents the resolver signature as the runtime implementation's signature. This is a proposed verification matrix, not work already performed.
References
Related: #8221 (cross-image candidate handoff), #8328 (independent export evidence for name recovery), #8330 (secondary-name search). REA
a989c0e458c91af177e097abd7be0fd021b0401d, Node 24.22.1, macOS arm64, static x86-64 ELF fixtures; original SHA-256655057b5165a376bf959f0146351c56c5c49c3f9e97b8d88ba522fed1bb7562c, normal-export control8f7de557288c8d4bd153e1d7805f9807b1dd26d863c0e084a55854777d7e230d, unchanged through analysis.@gensokyo-dev @kaoru0822-kitauji @N0zoM1z0
@morluto commented on GitHub (Oct 31, 2026):
Existing checks and an E2E opportunity
Source inspection at
a989c0efound an existing producer test inNativeExportParser.test.ts: its synthetic ELF includes type 10 and asserts that the export row is classified asifunc. That checks the format classification, but the selected assertion does not join it to a provider dossier or recovered API signature. A literal search forifunc/gnu_indirect_functionintests,scriptsandsrcfound that test and the Android JNI exclusion, but no IFUNC-specific real-provider verifier by those spellings. This is a bounded source review, not proof that no equivalent case exists under another name; no test suite was run here.If the design changes, a useful public MCP/CLI regression can build a source-owned ELF with an IFUNC and ordinary export, inspect format evidence, then compare the resolver and implementation observations with real Ghidra. Assert that candidate and runtime-selection uncertainty remain distinct; use a conditional resolver and unavailable/ambiguous cases as follow-up coverage. Retain the producer parser test for its separate format semantics.
@morluto commented on GitHub (Oct 31, 2026):
Conditional resolver and offline source control
A second source-built x86-64 ELF makes the resolver read a volatile choice and return either
audit_fastoraudit_safe. Independentllvm-readelfidentifiedaudit_transformas IFUNC at ELF value0x1350;llvm-objdumpshowed a choice read, both implementation-address calculations and a conditional selection before return. An exported setter writes the choice, but this static experiment does not establish whether, when, or with what value a real loader would invoke the resolver.On REA
a989c0ewith real Ghidra 12.1.4 and Kuna 1.986 MCP, both decompiled the resolver with both alternatives. Ghidraprocedure_referencesreported separate data references to rebasedaudit_fast(0x101320) andaudit_safe(0x101330) and a read of the choice. Itstrace_native_valuesreturned both address-forming operations flowing throughMULTIEQUALintoRETURN. This supports two static candidates on this fixture; no REA tool here asserted a runtime-selected implementation. Kuna returned explicitProvider has no native def-use modeland did not supportprocedure_references. Both providers' call-only traces returnednot_reachedfor each candidate, which is consistent with returning addresses rather than making direct calls.For this run, a TypeScript MCP SDK client supplied each advertised compact-profile tool definition when calling the tools. Successful calls passed SDK output-schema validation; the SDK does not apply the success schema to Kuna's expected
isErrorreference result. This is a contract-shape check for these calls, not a semantic-correctness or other-client claim.An offline Evidence control also reproduces the separate #8282 defect on this fixture: after cold and identical warm Ghidra value traces, export/import in a fresh target-free server resolved the cold procedure source ID but rejected the warm trace's per-procedure ID as missing, while the warm trace's top-level link still cited the cold source. Candidate handoff should not assume nested source IDs are exportable until that issue is fixed. Target SHA-256
a7dc38d17e48395f93f6acb137864d63655fb74272b21184a89a49656dca3c73and the exported bundle hash were unchanged; target code was not executed.@morluto commented on GitHub (Oct 31, 2026):
A function reference that is not a returned implementation
A third source-owned ELF control adds
audit_decoyand stores its address in a volatile global before the conditional return ofaudit_fastoraudit_safe. Independent disassembly showed that store and the two selected return addresses. Ghidraprocedure_referencesreported DATA references to all three functions;trace_native_valuesexposed the decoy address flowing to the global write, while the fast/safe address operations flowed throughMULTIEQUALtoRETURN. Both decompilers showed the two returned names. The inference that the decoy is not one of the returned alternatives is based on the fixture source, instructions and this observed graph; this is not a general guarantee of complete def-use or runtime selection.This is a concrete negative control for any candidate handoff: a function referenced by a resolver is not necessarily a function the resolver returns. Keep references, def-use and unknowns distinguishable; do not turn every outgoing DATA edge into an implementation candidate. The target was not executed, and SHA-256
465f35baa337829103a1941e3fa6f3093b9e0689c94e6f0080b344392bceb882stayed unchanged.The same control also exposed an independent Kuna pseudocode problem: an unconditional global store was rendered again on one return path. A reduced ordinary-function fixture, without IFUNC, reproduced it in direct Kuna 1.986, upstream current main and REA's cold and warm Kuna outputs; Ghidra and independent disassembly show one store. Filed Kuna #1355. REA already labels pseudocode as reconstructed and exposes assembly; the finding does not imply that it can silently correct provider text.
@morluto commented on GitHub (Oct 31, 2026):
Installed guidance and catalog discovery
On built REA
a989c0e(rea-agents@6.8.0, compact MCP schema),search_guidance({query:"ifunc"})andsearch_guidance({query:"ELF export resolver"})returned zero matches.search_guidance({query:"native exports"})returned the installed “Offline PE and ELF export tables” section; reading that exact section explained export types/coverage at a general level but did not explain IFUNC resolver semantics or an export-to-provider handoff. The advertisedinspect_native_exportsdescription mentions ELF symbol type, and theinspect_native_apidescription says it analyzes one function, but neither tested description explains that an IFUNC entry is its resolver. Other queries or external knowledge may find additional guidance; this is not an autonomous-agent selection test or a claim about all documentation.This gives the documentation/contract-guidance option in the issue a concrete first-use case: describe the observed resolver boundary and link the existing explicit references/value-flow route, while keeping candidate selection and runtime binding unknown. The format row already carries
type:"ifunc"; do not infer implementation identity from that field alone.