Skip to content

fix(ci): fuzz-smoke fuzzes all 22 targets, and a test keeps the matrix complete - #591

Merged
scttfrdmn merged 4 commits into
mainfrom
fix/565-fuzz-every-target
Oct 6, 2026
Merged

scttfrdmn merged 4 commits into
mainfrom
fix/565-fuzz-every-target

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Fixes #565.

Change

ci.yml's fuzz-smoke matrix named 10 of the tree's 22 fuzz targets. The other 12 ran only their seed corpus as unit tests and were never fuzzed. One of them is FuzzWholeObjectResponse, which decides whether the SHA-256 verification runs at all. Your 180-second campaign on #565 found real defects in two of the twelve, in 1 s and 7 s (fixed in #571), so at the existing 60-second budget CI would have caught both on the commit that introduced them.

  • 12 rows added to the matrix, with a comment saying why they were missing and what found them. Same 60 s budget as the existing rows. Cells run in parallel, so wall-clock cost is about zero, at roughly 12 extra runner-minutes per PR.
  • TestFuzzSmokeCoversEveryFuzzTarget (internal/config/fuzz_coverage_test.go) walks the tree for ^func Fuzz and compares against the matrix in both directions. A target with no row means it's never fuzzed. A row naming a target that no longer exists would otherwise fail in fuzz-smoke.sh as "no tests to run", which looks like an infrastructure problem. Build-tagged files are included in the walk. Floor: 20 targets.
  • The shared workflow parser gains a typed strategy.matrix.include field instead of another hand-rolled walk (Converge the two workflow YAML parsers in internal/config #504's direction).

⚠️ The 12 new cells are not required checks yet

Branch protection pins the existing 10 fuzz-smoke (...) contexts by name. New matrix cells run and report, but a red one doesn't block a merge until they're added. That's a repository setting, so it isn't done here. After this merges and the cells have reported once, this adds exactly these 12. POST to /contexts appends; PATCH/PUT would replace all 39:

gh api -X POST repos/scttfrdmn/objectfs/branches/main/protection/required_status_checks/contexts \
  -f "contexts[]=fuzz-smoke (./internal/storage/s3, FuzzWholeObjectResponse)" \
  -f "contexts[]=fuzz-smoke (./internal/compression, FuzzFramedRangeRead)" \
  -f "contexts[]=fuzz-smoke (./internal/cache, FuzzChunkAssembly)" \
  -f "contexts[]=fuzz-smoke (./internal/vfs, FuzzXattrEncodingRoundTrip)" \
  -f "contexts[]=fuzz-smoke (./pkg/utils, FuzzValidatePath)" \
  -f "contexts[]=fuzz-smoke (./pkg/utils, FuzzParseBytes)" \
  -f "contexts[]=fuzz-smoke (./internal/distributed/hashring, FuzzLookupIsStable)" \
  -f "contexts[]=fuzz-smoke (./internal/awsname, FuzzValidateBucketName)" \
  -f "contexts[]=fuzz-smoke (./internal/awsname, FuzzParseStorageURI)" \
  -f "contexts[]=fuzz-smoke (./internal/awsname, FuzzValidateSSEMode)" \
  -f "contexts[]=fuzz-smoke (./internal/awsname, FuzzValidateKMSKeyID)" \
  -f "contexts[]=fuzz-smoke (./internal/awsname, FuzzValidateStorageClass)" 

requiredChecks in release_gate_test.go transcribes branch protection verbatim, so it gets the same 12 names in the same change as that call.

Verification

go test -race ./internal/config/ is clean.

Mutation Result
throwaway FuzzThrowaway565 added to internal/cache (#565's acceptance criterion) ❌ named, with its file
FuzzWholeObjectResponse row deleted ❌ named, with checksum_verify_test.go
row misspelled FuzzParseByte ❌ missing target and stale row both reported
pkg: renamed in every row ❌ each row reported as malformed, then the empty-matrix check

That last row is the second try. The first version counted a row with no pkg as a cell with an empty package, so the same mutation reported "22 targets missing". Red, but for the wrong reason.

Watch this PR's fuzz cells. These 12 targets have never been fuzzed on CI's hardware. Your campaign was clean at 180 s for ten of them, but a counterexample found here is a real finding to commit and fix, not a flake.

🤖 Generated with Claude Code

…x complete (#565)

ci.yml's fuzz-smoke matrix named 10 of the tree's 22 fuzz targets. The other
12 ran only their seed corpus as unit tests and were never fuzzed, including
FuzzWholeObjectResponse, which decides whether the SHA-256 verification runs
at all. A 180s campaign over the twelve found two real defects in 1s and 7s
(ValidateBucketName and ValidateKMSKeyID accepting control characters, fixed
in #571), so at the existing 60s budget CI would have failed on the commit
that introduced each.

Add the twelve rows. TestFuzzSmokeCoversEveryFuzzTarget walks the tree for
^func Fuzz, including build-tagged files, and compares against the matrix in
both directions: a target with no row, and a row naming a target that no
longer exists. Floor of 20 targets. The shared workflow parser gains a typed
strategy.matrix.include field for it.

Mutations: a throwaway FuzzThrowaway565 is named with its file; deleting the
FuzzWholeObjectResponse row names that target; a misspelled target reports
both the missing target and the stale row. Renaming pkg: in every row first
reported all 22 targets as missing, the right failure for the wrong reason;
a row missing either key is now reported as malformed, and the empty-matrix
check fires.
…ist's second hole (#565)

The first CI run of FuzzValidateBucketName, added to the fuzz-smoke matrix in
this PR, found a counterexample in 0.07s:

  ValidateBucketName("00`") accepted a name that makes an unparseable
  endpoint: invalid character "`" in host name

The validator refused bucketNameForbiddenBytes (/\:@?#[]%& and space) and,
after #571, control bytes, and accepted everything else. That is a deny-list,
and its second hole: "<>^{|}!$'()*+,;=~ and the backtick all passed.

Replace it with isBucketNameChar, an allow-list of ASCII letters of either
case, digits, '.', '-' and '_'. That is the legacy us-east-1 set, the widest
S3 has ever permitted, so no bucket that exists is refused; the existing
MyBucket and my_bucket acceptance cases still pass. The control-character and
non-ASCII checks keep their own messages, because both describe something
invisible.

The counterexample is committed as seed corpus (7e8429f5c2bfe6da), with
table cases for a backtick, a pipe and a tilde. Mutations: removing the
allow-list check, dropping '_', and dropping A-Z each fail named tests; the
last two also fail TestParseStorageURI. Both FuzzValidateBucketName and
FuzzParseStorageURI then ran clean for 120s through fuzz-smoke.sh.
@scttfrdmn

Copy link
Copy Markdown
Owner Author

The first CI run of the new cells found a real defect, in 0.07 s

fuzz-smoke (./internal/awsname, FuzzValidateBucketName) failed on 091f8f48 with a counterexample, which is the outcome this PR exists to make possible:

ValidateBucketName("00`") accepted a name that makes an unparseable endpoint:
  parse "https://00`.s3.us-west-2.amazonaws.com/": invalid character "`" in host name

This is the second hole in the same deny-list. #571 added control bytes to an enumerated list of URL characters; a backtick was in neither list, and neither were "<>^{|}!$'()*+,;=~. Fixed in 29960c2 by replacing the deny-list with an allow-list: letters of either case, digits, ., - and _. That is the legacy us-east-1 set, the widest S3 has ever permitted, so no existing bucket is refused. The MyBucket and my_bucket acceptance cases still pass, and mutations that narrow the set break them.

The counterexample is committed as seed corpus, as #565's acceptance criteria require, and both bucket-name fuzz targets then ran clean for 120 s locally through fuzz-smoke.sh. CHANGELOG has a Fixed entry, because config load now refuses names it used to accept.

@scttfrdmn
scttfrdmn merged commit da629cb into main Oct 6, 2026
54 checks passed
@scttfrdmn
scttfrdmn deleted the fix/565-fuzz-every-target branch October 6, 2026 22:08
scttfrdmn added a commit that referenced this pull request Oct 8, 2026
…ch protection now requires (#593)

#591 added twelve targets to the fuzz-smoke matrix (#565), and branch
protection on main now requires their contexts too: 39 required checks
became 51, added with POST to required_status_checks/contexts so the
existing 39 were not replaced. Verified by diffing the API's list before
and after (12 added, none removed) and by each of the twelve having reported
success on main's head under exactly that name first.

requiredChecks transcribes branch protection verbatim, so it gains the same
twelve names; the list and the API's contexts now diff clean at 51. Also
drops the "orphans all nineteen" count from TestCIWorkflowIsReusable's failure
message, which was already wrong at 39, in favor of pointing at requiredChecks.
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.

12 of the 22 fuzz targets are never fuzzed by CI, including the one that decides whether checksums are verified

1 participant