docs+test: spectre/csdb policy + aarch64 CVE audit + arXiv 2604.17391 citation#105
Merged
Merged
Conversation
… citation Aligns synth with the Wasmtime 44.0.0 default (csdb off on aarch64) by making the per-lowering decision explicit, using the Crocus (ASPLOS 2024) F/D/A policy taxonomy. The threat model for synth is single-tenant ARMv7-M / RV32 with optional MPU/PMP isolation — not a multi-tenant sandbox — so Spectre-v1 BCB does not directly translate, but the decisions are documented per rule so a reviewer can re-check them after refactors. Per the audit of the April 2026 Wasmtime security advisories: - GHSA-jhxm-h53p-jm7w / CVE-2026-34971 (aarch64 Cranelift sandbox escape) has a *latent* analog in synth: the `add_with_shift` standard rule (`rules.rs:1887`) matches any `I32Shl;I32Add` but hard-codes the replacement's LSL `amount` to 2. The unsoundness is gated only by the fact that `RuleApplicator::apply_rules` currently does not actually rewrite ops to the rule's replacement. A regression test asserts the disjunction "rule removed OR amount not hard-coded OR applicator still inert" so the CVE shape cannot land silently. - GHSA-qqfj-4vcm-26hv / CVE-2026-34944 (x86-64 f64x2.splat over-read) has no analog: synth doesn't target x86-64, and the Helium MVE path uses correctly-sized VLDRW.32 / VDUP rather than a short-load + broadcast that could over-read. Adds a "Customer narrative" section to the README citing Andreasyan et al., arXiv 2604.17391 ("RISC-V Functional Safety for Autonomous Automotive Systems"), which argues that functional safety is a certification problem rather than a processor problem — exactly the framing synth's verifiable codegen targets. Files: - docs/spectre-policy.md (new) — policy intent, 21 per-rule decisions, CVE analog audit, references, review cadence. - crates/synth-synthesis/tests/regression_spectre_cve_2026_34971.rs (new) — two tests gating the latent CVE-2026-34971 shape. - README.md — new Customer narrative section. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d6babd2 to
654f768
Compare
5 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/spectre-policy.md— a per-lowering Spectre / speculative-execution policy for synth's WASM-to-ARM-Cortex-M / RV32 codegen, aligned with the Wasmtime 44.0.0 default (csdb off on aarch64) and using the Crocus (ASPLOS 2024) F/D/A policy taxonomy. 21 rule decisions documented.rules.rs:1887(theadd_with_shiftstandard rule hard-codes the LSLamountto 2 while pattern-matching anyI32Shl;I32Add). Gated today only by the fact thatRuleApplicator::apply_rulesdoes not actually rewrite ops to the replacement. A new regression testcrates/synth-synthesis/tests/regression_spectre_cve_2026_34971.rsasserts the safety disjunction so the CVE shape can't land silently.Key decisions in spectre-policy.md
add_with_shiftstandard rule) are flagged for explicit attention.--mitigate-spectre-v1): 1 rule for M7/M55. D (other mitigation suffices): 19 rules. A (accepted residual): 2 rules, both gated (one by a regression test, one by docs).AND-masking (BoundsCheckConfig::Masking) is recommended for Cortex-M55 per the Blade (POPL 2021) index-masking result.add_with_shiftrule; the regression test makes the latency of the bug explicit and self-checking.Files changed
docs/spectre-policy.md(new, ~210 lines)crates/synth-synthesis/tests/regression_spectre_cve_2026_34971.rs(new, 2 tests, both passing)README.md(new "Customer narrative" section between PulseEngine table and Installation)Test plan
cargo test -p synth-synthesis --test regression_spectre_cve_2026_34971— 2 passedcargo test --workspace --exclude synth-verify— all pass (synth-verify excluded due to unrelated bundled-z3 build issue on the dev machine; CI uses the system z3)cargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --check— cleansynth-verifybuilds via system z3Scope notes
This PR does not touch:
optimizer_bridge.rs(PR fix(opt): defensive panic on unmapped vreg instead of silent R0 fallback #101 territory)feat/riscv-cross-function-callsWIPThe regression test only reads the public
RuleDatabase/RuleApplicatorAPI; it has no overlap with in-flight work.References:
Generated with Claude Code