Skip to content

CI: fuzz every fuzz crate - #23

Merged
0xEthamin merged 1 commit into
mainfrom
ci/fuzz-gate-every-crate
Aug 23, 2026
Merged

CI: fuzz every fuzz crate#23
0xEthamin merged 1 commit into
mainfrom
ci/fuzz-gate-every-crate

Conversation

@0xEthamin

Copy link
Copy Markdown
Member

The fuzz job hardcoded cd crates/tropic01-driver before cargo fuzz list, in ci.yml and mirrored in ci-local.sh, so 2 of 8 targets had never run in any pipeline: verify_image, the firmware-image signature verifier, and drive_machine, which drives the update state machine.

scripts/fuzz-gate.sh is now the single gate body both callers invoke, per the asm-gate.sh precedent. It walks the tree for fuzz projects and pins the expected crate list, failing both when a crate is discovered but not pinned and when a pinned crate is not found. Adding a fuzz crate means editing that file, which is deliberate: the old shape failed open and in silence.

Three defects found on the way, each proven by re-injection.

cargo test --workspace selected no features, so six _fuzz seam guard tests had never run anywhere. They now run in Test and Coverage, which blocks a merge.

The drive_machine seam armed MockSeCounter::new(0). The secure element counts down, so that pinned the anti-rollback floor at u32::MAX and rejected every image regardless of its signature.

The driver's verify_cert_chain target gates its whole body on a fixed P-521 anchor parsing. One wrong byte and it consumed fuzzer input while doing nothing, coverage flat and the corpus collapsed, and the run still reported success. A test now pins that the anchor is accepted.

The fuzz job hardcoded `cd crates/tropic01-driver` before `cargo fuzz list`,
in ci.yml and mirrored in ci-local.sh, so 2 of 8 targets had never run in any
pipeline: `verify_image`, the firmware-image signature verifier, and
`drive_machine`, which drives the update state machine.

scripts/fuzz-gate.sh is now the single gate body both callers invoke, per the
asm-gate.sh precedent. It walks the tree for fuzz projects and pins the
expected crate list, failing both when a crate is discovered but not pinned
and when a pinned crate is not found. Adding a fuzz crate means editing that
file, which is deliberate: the old shape failed open and in silence.

Three defects found on the way, each proven by re-injection.

`cargo test --workspace` selected no features, so six `_fuzz` seam guard tests
had never run anywhere. They now run in Test and Coverage, which blocks a
merge.

The `drive_machine` seam armed `MockSeCounter::new(0)`. The secure element
counts down, so that pinned the anti-rollback floor at `u32::MAX` and rejected
every image regardless of its signature.

The driver's `verify_cert_chain` target gates its whole body on a fixed P-521
anchor parsing. One wrong byte and it consumed fuzzer input while doing
nothing, coverage flat and the corpus collapsed, and the run still reported
success. A test now pins that the anchor is accepted.
@0xEthamin
0xEthamin force-pushed the ci/fuzz-gate-every-crate branch from e57a2cb to 21a5665 Compare August 23, 2026 13:25
@0xEthamin
0xEthamin merged commit 465092d into main Aug 23, 2026
13 checks passed
@0xEthamin
0xEthamin deleted the ci/fuzz-gate-every-crate branch August 23, 2026 13:41
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