Skip to content

[v8] Add Maglev type-confusion/differential fuzzing and VRP workflow - #563

Closed
srinivasreddy wants to merge 3 commits into
googleprojectzero:mainfrom
srinivasreddy:maglev-type-confusion-differential-fuzzing
Closed

srinivasreddy wants to merge 3 commits into
googleprojectzero:mainfrom
srinivasreddy:maglev-type-confusion-differential-fuzzing

Conversation

@srinivasreddy

Copy link
Copy Markdown

Supersedes #562 (closed while the head fork was recreated; that PR is pinned to an older commit).

Summary

  • MaglevTypeConfusionFuzzer: elements-kind, map/field-representation, typed-array, binary feedback, call/inlining and loop/Phi assumption invalidation.
  • C1.1-shaped variants for 486657483 (mixed-representation Phi with HeapObject consumer), 489280531 (backedge-only change), 493534950 (inlined Smi proof), and 500880819 (value-equal HeapNumber/Smi, old-space aging), with explicit gc() observation and printed digests.
  • Output-based differential fuzzing (Maglev vs. --no-maglev --no-turbofan) with reference-timeout handling and the v8Maglev profile.
  • IteratorHelpersFuzzer for iterator helper chains including chunks()/windows().

VRP workflow

  • Tools/v8-vrp-campaign.sh: long v8 crash and v8Maglev differential campaigns, revision/hash metadata, logs, ASan campaign, resume, and an explicitly separated fault-injection canary.
  • Tools/v8-vrp-triage.py: reproduces stored artifacts from their recorded TARGET ARGS/ARGS/REFERENCE ARGS, checks determinism, optionally runs ASan, marks injected-fault candidates, and emits Markdown/JSON reports.
  • Docs/V8VRPWorkflow.md: builds, campaigns, triage, false-positive handling, security assessment, and VRP reporting.

Fault injection (canary only, not a VRP finding)

  • Targets/V8/Patches/maglev-fault-injection.patch adds --maglev-fuzz-drop-heapobject-check, which drops HeapObjectness in ConvertTaggedPhiTo, corrupts a converted Phi input, and removes the following CheckHeapObject.
  • Dedicated MaglevPhiHeapObjectnessFaultFuzzer and v8MaglevFaultInjection profile. Against a patched d8 it produced 4 deterministic crashes; triage labeled all 4 as injected, with 0 non-injected findings.

Testing

  • swift build and swift build -c release --product FuzzilliCli: pass
  • DiffExecutionTests: 7/7
  • ProfileTests: pass
  • MaglevTypeConfusion construction + live tests: pass
  • MaglevPhiHeapObjectnessFaultTemplate: pass
  • Live differential campaign: 25 pairs, 0 false differentials
  • 80 s v8Maglev CLI run: 0 confirmed differentials
  • Campaign/triage scripts: syntax checks, --help, short campaign, fault and synthetic differential triage

Add MaglevTypeConfusionFuzzer, targeting elements-kind, map and field-representation, typed-array, binary feedback, call/inlining and loop/Phi assumptions. Includes C1.1-shaped variants for value-equal HeapNumber/Smi checks, mixed-representation Phis, backedge-only representation changes and inlined Smi proofs, with explicit gc() observation and output digests.

Add output-based differential fuzzing (Maglev vs. --no-maglev --no-turbofan) with reference-timeout handling, plus the v8Maglev differential profile, determinism shim, periodic GC and focused code generators.

Also add IteratorHelpersFuzzer and unit/live tests for the oracle, profile, templates and differential execution.
Address review feedback: add staging flags to the Maglev template live test; age the value-equal HeapNumber target into old space before the store; feed the Phi result into a HeapObject consumer for the 486657483 shape; lengthen the backedge trigger loop and warm the callee for inlining; guard the reference runner, preserve crash outcomes, treat both-failed runs as non-differential and mark reference timeouts; extend the determinism shim with performance.now.
Add Tools/v8-vrp-campaign.sh for long crash and Maglev differential campaigns with metadata, logs, ASan support, resume, and clearly separated fault-injection canaries. Add Tools/v8-vrp-triage.py to reproduce stored crashes/differentials from their recorded target arguments, check determinism, run ASan, flag injected-fault artifacts, and emit Markdown/JSON reports.

Add the Maglev Phi fault-injection V8 patch, flag, profile and dedicated deterministic template, plus Docs/V8VRPWorkflow.md and target documentation. Fault-injection crashes are explicitly excluded from VRP findings.
@srinivasreddy

Copy link
Copy Markdown
Author

Added the heap-sandbox/SbxBrk-style workflow in c53194b3.

  • v8SandboxTrap profile: V8's trap-based sandbox fuzzer (--sandbox-trap-fuzzing, --single-threaded), which uses pkeys to trap sandbox accesses and mutate data at the faulting access.
  • v8Sandbox remains the Memory-Corruption-API baseline (FuzzilliSbx in the SbxBrk paper), with graph traversal, bitflips, and worker-driven double-fetch/TOCTOU corruption.
  • Docs/V8SandboxWorkflow.md: builds, campaigns, triage, pkey/hardware requirements, trap non-reproducibility, and SbxBrk mapping.
  • Verified on a non-trap sandbox d8 (v8_enable_sandbox=true, v8_enable_memory_corruption_api=true, v8_fuzzilli=true): Sandbox.getAddressOf works and a 20 s v8Sandbox run completed 3,147 execs with no false crashes.

Hardware note: this host exposes no pku/ospke, so v8_enable_sandbox_hardware_support=true fails in mksnapshot with SIGILL; the trap profile is ready for a pkey-capable Linux/x64 host, and this limitation is documented. The profile/args test passes.

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