Add M10.9c-1 session fuzzing and in-process abuse tests
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (checks) (push) Successful in 17s
Foundation / checks (ecs) (push) Successful in 12s
Foundation / checks (client) (push) Successful in 1m47s
Foundation / checks (tsan) (push) Successful in 5m44s
Foundation / checks (network) (push) Successful in 13m29s
Foundation / checks (postgres) (push) Successful in 44m22s
Foundation / server-image (push) Successful in 31s
Foundation / postgres-tools (push) Successful in 1m34s
Foundation / image (push) Successful in 2m37s

ADR-0097. A libFuzzer target for session protocol v4, grants, tickets and
snapshot assembly (canonical re-encoding, verifiers always refuse, a
completed snapshot is applied), with the code under test compiled in, and
a seeded smoke CTest of the same target on every platform. Four
quic-sessions abuse tests measure an honest session tick by tick under a
Hello flood (garbage, untrusted grants, silence), a datagram flood, a
slow peer and a connect/disconnect storm; it keeps every snapshot and
receipt while connections and retained state stay bounded.

evo-session-probe run --grants FILE [--grant N] logs in from an existing
bundle (a dev renewal's) without an issuer key. client_lifecycle uses
SDL_getenv (MSVC rejected std::getenv).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-07 22:57:45 -04:00
co-authored by Claude Opus 5.5
parent fe43706395
commit 5f587f80e1
12 changed files with 597 additions and 26 deletions
+4 -2
View File
@@ -545,8 +545,10 @@ sweep, replay guard). M10.8 complete. 10.9 split (ADR-0097; only evolution-dev r
runs qualify): 10.9a per-tick work measurement, load governor (refuse logins, then shed
replication with hysteresis) and its metrics done; 10.9b evo-load multi-client tool
(per-client distributions, starvation check, step verdicts, server gauges) and its process
smoke done; 10.9c abuse suite (fuzz, floods, slow peers, storms, lease loss) and 10.9d
dev-cluster harness and reference results follow.
smoke done; 10.9c-1 session fuzz target and smoke, in-process Hello and datagram floods,
slow peer and connect/disconnect storm with honest-service checks done; 10.9c-2 lease loss
with 20+ bots and a live raw-UDP abuse sender, and 10.9d dev-cluster drill harness and
reference results follow.
**Entry:** M9 client/session evidence and M7/M8 dev/stage durability. Read
NETWORK_ARCHITECTURE, PERSISTENCE_ARCHITECTURE and ADR-0017. The M9 transport is
+9 -1
View File
@@ -113,7 +113,15 @@ per step pooled and per-client distributions, a starvation check, a budget verdi
region's gauges, ending with the sustainable bot count. In a local development reference
(not evidence), one region stayed within budget up to 24 bots and the governor began
refusing at 32 (work p95 about 14 ms), with responses about 103 ms and outcomes about
665 ms throughout. Next: 10.9c, the abuse suite.
665 ms throughout. M10.9c-1 adds the abuse suite's first half:
- a libFuzzer target for session protocol v4, grants, tickets and snapshot assembly (23
million inputs, no findings), also run as a seeded smoke test on every platform;
- in-process floods (Hello, datagram), a slow peer and a connect/disconnect storm, during
which an honest session kept every snapshot and receipt.
`evo-session-probe` can now log in from a renewal's grant bundle. A dev login was welcomed
and its intention admitted (the dev region does not simulate outside drills). Next:
10.9c-2, lease loss with 20+ bots and a live raw-UDP sender.
## Previous gate - 2026-10-02
@@ -155,3 +155,43 @@ snapshots.
limit, and the 32 established sessions are unaffected. Prediction errors were 0 (no
loss on loopback), and no client starved at any step. The host step dominates the work;
the session layer stays near 0.25 ms per session (budget 0.5).
## 10.9c-1 abuse suite: fuzzing and in-process abuse (2026-10-07)
- **Fuzzing** (`tests/fuzz/session_fuzz.cpp`). For any input:
- `decode_session` never crashes, and an accepted message has a stable canonical form
(decode, encode, decode, encode gives the same bytes);
- an accepted snapshot chunk reaches the client's assembler without crashing;
- `GrantVerifier` and `HandoffVerifier` refuse the bytes, as they do the grant slot of a
decoded Hello. Each holds a real key, so an acceptance would mean a claim byte was
trusted before the signature.
Two builds:
- `evo-session-fuzz`: libFuzzer with ASan and UBSan behind `EVO_BUILD_FUZZER`, with the
session codec, replication, motion, control and verifier sources compiled in so
coverage instruments them;
- `session-fuzz-smoke`: CTest, label `network`, on every platform. It feeds 68,000
seeded inputs: random bytes, and bit flips, truncations, extensions and edge-byte
overwrites of an encoding of every v4 message type.
- **In-process abuse** (`quic-sessions`). Each test measures an honest session tick by tick
while the abuse runs. It must keep at least 90 % of its snapshots and admitted receipts,
and the server's connections and retained state must stay bounded:
- **Hello flood:** 160 raw connections over 40 ticks, sending garbage (closed with
`protocol`), well-formed Hellos signed by an untrusted key (`unauthenticated`), or
nothing (`timeout`). Connections stay within the transport bound of 32, and the region
returns to the honest connection alone.
- **Datagram flood:** an authenticated peer sends hundreds of intentions per tick for any
tick. They are throttled per session (one per tick, refused receipts), and garbage
then closes the peer (`protocol`).
- **Slow peer:** an established client that never reads or acknowledges anything. The
server retains at most its baselines for it (392 entities against a bound of 490).
- **Storm:** 120 logins across 12 accounts, half closed politely and half vanishing. The
region returns to one session and one connection.
- **Probe:** `evo-session-probe run --grants FILE [--grant N]` logs in with grant N of an
existing bundle, such as one from the dev renewal, without an issuer key. It is covered
by the M10 process test and was used against evolution-dev, where the login was welcomed
and its intention admitted. That region runs without synthetic inputs, as the Git
policy requires, so nothing is simulated there outside a drill.
- **Not yet (10.9c-2):** lease loss and SIGKILL with 20 or more `evo-load` bots attached,
and a live raw-UDP sender of mutated datagrams. Our client endpoint caps its own send
rate, so it cannot load the server's per-connection datagram cap (64, newest wins, with
an O(queue) eviction scan); the raw sender measures that.
+41
View File
@@ -5022,3 +5022,44 @@ Evidence: in the 2026-10-07 Gitea client run, all 13 CTest tests and the X11 pro
smokes passed; only the extra 32-cycle X11 invocation failed at `Application::open()`.
The same 32-cycle lifecycle test passed under SDL's dummy driver. The X11 failure did
not report its typed error, so the failing X11 backend stage was not established.
## 2026-10-07 — M10.9c-1 fuzzing and in-process abuse (ADR-0097)
Implemented:
- `tests/fuzz/session_fuzz.cpp` as a libFuzzer target (`evo-session-fuzz`, with the code
under test compiled in) and the seeded `session-fuzz-smoke` CTest (label `network`).
- Four `quic-sessions` abuse tests, each measuring an honest session tick by tick:
Hello flood, datagram flood, slow peer, and a connect/disconnect storm.
- `evo-session-probe run --grants FILE [--grant N]`, covered by the M10 process test.
- `tests/client_lifecycle.cpp` uses `SDL_getenv`: MSVC rejected `std::getenv`
(deprecation warning as error) from `1204750`, which CI cannot see (no Windows runner).
Results:
- **libFuzzer** (Clang 19, ASan and UBSan): 35.6 million inputs, then 23.3 million after
the snapshot-application assertion was added, 5 minutes each. Coverage 1541, then 1650;
no crash or sanitizer report.
- **Smoke:** 68,000 inputs per run.
- **Hello flood:** 160 peers. Every connected one was refused with the right reason
(52 `protocol`, 51 `unauthenticated`, 50 `timeout`), connections peaked at 29 of 32,
and the honest session kept 60 of 60 snapshots and receipts.
- **Datagram flood:** 1920 intentions accepted by the sender, of which 1914 were refused
by the throttle. Garbage closed the peer with `protocol`, and the honest session kept
40 of 40.
- **Slow peer:** retained entities peaked at 392 against a bound of 490, and the honest
session kept 80 of 80.
- **Storm:** 120 logins (69 seen established). The region returned to one session and one
connection, and the honest session kept 60 of 60.
- **evolution-dev, with the renewal's bundle:** grant 0 was welcomed (epoch 51), and its
first intention and an action were admitted. Nothing is simulated there outside a drill
(`REGION_INPUTS` is empty by policy), so there were no outcomes or snapshots.
Executed:
- **Linux GCC 14:**
- presets `quic` and `network` 5/5;
- `postgres-check.sh` with QUIC, all 18 suites, with the probe's bundle login.
- **Linux Clang 19:** clang-tidy 19 on the fuzz target and smoke, `quic_sessions.cpp`, the
probe and the M10 process tests (8 findings fixed); clang-format 19.
- **Windows MSVC 19.44:** presets `quic` 5/5 and `client-network` 15/15.
Not done (10.9c-2): lease loss with 20 or more bots, and a live raw-UDP sender of mutated
datagrams that loads the server's per-connection datagram cap.