Skip to content

machine, qmp: fuzz the record, CanResume and QMP's replies (#653) - #670

Merged
aledbf merged 2 commits into
mainfrom
fuzz/653-go-targets
Nov 23, 2026
Merged

aledbf merged 2 commits into
mainfrom
fuzz/653-go-targets

Conversation

@aledbf

@aledbf aledbf commented Nov 23, 2026

Copy link
Copy Markdown
Member

Why

The goal is a cold boot to the first SSH login in under 100 ms. Functional and security work goes in beside it. #653 asks for fuzzing where input crosses a boundary (step 5a): a checkpoint's record is bytes spin stores and copies and hands back to Resume, and QMP replies come from a QEMU a guest may have taken over.

What

  • machine/fuzz_test.go. FuzzARecordReadBack holds that any bytes that read as a Saved write one form and read back the same. A record resumes into its own machine unless its format or VMM refuses it. CanResume returns nil or a Refusal. Re-added vCPUs name only slot properties. FuzzCanResume holds that any two records give nil or a Refusal naming each difference, and nil only when the format is read. The seeds are the records record_test.go builds.
  • qmp/fuzz_test.go. FuzzWhatQEMUSays feeds the client arbitrary output in turns, through New, two Dos decoding ImageInfo, events and Last. It holds that nothing panics and that the connection ends with an error once QEMU's output ends.
  • Finding, fixed. FuzzCanResume found that a record whose machine names a fact with no name ({"value":"1"}) was accepted. A refusal of it then named nothing: : checkpoint 1, here none (same). newHardware now refuses an empty name. The input stays in machine/testdata/fuzz/FuzzCanResume as a regression test.
  • task fuzz finds the targets with go test -list '^Fuzz' and runs each for FUZZTIME (60s by default). It sets -fuzzminimizetime 5s, because at the default minute a bounded run sat idle while it minimized. ci.yml's new fuzz job runs it and keeps failing inputs as an artifact.

Verified

  • Each target fuzzed for 60s locally with 6 workers and found nothing after the fix (measured).
  • go tool task lint test mutate passes: coverage 93.46% against a floor of 93, and mutate has 0 survivors.

Steps 4 and 5b of #653 (ASan/UBSan QEMU, QEMU fuzzing) follow in their own PR.

🤖 Generated with Claude Code

aledbf and others added 2 commits November 23, 2026 14:44
…nameless fact (#653)

FuzzARecordReadBack, FuzzCanResume and FuzzWhatQEMUSays hold what a
checkpoint's record and the QMP client promise of any bytes: one form
read back, a record that resumes into its own machine unless its format
or VMM says otherwise, a Refusal naming each difference, and a
connection that ends, without a panic, once QEMU's output does.

FuzzCanResume found a record whose machine names a fact with no name:
it was read, and a refusal then named a difference of nothing
(": checkpoint 1, here none (same)"). newHardware refuses it now, and
the input stays in testdata/fuzz as a regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
task fuzz finds the targets with go test -list and runs each for
FUZZTIME, with minimization cut to 5 s: at its default minute a bounded
run spent most of its time minimizing. ci.yml's fuzz job keeps the
inputs a target failed on as an artifact, to commit with the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit eea66be into main Nov 23, 2026
15 checks passed
@aledbf
aledbf deleted the fuzz/653-go-targets branch November 23, 2026 17:54
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