Skip to content

fix(ghidra): refuse undefined recordless MIPS ELF flags - #10420

Draft
Bobtoshi wants to merge 2 commits into
morluto:mainfrom
Bobtoshi:codex/ghidra-recordless-mips-flags
Draft

Bobtoshi wants to merge 2 commits into
morluto:mainfrom
Bobtoshi:codex/ghidra-recordless-mips-flags

Conversation

@Bobtoshi

Copy link
Copy Markdown

Summary

Refuse undefined ELF header flags before Ghidra admits a recordless MIPS executable.

Problem and change

Upstream admitted recordless MIPS I, MIPS32, and MIPS32r2 fixtures with bit 0x800 set. The Ghidra adapter now checks an allowlist for its existing recordless ELF32 ET_EXEC lane. It preserves the six previously accepted compatibility bits defined by GNU Binutils and the existing specific ISA, ABI, and encoding refusals. CLI and MCP keep the same public error schema. A refused fixture gets capability_unavailable with the exact unsupported bits.

This addresses the production finding raised in #2919. It is scoped to header admission. MIPS I load-delay behavior requires separate verification.

Validation

  • The three undefined-bit regressions failed on upstream cc7d73d23 and passed with the fix.
  • 156 focused tests passed, including positive cases with the previously accepted named flags. Typecheck, lint, formatting, and docs checks passed.
  • The built CLI and MCP each rejected MIPS I 0x801 and MIPS32 0x50000801 in both byte orders with capability_unavailable and a diagnostic identifying bit 0x800. The fixtures were unchanged. Admission refused them before engine launch.

Author readiness

Human owner: @Bobtoshi

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

This PR rejects undefined e_flags bits in Ghidra’s recordless MIPS ELF32 executable path.

  • Recordless MIPS headers now reject undefined flag bits.

Review was source-based; no tests or real-provider checks were run. The check for a superseding PR was blocked because GitHub access required authentication.

Reviews (1) · Last reviewed commit: "docs(ghidra): describe recordless MIPS f..." · Reviewed by Greptile

@morluto morluto added area: cli CLI adapter and one-shot commands bug Something isn't working provider: ghidra Analysis provider / engine: ghidra labels Nov 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands bug Something isn't working provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants