99a21a91a0
The "tampered arm64 binary is SIGKILLed (137)" premise is empirically false on current macOS CI runners for an ad-hoc-signed CLI binary -- the binary has no CS_KILL/hardened-runtime flag, so a tampered code page is not killed: it executes the garbage and crashes with SIGILL (exit 132, run 28365724001), not 137. (remove-signature and corrupt-blob both ad-hoc re-sign on exec and run to exit 0.) So no runtime exit code is a deterministic guard here, and "tamper -> crash" is near-tautological (zeroed code crashes regardless of signing). Assert the real, deterministic integrity invariant instead: `codesign --verify` REJECTS a tampered copy (the CodeDirectory page hashes no longer match the modified code), while the untampered binary verifies cleanly (10a). It is a pure userspace hash check -- no tampered code is executed. The copy is separate, so the original binary stays intact for the 10e re-sign test. Refs: github.com/garrytan/gstack#997, github.com/nodejs/node#40827 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>