1 suggestion
Optional improvements
[suggestion] · The reset guard permits descriptor reuse after socket creation
Although current callers reset first, CheckGlobals accepts a late ResetFuzzedSockets() call that can give two live sockets the same descriptor.
Location: src/test/fuzz/util/net.cpp:126 (head).
Details and suggested fix
ResetFuzzedSockets() unconditionally rewinds the descriptor counter and sets g_reset_fuzzed_sockets. Creating a socket, resetting, and creating another therefore reuses the first descriptor, yet the final g_used_fuzzed_socket && !g_reset_fuzzed_sockets check passes. Since EventsPerSock hashes and compares sockets by descriptor, those sockets would share one wait entry again. Assert !g_used_fuzzed_socket before rewinding the counter to enforce the guard's documented beginning-of-input requirement. CheckGlobals clears that flag before each input, so this preserves the current callers' behavior.
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
The preceding cross-platform socket-test work deliberately sought to make fuzzed readiness events match what real operating systems can report, because security-critical callers may depend on socket API assumptions.
PR #36737 explicitly connects that effort to CVE-2026-117350 and says a more faithful mock can expose caller corner cases. It also identifies urgent-data reporting through select() as a distinct unresolved case. This supports the motivation for exercising handler invariants against more event combinations, but does not itself establish one-read-per-wakeup or stop-after-short-send as universal operating-system requirements.