Skip to content

docs+test: spectre/csdb policy + aarch64 CVE audit + arXiv 2604.17391 citation#105

Merged
avrabe merged 1 commit into
mainfrom
feat/spectre-policy-and-cve-audit
May 12, 2026
Merged

docs+test: spectre/csdb policy + aarch64 CVE audit + arXiv 2604.17391 citation#105
avrabe merged 1 commit into
mainfrom
feat/spectre-policy-and-cve-audit

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 11, 2026

Summary

  • Adds 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.
  • Audits the April 2026 Wasmtime aarch64/x86-64 security advisories for synth analogs:
    • GHSA-jhxm-h53p-jm7w / CVE-2026-34971 (aarch64 Cranelift sandbox escape): a latent analog exists in rules.rs:1887 (the add_with_shift standard rule hard-codes the LSL amount to 2 while pattern-matching any I32Shl;I32Add). Gated today only by the fact that RuleApplicator::apply_rules does not actually rewrite ops to the replacement. A new regression test crates/synth-synthesis/tests/regression_spectre_cve_2026_34971.rs asserts the safety disjunction so the CVE shape can't land silently.
    • GHSA-qqfj-4vcm-26hv / CVE-2026-34944 (x86-64 f64x2.splat over-read): no analog. Documented in §3 of the policy.
  • Adds a "Customer narrative" section to the README citing Andreasyan et al., arXiv 2604.17391"RISC-V Functional Safety for Autonomous Automotive Systems" — as external academic validation of synth's framing that functional safety is a certification problem, not a processor problem.

Key decisions in spectre-policy.md

  • Default to "csdb off" (matches Wasmtime 44.0.0) because synth targets in-order Cortex-M0/M3/M4/M33 and bare-metal RV32IM in a single-tenant threat model — no cross-domain secret to leak. Two rules (Analyze codebase and plan next steps #2 Cortex-M7/M55 software bounds check, Archive or delete obsolete documentation #8 add_with_shift standard rule) are flagged for explicit attention.
  • F (fence required): 0 rules today. F (opt-in via future --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).
  • The MPU (Cortex-M) and PMP (RV32) hardware boundaries are treated as the architectural Spectre-v1 mitigation for the "BoundsCheckConfig::None" path; AND-masking (BoundsCheckConfig::Masking) is recommended for Cortex-M55 per the Blade (POPL 2021) index-masking result.
  • The synth analog of the aarch64 ISLE bug (rule condition broader than replacement) is the unused add_with_shift rule; 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 passed
  • cargo 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 — clean
  • cargo fmt --check — clean
  • CI to confirm synth-verify builds via system z3
  • (manual) reviewer to sanity-check the 21 rule decisions in §2 against the listed source locations

Scope notes

This PR does not touch:

The regression test only reads the public RuleDatabase / RuleApplicator API; it has no overlap with in-flight work.

References:

Generated with Claude Code

… 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>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit ed316cd into main May 12, 2026
9 checks passed
@avrabe avrabe deleted the feat/spectre-policy-and-cve-audit branch May 12, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant