fix(modules): platform-check existing executor in post-install πποΈ - #323
fix(modules): platform-check existing executor in post-install πποΈ#323dohernandez wants to merge 2 commits into
Conversation
A linux-amd64 node tarball shipped a Mach-O arm64 executor; post-install only downloaded when the binary was absent, so it patched the wrong-platform binary in place and it failed at runtime with an opaque exec format error. Now an existing executor is magic-byte-checked against --os/--arch: on mismatch it is deleted and re-downloaded, or fails loud when downloads are disabled. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
1 similar comment
|
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the βοΈ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
GenVM PR actionsTick a box to run it (the box unticks itself when handled). Actions only run while the PR has the
Full GenVM CI runs only when |
Summary
Field incident (2026-07-09): a genlayer-node linux-amd64 release tarball shipped a Mach-O arm64 genvm executor. Post-install's
process_executor_version()only downloads the executor when the binary is absent, so it accepted the wrong-platform binary, LIEF-patched it in place, and the failure only surfaced at runtime as an opaqueExec format error. Forcing--executor-download truecould not fix it.This hardens the consumer side so a wrong executor is caught at install time regardless of who put it there (the producer bug β host-defaulted
--os/--archin genlayer-node'sdownload_genvm.shβ is already fixed in genlayer-node#1540):detect_executable_platform(): sniffs the first 20 bytes β ELFe_machine(0x3E β amd64, 0xB7 β arm64) and 64-bit Mach-O magic +cputype(x86_64/arm64), both endiannesses. Unrecognized format/arch counts as a mismatch (a real executor is always a thin ELF/Mach-O).executor/<version>/bin/genvmis now checked against--os/--archbefore being trusted:found macos/arm64, expected linux/amd64), delete the poisoned version tree, fall through to the normal re-download (self-healing);RuntimeErrorat install time with found-vs-expected platforms and a remediation hint;next_versionβ a latentNameErrorwhenever a manifest lists two adjacent patch versions.Verification
executor/v0.0.1/bin/genvm, targeting linux/amd64, release tarball served viafile://:π€ Generated with Claude Code