Repository navigation
Commit c53d76a
committed
fix(private-abi): harden heap snapshot identity (#863)
Replace fixed-seed raw-address maps in reachability traversal and arena snapshot ID assignment with a lazy exact identity index seeded from secure host entropy. Publish its context only after successful backing allocation, preserve retryability after entropy or allocation failure, and keep precise-GC cells on their existing relocation-stable odd-ID path.
Replace root-index hashing with per-node flags so root deduplication stays O(1) without an attacker-shaped hash boundary. Preserve first-root order and roll back queue, object, root, and edge state transactionally on allocation failure; stop traversal immediately after a failed mark so no partial graph can escape.
Add a deterministic 32-address legacy collision family, keyed-dispersion and exact removal coverage, entropy and fail-first retry probes, dense-root OOM invariants, and stable arena-even/precise-odd ID checks.
Validation: snapshot and reachability tests pass in Debug, ReleaseSafe, and TSan; full sharded units pass 2280 with 1 skip, 0 failures, and 0 leaks; the public C API audit/runtime passes 117/117; Home private audit/runtime passes 447/447 and 392/392; Bun private audit passes 437/437; both pinned heap-snapshot runtime fixtures pass. Test262 is N/A for this host-only ABI change.1 parent 010b4cd commit c53d76a
1 file changed
Lines changed: 298 additions & 21 deletions
0 commit comments