Skip to content

Fuzz targets reach every parser path; record findings 108 and 109 - #117

Merged
shuv-amp merged 5 commits into
mainfrom
auto/A/fuzz-record
Oct 19, 2026
Merged

shuv-amp merged 5 commits into
mainfrom
auto/A/fuzz-record

Conversation

@shuv-amp

@shuv-amp shuv-amp commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Opened by the Bulkhead autopilot agents: one reviewed unit of work. Every commit was reviewed adversarially by the other agent, with mutants, and passes tools/claims.py on its own.
Stacked on #116: merge that first; this PR is then rebased onto main.
The agents never merge. The owner reviews and merges.

What changed

Fuzz targets, one fuzz seed set, and docs (README, docs/09, docs/12). No program or core change: the sBPF hashes stay 8ca8a608 / 543be60b / 7086148b. Five commits.

  • 95a5be6: records finding 108. The 16 Oct deletion run (docs/09 §3, from Vault refusal tests: 18 unasserted codes, extension bounds, closed lane, create_pda's guard halves #100) found 25 of 38 Vault refusals that no program test could fail. Its unit pinned them but never recorded the finding it reserved. The row restates §3 and adds nothing to it.
  • 6aa6838: the guardian_set fuzz target returned on inputs under 66 bytes, so GuardianSet::parse's empty-payload branch (governance.rs:192) never ran under the fuzzer. Line coverage hid this, because the line also runs for every non-empty set. The target now accepts a 65-byte empty set and has a seed for it.
  • 67c3bf3: in 417,217,029 runs on 17 Oct, no loader_parsers input got past elf_info's ELF magic check (floor.rs:44). The target took arbitrary Vecs, whose decoding puts a byte before every element, so the four magic bytes were never contiguous. This is finding 41's cause, and this target was missed when the others moved to raw bytes. It now takes raw bytes, with four ELF-header seeds (BPF and SBPF machines, deployable or not, and x86-64).
  • 5f3e37f: records the 17 Oct 30-minute run of all nine targets, and the region coverage that found the two gaps above. The 6 Oct figures stay under their own date.
  • e57e5fb: records finding 109 (two fuzz targets never fully ran their parsers).

Proof

  • The empty-set path: a mutant at governance.rs:192 (Truncated -> BadCount) passed 23,444,882 runs of the old target and fails the new one in seconds. parse went from 60/61 to 61/61 regions.
  • The loader path: a mutant reading past a short header (floor.rs:44, < 52 -> < 50) passed 45,364,616 runs of the old target. The new target panics after 1,015,708 runs unseeded and after 19 with the seeds. elf_info is now at 21/21 regions and deployable_after_simd0500 at 8/8.
  • Unmutated 120 s runs of both new targets: no crash. The 30-minute run covered every target with no artifacts.
  • Each commit green; scripts/check.sh ALL CHECKS PASSED.
  • Reviewed by B: CHANGES twice (a missing row for 109, row 108 overclaiming against §3, wording), then APPROVE at r3 (REVIEWS/auto-A-fuzz-record.md). Since r3 the branch was rebased twice and three commit-message hashes stranded by the Finding 106 row: Vault liveness and exit rules had no failing test #102 restack were corrected, with the trees unchanged. An independent re-check approved that (same file).

Limits

  • The 6 Oct corpus was not kept, so whether that run reached the loader's ELF path is unknown. The docs say so.
  • The core byte parsers elf_extent, snapshot_restorable and is_canonical_abort have no fuzz target; unit tests and the core's mutation run cover them (named in docs/09; elf_extent is in the backlog).
  • The 30-minute figures are for the two changed targets' old versions; the new versions have only 120 s runs. CI fuzzes 60 s per target, plus 25 minutes weekly.

Hashes after the sync onto main (17 Oct)

sync-main-97 replayed the stack onto main d7b9bdb (#97), after the owner's README redesign (#115). Each commit's own diff is unchanged, except README hunks ported to the new README. Outside README, every old/new pair differs only by main's own changes (autopilot tasks/sync-main-115/per-commit-tree.log treebad=0, tasks/sync-main-97/pairs.log bad=0). The ids under What changed are the new ones; the runs and reviews quoted elsewhere were done at the old ones. Old = new: a592af8 = c6439d5, 815a328 = f5ad1f9, 3c2fba0 = 9d2ea58, e204730 = 6f23dcb, 9d7cf88 = 067ea3c. On the synced chain: bin/check-each-commit.sh 60/60 green, and scripts/check.sh ALL CHECKS PASSED at its tip 2fa7a7f (tasks/sync-main-97/each-commit.log, check-tip.log). Agent B reviewed the sync: REVIEWS/auto-A-sync-main-97.md (APPROVE).

Hashes after the sync onto main (19 Oct)

The sync replayed the stack onto main bb55c15 (#114), whose tree is auto/B/failover-snapshot-r2's (8506759); #113's is auto/B/floor-follow-each's (51d20d3), both built on the main they merged into. The owner's #107 edited one sentence in README.md, docs/08 and docs/09 (the devnet job, and with it ci, fails for Floor and Vault until finding 107 is deployed); and #99's merge changed README's devnet line and the guardians figure (3-8 -> 4-8 keys). Each commit's own message is unchanged. Every old/new pair's trees differ by exactly that: README.md, docs/08, docs/09, docs/assets/src/figures.py and the two PNGs, the same +/- lines for all 38 synced commits (autopilot tasks/sync-main-114/per-commit-tree.log and map.txt). The ids under What changed are the new ones; the runs and reviews quoted elsewhere were done at the old ones. Old = new: c6439d5 = 95a5be6, f5ad1f9 = 6aa6838, 9d2ea58 = 67c3bf3, 6f23dcb = 5f3e37f, 067ea3c = e57e5fb. On the synced chain: bin/check-each-commit.sh bb55c15 41/41 green (the 38 synced commits, then the murmur3 exclusion fix, finding 106's citation and the full-ledger fuzz target), and scripts/check.sh ALL CHECKS PASSED at their tip (tasks/sync-main-114/each-commit.log, check-tip.log). Agent B reviewed the sync: REVIEWS/auto-A-sync-main-114.md.

🤖 Generated with Claude Code

@shuv-amp
shuv-amp force-pushed the auto/B/failover-retry-cap branch from 11b1805 to f426140 Compare October 17, 2026 22:54
@shuv-amp
shuv-amp force-pushed the auto/B/failover-retry-cap branch from f426140 to 4deb34d Compare October 18, 2026 20:04
Base automatically changed from auto/B/failover-retry-cap to main October 19, 2026 16:59
shuv-amp and others added 5 commits October 19, 2026 22:44
The deletion run of 16 Oct (09 §3, "Vault refusals deleted one at a
time", added in 86b777b) found 25 of 38 Vault refusals that no program
test could fail, and the review two more. Its unit recorded the run in
§3 and its tests, but never the finding it reserved on 16 Oct 07:14Z
(108, FINDINGS-RESERVED). It is finding 106's class, enforced but
untested rules, so it is a finding of its own; this commit records it.

The row restates the §3 row and adds nothing to it: what survived, the
20 now pinned by a test asserting the Vault's own code, and the 7 left
(6 unreachable as far as known, custody.rs:399 argued, not proved).
The four test names cited each exist once in programs/tests/tests/
vault.rs (git grep -c). The programs did not change in that unit:
git diff --stat 39611fd 86b777b -- programs/vault/src
crates/bulkhead-core/src is empty.

README:194 and docs/12:22 count 108 findings, 96-108 recorded 13-17 Oct
(108 is recorded 17 Oct). tools/claims.py: claims OK (26 files),
findings 108.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guardian_set target returned on inputs under 66 bytes, so the set it
parsed always had at least one byte: GuardianSet::parse's empty-payload
branch (governance.rs:192, the `?` on `b.first()`) was never run by the
fuzzer. Line coverage hid it: the line also runs for every non-empty set.

Fix: accept 65-byte inputs (the flag byte and the two forbidden keys, an
empty set), skip the shaping step when the set is empty, and commit a
65-byte seed (`empty`) so CI's 60 s run reaches it at once. The core is
unchanged; the unit test units.rs:950 already pins parse(&[]) ==
Truncated. This makes the fuzz target's independent statement agree on it
too.

Evidence (tasks/fuzz-record/ in the autopilot dir):
- Coverage before, the 17 Oct 30-minute corpus (138 inputs) + 8 seeds,
  `cargo fuzz coverage guardian_set` + llvm-cov --show-functions: parse
  61 regions, 1 missed (98.36%), 40/40 lines. The missed region is
  [192:66-192:67].
- Coverage after, this target as committed (corpus 150 + 9 seeds,
  cov-gs-it10.json): parse 61/61 regions, 40/40 lines; guardian_set_ok
  6/6, encoded_len 3/3.
- Mutant `ok_or(Truncated)` -> `ok_or(BadCount)` at governance.rs:192:
  the new target fails in seconds (left: Err(BadCount) right:
  Err(Truncated), fuzz_targets/guardian_set.rs:82;
  mutant-empty-set-it10.log, this target as committed); the old target ran
  23,444,882 inputs in 61 s over the 17 Oct corpus with no failure.
- Unmutated: SECONDS_PER=120 scripts/fuzz.sh guardian_set: Done
  44,054,329 runs in 121 s (green-gs-committed-it10.log).

Sibling search: grep of the early returns in fuzz/fuzz_targets/*.rs.
floor_config, mint_policy, price_update and token_account strip only a
1-byte flag (split_first), so their parsers do get empty data; ledger,
limiter, loader_parsers and vault_state take structured input with no
length floor. guardian_set was the only target with a floor above the
header it strips. Regions the other targets miss are the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measuring region coverage of every target on the 17 Oct 30-minute corpus
(the sibling search of the previous commit) found one real gap: in
417,217,029 loader_parsers executions no input got past elf_info's ELF
magic check (floor.rs:44). Lines 46-52 never ran, nor did any arm of
deployable_after_simd0500 (floor.rs:62) but the `None` one.

Root cause: the target took `(Vec<u8>, Vec<u8>)` from `arbitrary`, whose
Vec decoding puts a continue byte before every element, so the four
magic bytes the parser compares are never contiguous input bytes, and
libFuzzer's comparison tracing, which plants compared bytes as they
are, evidently never got them through (the raw target below finds the
same path unseeded in ~1M runs). It is finding 41's
cause, which moved the four byte-parser targets to raw bytes; this
target was not moved then.

Fix: raw bytes, as the other byte-parser targets: a 2-byte little-endian
length, then the account data (that many bytes, or what is left), then
the region the snapshot check compares with. And four seeds in
fuzz/seeds/loader_parsers (scripts/fuzz.sh passes the dir when it
exists), each the length 64 and a 64-bit little-endian ELF header:
e_machine EM_BPF with e_flags 3 (deployable after SIMD-0500), EM_BPF
with e_flags 0 (the build deployable_after_simd0500 exists to refuse,
golden G-13), EM_SBPF with e_flags 0, and x86-64 (refused by machine).
The seed writer is tasks/fuzz-record/scripts/elf_seeds.py.

Evidence (tasks/fuzz-record/ in the autopilot dir):
- Before, the 17 Oct corpus (79) of the old target: elf_info 5/21
  regions, lines 46-52 never run; deployable_after_simd0500 2/8 regions.
- Mutant `header.len() < 52` -> `< 50` at floor.rs:44 (reads past a
  short header). Old target, 120 s over that corpus: 45,364,616 runs, no
  failure. New target, empty corpus, no seeds: panics after 1,015,708 runs
  ("index out of bounds: the len is 51 but the index is 51",
  floor.rs:48); new target with the four seeds: panics after 19 runs
  (mutant-short-header-{noseed,seeds}-it10.log, 120 s cap each, this
  target as committed).
- Unmutated, this target as committed: SECONDS_PER=120 scripts/fuzz.sh
  loader_parsers: Done 111,250,519 runs in 121 s (the old target: ~45M
  in 121 s), no crash (green-committed-it10.log). On its corpus (146) +
  the seeds (cov-loader-it10.json), every function the target calls at
  every line: elf_info 21/21 regions, deployable_after_simd0500 8/8,
  buffer_authority 10/10, snapshot_matches 11/11. The 7 regions missed
  (tag, opt_pubkey, program_programdata, programdata_header) are each a
  `?` or `.ok()?` after a length check, unreachable.

The split takes the 2-byte length clamped to the bytes left, so a random
length mostly leaves the region empty. That does not starve the snapshot
check: with snapshot_matches' zero-tail test deleted (floor.rs:149), the
old target and this one, unseeded and with the four seeds, each fail
within 60 s, after 1,156, 477 and 1,219 runs (snap-mutant.txt: old,
clamp-noseed, clamp-seeds4; its fixed-* rows try a split taken mod the
bytes left, not kept, as it was not needed).

The target still checks elf_info only for panics; its values are
checked by golden G-13, the property and unit tests and the
differential (Kani elf_gate_is_total checks only the gate on it). Regions the 9 targets miss in
the functions they call, as examples, not in full. Unreachable: every
`?` or `.ok()?` after a length check (here, and vault_state's per-field
reads), and the two guards 09 §6 shows unreachable (the limiter's u64
saturation, limiter.rs:276; value_v's `v > i128::MAX`, value.rs:43).
Reachable, but no harness asks for them: Config::store's and W::new's
wrong-length refusals; the limiter's closed lane (limiter.rs:173; the
target makes every capacity >= 1); a full ledger in the ledger target,
which makes at most 4 distinct mints (ledger.rs:124, :183, the
backed-amount rule at :237); value_v's shift guard (value.rs:28). The
ledger target, which drops zero and repeated positions, misses a
malformed position list (ledger.rs:128); vault_state's Backing case can
reach it (not measured). mint_policy, token_account and price_update
miss no region in any function they run. The cached corpus in CI was not inspected; its old
loader_parsers entries are read under the new layout, which is harmless
(any bytes are valid input).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/09 §2's fuzzing row and README:189 said the guardian-set target,
added 14 Oct, "has no recorded 10-minute run or coverage measurement".
It now has a 30-minute run and a coverage measurement, and measuring
regions rather than lines on that run's corpus found the two gaps the
previous two commits close. The 6 Oct figures stay as they were; the
17 Oct ones go under their own date. 09 §5.3's row for the unfinished
parse proof now names the mutant the guardian-set target newly catches.
The 6 Oct "every parser fuzzed in that run at full line coverage"
(README) and "every targeted parser at 100% of lines" (09) stay, each
followed by what the same loader target did on 17 Oct: never past
elf_info's magic check in 417M runs (lines 46-52 never run). The 6 Oct
corpus is not kept, so whether that run reached them is not known.
The account of missed regions is limited to the functions the targets
call, given as examples, not in full (the ledger target also skips a
zero debit, ledger.rs:287, as it debits only when backed > 0,
fuzz_targets/ledger.rs:68), and names the core byte parsers no target
calls: elf_extent, snapshot_restorable and is_canonical_abort (git grep
fuzz/: no match; outside the programs they are called only by the
core's own snapshot_restorable, crates/bulkhead-core/tests/floor.rs
and, for is_canonical_abort, bulkhead-diff's FC command), which unit
tests and the core's mutation run check. elf_info's values are checked
by golden G-13/G-13b (reference/golden/cases.txt:112, :154) and the
property and unit tests, not the fuzzer. The 30-minute figures are of
the two changed targets' old versions; the new ones have the 120 s
runs below. CI's fuzz job is 60 s per target and 25 min weekly
(ci.yml:251, 09 §8).

README names the target whose 17 Oct run never passed the magic check:
loader_parsers, unchanged since the 6 Oct run (git log e677a5c..8718bc7
-- fuzz/fuzz_targets/loader_parsers.rs is empty). 09 says what measured
the new targets' coverage: llvm-cov on their corpora after 120 s runs.

Evidence (tasks/fuzz-long/ and tasks/fuzz-record/ in the autopilot dir):
- SECONDS_PER=1800 scripts/fuzz.sh, 01:57-02:28Z 17 Oct, from 05668b1
  (a pre-restack commit, b900e42 after the #102 fix).
  Its core, fuzz targets and program sources equal this branch's base
  8718bc7's (git diff --stat 05668b1 8718bc7 -- crates/ fuzz/
  programs/{vault,floor,harbor}/src: empty), so the run tested the
  targets as they were before this branch. Every target "Done ... in
  1801 second(s)": floor_config 277,239,065, guardian_set 259,114,412,
  ledger 170,672,533, limiter 140,626,100, loader_parsers 417,217,029,
  mint_policy 211,914,240, price_update 439,792,309, token_account
  408,804,715, vault_state 125,129,877; fuzz/artifacts empty.
- Coverage (cargo fuzz coverage + llvm-cov): the figures and mutants are
  in the two previous commits' messages.
- tools/claims.py: claims OK (26 files).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous three commits fix and record what region coverage of the
17 Oct 30-minute fuzz corpus found; this one records it as a finding
(reserved 17 Oct 06:43Z, FINDINGS-RESERVED), in its own commit as B's
review of the branch asked.

The row's figures are the earlier commits' evidence
(tasks/fuzz-record/ in the autopilot dir): parse 60/61 regions at
40/40 lines; the governance.rs:192 mutant passed 23,444,882 runs of the
old target; 417,217,029 loader_parsers runs, none past floor.rs:44's
magic check; the short-header mutant passed 45,364,616 runs of the old
target and fails the new one after 1,015,708 runs unseeded, 19 seeded.
Finding 41 itself names only the mint-policy target, so the row places
the loader gap under §2's 6 Oct "every targeted parser at 100% of
lines", whose corpus is not kept.

README:194 and docs/12:22 count 109 findings, 96-109 recorded 13-17
Oct. tools/claims.py: claims OK (26 files), findings 109.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shuv-amp
shuv-amp merged commit a22ea47 into main Oct 19, 2026
11 checks passed
@shuv-amp
shuv-amp deleted the auto/A/fuzz-record branch October 19, 2026 17:02
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